blob: 776e6a54ce2287168a2e757304bbeb53ced98759 [file] [log] [blame]
JianHaoc8f1ee72017-10-31 18:01:07 +08001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15---
Andy Bavier83e02722017-11-13 17:18:41 -070016- name: Set SSH password
17 set_fact:
Andy Bavier7d014652017-11-14 17:26:18 -070018 ansible_ssh_pass: "{{ password }}"
Andy Bavier83e02722017-11-13 17:18:41 -070019
JianHaoc8f1ee72017-10-31 18:01:07 +080020- name: check flat_network interface
21 shell: ifconfig | grep -B1 "inet addr:{{ ts_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
22 args:
23 executable: /bin/bash
24 register: iface
25
26- name: disable TAS process
27 command: disable-tas
28
29- name: enable TS process
30 command: enable-ts
31
32- name: test response to test.py
33 expect:
34 command: ipcfg
35 responses:
36 Configure now?: "n"
37 Do you wish to Continue: "yes"
38 Designate management port: "{{ iface.stdout_lines }}"
39 IP Address: "{{ ts_ip }}"
Andy Bavier83e02722017-11-13 17:18:41 -070040 Network Mask: "{{ ts_mask }}"
JianHaoc8f1ee72017-10-31 18:01:07 +080041 Auto Negotiate: "yes"
Andy Bavier83e02722017-11-13 17:18:41 -070042 IP Gateway: "{{ ts_gateway }}"
JianHaoc8f1ee72017-10-31 18:01:07 +080043 Host Name: "{{ ts_host_name }}"
44 TAS IP Address: "{{ tas_ip }}"
45 NTP Server IP: "{{ ntp_ip }}"
Andy Bavier83e02722017-11-13 17:18:41 -070046 System must be rebooted: "no"
47 echo: yes
48
49- name: Re-add network interfaces to configuration
50 sudo: yes
51 notify: reboot node
52 blockinfile:
53 dest: /etc/network/interfaces
54 block: |
55 auto eth1
56 iface eth1 inet dhcp
57 auto eth2
58 iface eth2 inet dhcp
59 auto eth3
60 iface eth3 inet dhcp
61 auto eth4
62 iface eth4 inet dhcp
63 auto eth5
64 iface eth5 inet dhcp
65 auto eth6
66 iface eth6 inet dhcp