blob: 4374fe94fb4f7eeca4063b4c39c1500d4e7f059c [file] [log] [blame]
JianHao90e65dc2017-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 Bavierc79d99f2017-11-13 17:18:41 -070016# Should be in the data model, not hardcoded here...
17- name: Set SSH password
18 set_fact:
19 ansible_ssh_pass: cfguser
20
JianHao90e65dc2017-10-31 18:01:07 +080021- name: check flat_network interface
22 shell: ifconfig | grep -B1 "inet addr:{{ ts_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
23 args:
24 executable: /bin/bash
25 register: iface
26
27- name: disable TAS process
28 command: disable-tas
29
30- name: enable TS process
31 command: enable-ts
32
33- name: test response to test.py
34 expect:
35 command: ipcfg
36 responses:
37 Configure now?: "n"
38 Do you wish to Continue: "yes"
39 Designate management port: "{{ iface.stdout_lines }}"
40 IP Address: "{{ ts_ip }}"
Andy Bavierc79d99f2017-11-13 17:18:41 -070041 Network Mask: "{{ ts_mask }}"
JianHao90e65dc2017-10-31 18:01:07 +080042 Auto Negotiate: "yes"
Andy Bavierc79d99f2017-11-13 17:18:41 -070043 IP Gateway: "{{ ts_gateway }}"
JianHao90e65dc2017-10-31 18:01:07 +080044 Host Name: "{{ ts_host_name }}"
45 TAS IP Address: "{{ tas_ip }}"
46 NTP Server IP: "{{ ntp_ip }}"
Andy Bavierc79d99f2017-11-13 17:18:41 -070047 System must be rebooted: "no"
48 echo: yes
49
50- name: Re-add network interfaces to configuration
51 sudo: yes
52 notify: reboot node
53 blockinfile:
54 dest: /etc/network/interfaces
55 block: |
56 auto eth1
57 iface eth1 inet dhcp
58 auto eth2
59 iface eth2 inet dhcp
60 auto eth3
61 iface eth3 inet dhcp
62 auto eth4
63 iface eth4 inet dhcp
64 auto eth5
65 iface eth5 inet dhcp
66 auto eth6
67 iface eth6 inet dhcp