aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/install
diff options
context:
space:
mode:
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