aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/install
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2016-01-18 10:05:58 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2016-01-18 10:14:45 +0800
commit77944ac2791a631cfa785d16cc32dae8082b2719 (patch)
tree76e6a13fdc27a61fb801f211169dfe33b9713e19 /deploy/adapters/ansible/roles/open-contrail/tasks/install
parentdd509497f4c6865b26cd2e7aa2ea0ecc501edb96 (diff)
bugfix: opencontrail automation deployment scripts
JIRA: COMPASS-277 Change-Id: Ia1f52c6e8e3de520cf06de99550c17879aaed2d7 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/install')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml20
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml26
2 files changed, 25 insertions, 21 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
index 17163fca..f2940215 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml
@@ -19,20 +19,20 @@
###############################################
################ workaround #################
###############################################
-#- name: "backup keepalived conf"
-# shell: mv /etc/keepalived/keepalived.conf /home/keepalived.conf
+- name: "backup keepalived conf"
+ shell: mv /etc/keepalived/keepalived.conf /home/keepalived.conf
-#- name: "uninstall keepalived"
-# action: "{{ ansible_pkg_mgr }} name=keepalived state=absent"
+- name: "uninstall keepalived"
+ action: "{{ ansible_pkg_mgr }} name=keepalived state=absent"
-#- name: "install iproute"
-# action: "{{ ansible_pkg_mgr }} name=iproute state=present"
+- name: "install iproute"
+ action: "{{ ansible_pkg_mgr }} name=iproute state=present"
-#- name: "install iproute"
-# action: "{{ ansible_pkg_mgr }} name=keepalived state=present"
+- name: "install iproute"
+ action: "{{ ansible_pkg_mgr }} name=keepalived state=present"
-#- name: "restore keepalived conf"
-# shell: mv /home/keepalived.conf /etc/keepalived/keepalived.conf
+- name: "restore keepalived conf"
+ shell: mv /home/keepalived.conf /etc/keepalived/keepalived.conf
###############################################
- name: "install contrail openstack config package"
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
index 4f21d50a..bf313e52 100755
--- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
@@ -2,20 +2,24 @@
#- hosts: all
# sudo: yes
# tasks:
-- name: "configure interface"
-# sudo: True
- lineinfile:
- dest: "/etc/network/interfaces"
- line: "{{ item }}"
- with_items:
- - "auto {{ contrail_vhost_device }}"
- - "iface {{ contrail_vhost_device }} inet static"
- - "\taddress {{ contrail_vhost_address }}"
- - "\tnetmask {{ contrail_vhost_netmask }}"
+- name: get last ip address
+ shell: expr substr `cat /etc/hostname` 5 1
+ register: lastip
+
+#- name: "configure interface"
+## sudo: True
+# lineinfile:
+# dest: "/etc/network/interfaces"
+# line: "{{ item }}"
+# with_items:
+# - "auto {{ contrail_vhost_device }}"
+# - "iface {{ contrail_vhost_device }} inet static"
+# - "\taddress {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}"
+# - "\tnetmask {{ contrail_vhost_netmask }}"
- name: "set interface address"
# sudo: True
- shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }} netmask {{ contrail_vhost_netmask }}"
+ shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }} netmask {{ contrail_vhost_netmask }}"
- name: "up interface"
# sudo: True