diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks')
5 files changed, 59 insertions, 45 deletions
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 4e914749..4f21d50a 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 @@ -8,15 +8,15 @@ dest: "/etc/network/interfaces" line: "{{ item }}" with_items: - - "auto {{ contrail_device }}" - - "iface {{ contrail_device }} inet static" - - "\taddress {{ contrail_address }}" - - "\tnetmask {{ contrail_netmask }}" + - "auto {{ contrail_vhost_device }}" + - "iface {{ contrail_vhost_device }} inet static" + - "\taddress {{ contrail_vhost_address }}" + - "\tnetmask {{ contrail_vhost_netmask }}" - name: "set interface address" # sudo: True - shell: "ifconfig {{ contrail_device }} {{ contrail_address }} netmask {{ contrail_netmask }}" + shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }} netmask {{ contrail_vhost_netmask }}" - name: "up interface" # sudo: True - shell: "ifconfig {{ contrail_device }} up" + shell: "ifconfig {{ contrail_vhost_device }} up" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml index 93f22117..09802175 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml @@ -37,10 +37,9 @@ # or inventory_hostname in groups['opencontrail_tsn'] -# Compass adapter: use OpenStack management network "mgmt" -#- name: Install interface on all hosts for Open Contrail -# include: install/install-interface.yml -# when: groups['opencontrail_control']|length !=0 +- name: Install interface on all hosts for Open Contrail + include: install/install-interface.yml + when: groups['opencontrail_control']|length !=0 #- include: install/install-common.yml #- include: install/install-kernel.yml diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml index b8c07ddd..a9f34ed6 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-add-nodes.yml @@ -2,6 +2,15 @@ #- hosts: config # sudo: yes # tasks: + +- name: "recover rabbitmq-server service script" + shell: if [ ! -f "\/etc\/init.d\/rabbitmq-server.initd.supervisord" ] ; then mv /etc/init.d/rabbitmq-server.initd.supervisord /home/rabbitmq-server.initd.supervisord; mv /etc/init.d/rabbitmq-server /home/rabbit-server; mv /etc/init.d/rabbitmq-server.backup /etc/init.d/rabbitmq-server; fi + +- name: "restart rabbitmq-server" + service: + name: "rabbitmq-server" + state: "restarted" + - name: "provision config node" shell: "python /opt/contrail/utils/provision_config_node.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" when: inventory_hostname in groups['opencontrail_config'] diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml index 7b87622c..e38cf52f 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml @@ -38,7 +38,7 @@ - name: "set contrail device name for ansible" set_fact: - contrail_ansible_device: "ansible_{{ contrail_device }}" + contrail_ansible_device: "ansible_{{ contrail_vhost_device }}" - name: "fix up default pmac" template: @@ -52,7 +52,7 @@ lineinfile: dest: "/etc/contrail/agent_param" regexp: "dev=__DEVICE__" - line: "dev={{ contrail_device }}" + line: "dev={{ contrail_vhost_device }}" - name: "fix up contrail vrouter agent config" template: @@ -62,9 +62,9 @@ - name: "delete lines for contrail interface" shell: "{{ item }}" with_items: - - "sed -e '/auto {{ contrail_device }}/,$d' /etc/network/interfaces > /tmp/contrail-interfaces-top" - - "sed -n -e '/auto {{ contrail_device }}/,$p' /etc/network/interfaces > /tmp/contrail-interfaces-bottom" - - "sed -i -e '/auto {{ contrail_device }}/d' /tmp/contrail-interfaces-bottom" + - "sed -e '/auto {{ contrail_vhost_device }}/,$d' /etc/network/interfaces > /tmp/contrail-interfaces-top" + - "sed -n -e '/auto {{ contrail_vhost_device }}/,$p' /etc/network/interfaces > /tmp/contrail-interfaces-bottom" + - "sed -i -e '/auto {{ contrail_vhost_device }}/d' /tmp/contrail-interfaces-bottom" - "sed -i -n -e '/auto .*/,$p' /tmp/contrail-interfaces-bottom" - "cat /tmp/contrail-interfaces-top /tmp/contrail-interfaces-bottom > /etc/network/interfaces" @@ -77,22 +77,28 @@ - "sed -i -n -e '/auto .*/,$p' /tmp/contrail-interfaces-bottom" - "cat /tmp/contrail-interfaces-top /tmp/contrail-interfaces-bottom > /etc/network/interfaces" -#- name: "configure interface" -# lineinfile: -# dest: "/etc/network/interfaces" -# line: "{{ item }}" -# state: "present" -# with_items: -# - "auto {{ contrail_device }}" -# - "iface {{ contrail_device }} inet manual" -# - "\tpre-up ifconfig {{ contrail_device }} up" -# - "\tpost-down ifconfig {{ contrail_device }} down" -# - "auto vhost0" -# - "iface vhost0 inet static" -# - "\tpre-up /opt/contrail/bin/if-vhost0" -# - "\tnetwork_name application" -# - "\taddress {{ contrail_address }}" -# - "\tnetmask {{ contrail_netmask }}" +- name: "configure interface" + lineinfile: + dest: "/etc/network/interfaces" + line: "{{ item }}" + state: "present" + with_items: + - "auto {{ contrail_vhost_device }}" + - "iface {{ contrail_vhost_device }} inet manual" + - "\tpre-up ifconfig {{ contrail_vhost_device }} up" + - "\tpost-down ifconfig {{ contrail_vhost_device }} down" + - "auto vhost0" + - "iface vhost0 inet static" + - "\tpre-up /opt/contrail/bin/if-vhost0" + - "\tnetwork_name application" + - "\taddress {{ contrail_vhost_address }}" + - "\tnetmask {{ contrail_vhost_netmask }}" + +- name: "load vrouter driver" + command: su -s /bin/sh -c "insmod /var/lib/dkms/vrouter/2.21/build/vrouter.ko" + +- name: "run vhost0 script" + command: su -s /bin/sh -c "/opt/contrail/bin/if-vhost0" - name: "delete temporary files" file: @@ -164,9 +170,9 @@ # name: "nova-compute" # state: "restarted" -#- name: "add vrouter to contrail" -# shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" -# +- name: "add vrouter to contrail" + shell: "python /opt/contrail/utils/provision_vrouter.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --admin_tenant_name admin --openstack_ip {{ contrail_keystone_address }} --oper add --host_name {{ ansible_hostname }} --host_ip {{ contrail_address }}" + #- name: "reboot Server" # shell: "shutdown -r now" # async: 0 diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml index 33ad6507..7c46f11a 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-tsn.yml @@ -17,7 +17,7 @@ - name: "set contrail device name for ansible" set_fact: - contrail_ansible_device: "ansible_{{ contrail_device }}" + contrail_ansible_device: "ansible_{{ contrail_vhost_device }}" - name: "fix up default pmac" template: @@ -31,7 +31,7 @@ lineinfile: dest: "/etc/contrail/agent_param" regexp: "dev=__DEVICE__" - line: "dev={{ contrail_device }}" + line: "dev={{ contrail_vhost_device }}" - name: "set vrouter agent mode" set_fact: @@ -45,9 +45,9 @@ - name: "delete lines for contrail interface" shell: "{{ item }}" with_items: - - "sed -e '/auto {{ contrail_device }}/,$d' /etc/network/interfaces > /tmp/contrail-interfaces-top" - - "sed -n -e '/auto {{ contrail_device }}/,$p' /etc/network/interfaces > /tmp/contrail-interfaces-bottom" - - "sed -i -e '/auto {{ contrail_device }}/d' /tmp/contrail-interfaces-bottom" + - "sed -e '/auto {{ contrail_vhost_device }}/,$d' /etc/network/interfaces > /tmp/contrail-interfaces-top" + - "sed -n -e '/auto {{ contrail_vhost_device }}/,$p' /etc/network/interfaces > /tmp/contrail-interfaces-bottom" + - "sed -i -e '/auto {{ contrail_vhost_device }}/d' /tmp/contrail-interfaces-bottom" - "sed -i -n -e '/auto .*/,$p' /tmp/contrail-interfaces-bottom" - "cat /tmp/contrail-interfaces-top /tmp/contrail-interfaces-bottom > /etc/network/interfaces" @@ -66,16 +66,16 @@ line: "{{ item }}" state: "present" with_items: - - "auto {{ contrail_device }}" - - "iface {{ contrail_device }} inet manual" - - "\tpre-up ifconfig {{ contrail_device }} up" - - "\tpost-down ifconfig {{ contrail_device }} down" + - "auto {{ contrail_vhost_device }}" + - "iface {{ contrail_vhost_device }} inet manual" + - "\tpre-up ifconfig {{ contrail_vhost_device }} up" + - "\tpost-down ifconfig {{ contrail_vhost_device }} down" - "auto vhost0" - "iface vhost0 inet static" - "\tpre-up /opt/contrail/bin/if-vhost0" - "\tnetwork_name application" - - "\taddress {{ contrail_address }}" - - "\tnetmask {{ contrail_netmask }}" + - "\taddress {{ contrail_vhost_address }}" + - "\tnetmask {{ contrail_vhost_netmask }}" - name: "delete temporary files" file: |