JianHao | c8f1ee7 | 2017-10-31 18:01:07 +0800 | [diff] [blame] | 1 | # 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 Bavier | 83e0272 | 2017-11-13 17:18:41 -0700 | [diff] [blame] | 16 | - name: Set SSH password |
| 17 | set_fact: |
Andy Bavier | 7d01465 | 2017-11-14 17:26:18 -0700 | [diff] [blame^] | 18 | ansible_ssh_pass: "{{ password }}" |
Andy Bavier | 83e0272 | 2017-11-13 17:18:41 -0700 | [diff] [blame] | 19 | |
JianHao | c8f1ee7 | 2017-10-31 18:01:07 +0800 | [diff] [blame] | 20 | - 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 Bavier | 83e0272 | 2017-11-13 17:18:41 -0700 | [diff] [blame] | 40 | Network Mask: "{{ ts_mask }}" |
JianHao | c8f1ee7 | 2017-10-31 18:01:07 +0800 | [diff] [blame] | 41 | Auto Negotiate: "yes" |
Andy Bavier | 83e0272 | 2017-11-13 17:18:41 -0700 | [diff] [blame] | 42 | IP Gateway: "{{ ts_gateway }}" |
JianHao | c8f1ee7 | 2017-10-31 18:01:07 +0800 | [diff] [blame] | 43 | Host Name: "{{ ts_host_name }}" |
| 44 | TAS IP Address: "{{ tas_ip }}" |
| 45 | NTP Server IP: "{{ ntp_ip }}" |
Andy Bavier | 83e0272 | 2017-11-13 17:18:41 -0700 | [diff] [blame] | 46 | 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 |