CORD-2255 Fix var names to match playbook
CORD-2256 Enable SSH password login to VM
Change-Id: Ia2951be47865f1654491718f32360ab48d35cfed
diff --git a/xos/synchronizer/steps/roles/ts_config/handlers/main.yml b/xos/synchronizer/steps/roles/ts_config/handlers/main.yml
new file mode 100644
index 0000000..ead740f
--- /dev/null
+++ b/xos/synchronizer/steps/roles/ts_config/handlers/main.yml
@@ -0,0 +1,18 @@
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+---
+- name: reboot node
+ sudo: yes
+ command: /sbin/shutdown -r now
diff --git a/xos/synchronizer/steps/roles/ts_config/tasks/main.yaml b/xos/synchronizer/steps/roles/ts_config/tasks/main.yaml
index 76e2fdc..4374fe9 100644
--- a/xos/synchronizer/steps/roles/ts_config/tasks/main.yaml
+++ b/xos/synchronizer/steps/roles/ts_config/tasks/main.yaml
@@ -13,6 +13,11 @@
# limitations under the License.
---
+# Should be in the data model, not hardcoded here...
+- name: Set SSH password
+ set_fact:
+ ansible_ssh_pass: cfguser
+
- name: check flat_network interface
shell: ifconfig | grep -B1 "inet addr:{{ ts_ip }}" | awk '$1!="inet" && $1!="--" {print $1}'
args:
@@ -33,11 +38,30 @@
Do you wish to Continue: "yes"
Designate management port: "{{ iface.stdout_lines }}"
IP Address: "{{ ts_ip }}"
- Network Mask: "{{ ts_ip_mask }}"
+ Network Mask: "{{ ts_mask }}"
Auto Negotiate: "yes"
- IP Gateway: "{{ ts_gw }}"
+ IP Gateway: "{{ ts_gateway }}"
Host Name: "{{ ts_host_name }}"
TAS IP Address: "{{ tas_ip }}"
NTP Server IP: "{{ ntp_ip }}"
- System must be rebooted: "yes"
- echo: yes
\ No newline at end of file
+ System must be rebooted: "no"
+ echo: yes
+
+- name: Re-add network interfaces to configuration
+ sudo: yes
+ notify: reboot node
+ blockinfile:
+ dest: /etc/network/interfaces
+ block: |
+ auto eth1
+ iface eth1 inet dhcp
+ auto eth2
+ iface eth2 inet dhcp
+ auto eth3
+ iface eth3 inet dhcp
+ auto eth4
+ iface eth4 inet dhcp
+ auto eth5
+ iface eth5 inet dhcp
+ auto eth6
+ iface eth6 inet dhcp