diff options
author | chenshuai@huawei.com <chenshuai@huawei.com> | 2015-12-08 20:08:46 +0800 |
---|---|---|
committer | chenshuai@huawei.com <chenshuai@huawei.com> | 2015-12-08 20:11:12 +0800 |
commit | e408668e84f138f69317ff63e68b823dfe80188b (patch) | |
tree | 3279a6cd251f051265d653fa487eaec0c5d3e4b6 | |
parent | 4d32ee565ecd829a2ec767cae6d8cd23df8e6263 (diff) |
OpenContrail Script Adapter
JIRA: COMPASS-186
Change-Id: I792bc1b592348c9bcc21d6e3616d7b0b79d13f25
Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
28 files changed, 131 insertions, 114 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml index 02bc7f81..5dbf9244 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-collector.yml @@ -6,7 +6,7 @@ - name: "temporary disable supervisor analytics" template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-analytics.override" - name: "install contrail openstack analytics package" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml index ea08e49b..3a57fdf0 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-common.yml @@ -2,11 +2,19 @@ #- hosts: all # sudo: yes # tasks: -- name: "copy contrail install package temporary" +#- name: "copy contrail install package temporary" # sudo: True - copy: - src: "files/{{ package }}" - dest: "/tmp/{{ package }}" +# copy: +# src: "{{ package }}" +# dest: "/tmp/{{ package }}" + +- name: get image http server + shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf + register: http_server + +- name: download OpenContrail package file + get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/open-contrail/{{ package }}" dest=/tmp/{{ package }} + - name: "install contrail install package" # sudo: True @@ -49,6 +57,7 @@ apt: deb: "{{ item }}" with_items: required_packages.stdout_lines + ignore_errors: True - name: modify source list # sudo: True diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml index 12b6ad28..6c85ce55 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-compute.yml @@ -5,7 +5,7 @@ - name: "temporary disable supervisor vrouter" # sudo: True template: - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-vrouter.override" # - name: "install nova-compute for contrail package" 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 52459eb8..1d493f58 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 @@ -6,14 +6,14 @@ # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-config.override" - name: "temporary disable neutron server" # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/neutron-server.override" - name: "install contrail openstack config package" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml index 6bb7fb25..7e917d16 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-control.yml @@ -6,14 +6,14 @@ # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-control.override" - name: "temporary disable supervisor dns" # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-dns.override" - name: "install contrail openstack control package" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml index fea4cef7..68c5946b 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-database.yml @@ -6,7 +6,7 @@ # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-database.override" - name: "install contrail openstack database package" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml index 6d4ca035..8b0e3347 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-kernel.yml @@ -2,6 +2,7 @@ #- hosts: all # sudo: yes # tasks: + - name: "install Ubuntu kernel" # sudo: True # apt: @@ -39,7 +40,7 @@ # when: (kernel_install) and (ansible_kernel != "3.13.0-40-generic") when: (kernel_install) and (ansible_kernel != kernel_required) -handlers: +# handlers: - name: "Wait for server to come back" local_action: module: wait_for diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml index d66af675..22156ca3 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-webui.yml @@ -7,7 +7,7 @@ # sudo: True template: # src: "templates/override.j2" - src: "install/override.j2" + src: "../../templates/install/override.j2" dest: "/etc/init/supervisor-webui.override" - name: "install contrail openstack webui package" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml index 2a0e2709..93f22117 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml @@ -33,7 +33,8 @@ - name: Install compute for Open Contrail include: install/install-compute.yml - when: inventory_hostname in groups['opencontrail_compute'] or inventory_hostname in groups['opencontrail_tsn'] + when: inventory_hostname in groups['opencontrail_compute'] +# or inventory_hostname in groups['opencontrail_tsn'] # Compass adapter: use OpenStack management network "mgmt" @@ -52,9 +53,9 @@ #- include: install/install-interface.yml -- name: Provision route on all hosts for Open Contrail - include: provision/provision-route.yml - when: groups['opencontrail_control']|length !=0 +#- name: Provision route on all hosts for Open Contrail +# include: provision/provision-route.yml +# when: groups['opencontrail_control']|length !=0 #- name: Provision rabbitmq on config for Open Contrail @@ -64,7 +65,8 @@ - name: Provision increase limits for Open Contrail include: provision/provision-increase-limits.yml - when: inventory_hostname in groups['opencontrail_control'] or inventory_hostname in groups['opencontrail_config'] or inventory_hostname in groups['opencontrail_collector'] or inventory_hostname in groups['opencontrail_database'] + when: inventory_hostname in groups['opencontrail_control'] +#or inventory_hostname in groups['opencontrail_config'] or inventory_hostname in groups['opencontrail_collector'] or inventory_hostname in groups['opencontrail_database'] - name: Provision database for Open Contrail @@ -76,7 +78,6 @@ include: provision/provision-config.yml when: inventory_hostname in groups['opencontrail_config'] - - name: Provision control for Open Contrail include: provision/provision-control.yml when: inventory_hostname in groups['opencontrail_control'] 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 f4ad05cb..b8c07ddd 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 @@ -44,4 +44,4 @@ shell: "python /opt/contrail/utils/provision_encap.py --api_server_ip {{ contrail_haproxy_address }} --admin_user {{ contrail_admin_user }} --admin_password {{ contrail_admin_password }} --oper add --encap_priority MPLSoUDP,MPLSoGRE,VXLAN" run_once: yes when: inventory_hostname in groups['opencontrail_config'] -
\ No newline at end of file + diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml index 5dd72d77..4077ba64 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-collector.yml @@ -19,19 +19,19 @@ - name: "fix up contrail collector config" template: - src: "provision/contrail-collector-conf.j2" + src: "../../templates/provision/contrail-collector-conf.j2" dest: "/etc/contrail/contrail-collector.conf" - name: "fix up contrail query engine config" template: - src: "provision/contrail-query-engine-conf.j2" + src: "../../templates/provision/contrail-query-engine-conf.j2" dest: "/etc/contrail/contrail-query-engine.conf" - name: "fix up contrail analytics api config" template: - src: "provision/contrail-analytics-api-conf.j2" + src: "../../templates/provision/contrail-analytics-api-conf.j2" dest: "/etc/contrail/contrail-analytics-api.conf" @@ -45,7 +45,7 @@ - name: "fix up contrail keystone auth config" template: - src: "provision/contrail-keystone-auth-conf.j2" + src: "../../templates/provision/contrail-keystone-auth-conf.j2" dest: "/etc/contrail/contrail-keystone-auth.conf" force: no 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 41ea5c25..3e3d6622 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 @@ -17,7 +17,7 @@ - name: "create cgroup device acl for qemu conf" template: - src: "provision/qemu-device-acl-conf.j2" + src: "../../templates/provision/qemu-device-acl-conf.j2" dest: "/tmp/qemu-device-acl.conf" when: deviceacl | failed @@ -33,7 +33,7 @@ - name: "fix up vrouter nodemgr param" template: - src: "provision/vrouter-nodemgr-param.j2" + src: "../../templates/provision/vrouter-nodemgr-param.j2" dest: "/etc/contrail/vrouter_nodemgr_param" - name: "set contrail device name for ansible" @@ -42,7 +42,7 @@ - name: "fix up default pmac" template: - src: "provision/default-pmac.j2" + src: "../../templates/provision/default-pmac.j2" dest: "/etc/contrail/default_pmac" - name: "copy agent param config from template" @@ -56,7 +56,7 @@ - name: "fix up contrail vrouter agent config" template: - src: "provision/contrail-vrouter-agent-conf.j2" + src: "../../templates/provision/contrail-vrouter-agent-conf.j2" dest: "/etc/contrail/contrail-vrouter-agent.conf" - name: "delete lines for contrail interface" @@ -77,22 +77,22 @@ - "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_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: "delete temporary files" file: diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml index 8aa8f43b..cef5bbff 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml @@ -35,7 +35,8 @@ - name: "create haproxy configuration for contrail" template: - src: "provision/haproxy-contrail-cfg.j2" +# src: "provision/haproxy-contrail-cfg.j2" + src: "../../templates/provision/haproxy-contrail-cfg.j2" dest: "/tmp/haproxy-contrail.cfg" - name: "combination of the haproxy configuration" @@ -54,7 +55,7 @@ # Compass is using this #- name: "create keepalived configuration" # template: -# src: "provision/keepalived-conf.j2" +# src: "../../templates/provision/keepalived-conf.j2" # dest: "/etc/keepalived/keepalived.conf" # with_indexed_items: groups['opencontrail_config'] # when: contrail_keepalived and item.1 == inventory_hostname @@ -70,37 +71,37 @@ - name: "fix up contrail keystone auth config" template: - src: "provision/contrail-keystone-auth-conf.j2" + src: "../../templates/provision/contrail-keystone-auth-conf.j2" dest: "/etc/contrail/contrail-keystone-auth.conf" - name: "fix up ifmap server log4j properties" template: - src: "provision/ifmap-log4j-properties.j2" + src: "../../templates/provision/ifmap-log4j-properties.j2" dest: "/etc/ifmap-server/log4j.properties" - name: "fix up ifmap server authorization properties" template: - src: "provision/ifmap-authorization-properties.j2" + src: "../../templates/provision/ifmap-authorization-properties.j2" dest: "/etc/ifmap-server/authorization.properties" - name: "fix up ifmap server basicauthusers properties" template: - src: "provision/ifmap-basicauthusers-properties.j2" + src: "../../templates/provision/ifmap-basicauthusers-properties.j2" dest: "/etc/ifmap-server/basicauthusers.properties" - name: "fix up ifmap server publisher properties" template: - src: "provision/ifmap-publisher-properties.j2" + src: "../../templates/provision/ifmap-publisher-properties.j2" dest: "/etc/ifmap-server/publisher.properties" - name: "fix up contrail api config" template: - src: "provision/contrail-api-conf.j2" + src: "../../templates/provision/contrail-api-conf.j2" dest: "/etc/contrail/contrail-api.conf" - name: "fix up contrail api supervisord config" template: - src: "provision/contrail-api-supervisord-conf.j2" + src: "../../templates/provision/contrail-api-supervisord-conf.j2" dest: "/etc/contrail/supervisord_config_files/contrail-api.ini" - name: "modify contrail api init script" @@ -111,27 +112,27 @@ - name: "fix up contrail schema config" template: - src: "provision/contrail-schema-conf.j2" + src: "../../templates/provision/contrail-schema-conf.j2" dest: "/etc/contrail/contrail-schema.conf" - name: "fix up contrail device manager config" template: - src: "provision/contrail-device-manager-conf.j2" + src: "../../templates/provision/contrail-device-manager-conf.j2" dest: "/etc/contrail/contrail-device-manager.conf" - name: "fix up contrail svc monitor config" template: - src: "provision/contrail-svc-monitor-conf.j2" + src: "../../templates/provision/contrail-svc-monitor-conf.j2" dest: "/etc/contrail/contrail-svc-monitor.conf" - name: "fix up contrail discovery supervisord config" template: - src: "provision/contrail-discovery-supervisord-conf.j2" + src: "../../templates/provision/contrail-discovery-supervisord-conf.j2" dest: "/etc/contrail/supervisord_config_files/contrail-discovery.ini" - name: "fix up contrail discovery config" template: - src: "provision/contrail-discovery-conf.j2" + src: "../../templates/provision/contrail-discovery-conf.j2" dest: "/etc/contrail/contrail-discovery.conf" - name: "modify contrail discovery init script" @@ -142,7 +143,7 @@ - name: "fix up contrail vnc api library config" template: - src: "provision/contrail-vnc-api-lib-ini.j2" + src: "../../templates/provision/contrail-vnc-api-lib-ini.j2" dest: "/etc/contrail/vnc_api_lib.ini" - name: "fix up contrail config nodemgr config" @@ -154,7 +155,7 @@ - name: "fix up contrail sudoers" template: - src: "provision/contrail-sudoers.j2" + src: "../../templates/provision/contrail-sudoers.j2" dest: "/etc/sudoers.d/contrail_sudoers" mode: 0440 @@ -165,7 +166,7 @@ - name: "fix up contrail plugin for nuetron" template: - src: "provision/neutron-contrail-plugin-ini.j2" + src: "../../templates/provision/neutron-contrail-plugin-ini.j2" dest: "/etc/neutron/plugins/opencontrail/ContrailPlugin.ini" - name: "modify neutron server configuration" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml index e36d8f22..1a5ddf7b 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml @@ -15,13 +15,15 @@ - name: "modify ifmap server basicauthusers properties for control" lineinfile: dest: "/etc/ifmap-server/basicauthusers.properties" - line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}" +# line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}" + line: "{{ contrail_address }}:{{ contrail_address }}" with_items: groups['opencontrail_control'] - name: "modify ifmap server basicauthusers properties for dns" lineinfile: dest: "/etc/ifmap-server/basicauthusers.properties" - line: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns" +# line: "{{ hostvars[item]['contrail_address' ] }}.dns:{{ hostvars[item]['contrail_address' ] }}.dns" + line: "{{ contrail_address }}.dns:{{ contrail_address }}.dns" with_items: groups['opencontrail_control'] - name: "node-common" @@ -29,12 +31,12 @@ - name: "fix up contrail control config" template: - src: "provision/contrail-control-conf.j2" + src: "../../templates/provision/contrail-control-conf.j2" dest: "/etc/contrail/contrail-control.conf" - name: "fix up contrail dns config" template: - src: "provision/contrail-dns-conf.j2" + src: "../../templates/provision/contrail-dns-conf.j2" dest: "/etc/contrail/contrail-dns.conf" - name: "fix up contrail control nodemgr config" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml index 6807d7d4..f95e7feb 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml @@ -46,19 +46,25 @@ - { regexp: "^(#(\\s*)?)?initial_token:", line: "# initial_token:" } + - name: "set first database host seed" # sudo: True set_fact: - dbseeds: "{{ hostvars[item.1]['contrail_address'] }}" - with_indexed_items: groups['database'] +# dbseeds: "{{ hostvars[item.1][ contrail_address ] }}" + dbseeds: "{{ contrail_address }}" + with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 + + + - name: "set second database host seed" # sudo: True set_fact: - dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}" - with_indexed_items: groups['database'] +# dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}" + dbseeds: "{{ dbseeds }},{{ contrail_address }}" + with_indexed_items: groups['opencontrail_database'] when: item.0 == 1 @@ -112,16 +118,17 @@ lineinfile: dest: "/etc/zookeeper/conf/zoo.cfg" regexp: "server.{{ item.0 + 1 }}=" - line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888" - with_indexed_items: groups['database'] +# line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888" + line: "server.{{ item.0 + 1 }}={{ contrail_address }}:2888:3888" + with_indexed_items: groups['opencontrail_database'] - name: "set zookeeper unique id" # sudo: True template: - src: "templates/zookeeper-unique-id.j2" + src: "../../templates/provision/zookeeper-unique-id.j2" dest: "/var/lib/zookeeper/myid" - with_indexed_items: groups['database'] + with_indexed_items: groups['opencontrail_database'] when: item.1 == inventory_hostname @@ -135,16 +142,18 @@ - name: "set first zookeeper host address" # sudo: True set_fact: - zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181" - with_indexed_items: groups['database'] +# zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181" + zkaddrs: "{{ contrail_address }}:2181" + with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 - name: "set second or more zookeeper host addresses" # sudo: True set_fact: - zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181" - with_indexed_items: groups['database'] +# zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181" + zkaddrs: "{{ zkaddrs }},{{ contrail_address }}:2181" + with_indexed_items: groups['opencontrail_database'] when: item.0 > 0 diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml index eb6301b2..1090ddaa 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml @@ -16,13 +16,15 @@ - name: "set first cassandra host address" set_fact: - cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'" +# cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'" + cassandra_addrs: "'{{ contrail_address }}'" with_indexed_items: groups['opencontrail_database'] when: item.0 == 0 - name: "set second or more cassandra host addresses" set_fact: - cassandra_addrs: "{{ cassandra_addrs }}, '{{ hostvars[item.1]['contrail_address'] }}'" +# cassandra_addrs: "{{ cassandra_addrs }}, '{{ hostvars[item.1]['contrail_address'] }}'" + cassandra_addrs: "{{ cassandra_addrs }}, '{{ contrail_address }}'" with_indexed_items: groups['opencontrail_database'] when: item.0 > 0 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 index 18192f19..f5586349 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2 @@ -2,7 +2,7 @@ host_ip = {{ contrail_address }} rest_api_ip = 0.0.0.0 rest_api_port = 9081 -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_address }}:8086 http_server_port = 8090 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2 index 1eefacfb..cb747638 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2 @@ -5,9 +5,9 @@ ifmap_server_ip = {{ contrail_address }} ifmap_server_port = 8443 ifmap_username = api-server ifmap_password = api-server -zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %} disc_server_ip = {{ contrail_haproxy_address }} disc_server_port = 5998 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2 index e6242346..ea843880 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2 @@ -13,7 +13,7 @@ analytics_flow_ttl = -1 # IP address and port to be used to connect to cassandra. # Multiple IP:port strings separated by space can be provided -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} # IP address and port to be used to connect to kafka. diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2 index 77bcc95f..24575aa3 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2 @@ -1,9 +1,9 @@ [DEFAULTS] api_server_ip = {{ contrail_haproxy_address }} api_server_port = 8082 -zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %} disc_server_ip = {{ contrail_haproxy_address }} disc_server_port = 5998 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2 index 84e6317f..6abcb590 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2 @@ -1,10 +1,10 @@ [DEFAULTS] listen_ip_addr = 0.0.0.0 listen_port = 5998 -zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}{% if not loop.last %}, {% endif %}{% endfor %} zk_server_port = 2181 -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %} log_file = /var/log/contrail/contrail-discovery.log log_level = SYS_NOTICE diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 index e051b7ec..a9f7c281 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2 @@ -1,6 +1,6 @@ [DEFAULT] hostip = {{ contrail_address }} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_address }}:8086 http_server_port = 8091 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2 index 2bb4ab79..f394948d 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2 @@ -1,13 +1,13 @@ [DEFAULTS] -ifmap_server_ip = {{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }} +ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} ifmap_server_port = 8443 ifmap_username = schema-transformer ifmap_password = schema-transformer -api_server_ip = {{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }} +api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} api_server_port = 8082 -zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %} disc_server_ip = {{ contrail_haproxy_address }} disc_server_port = 5998 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2 index 4b4221d7..070a60c3 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2 @@ -5,9 +5,9 @@ ifmap_username = svc-monitor ifmap_password = svc-monitor api_server_ip = {{ contrail_haproxy_address }} api_server_port = 8082 -zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['contrail_address'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9160{% if not loop.last %} {% endif %}{% endfor %} disc_server_ip = {{ contrail_haproxy_address }} disc_server_port = 5998 diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2 index 6aa4d06e..e99917bd 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/haproxy-contrail-cfg.j2 @@ -11,7 +11,7 @@ listen neutron-server bind *:9696 balance roundrobin option nolinger -{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }}:9697 check inter 2000 rise 2 fall 3 +{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9697 check inter 2000 rise 2 fall 3 {% endfor %} listen contrail-api @@ -20,14 +20,14 @@ listen contrail-api option nolinger timeout client 3m timeout server 3m -{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }}:9100 check inter 2000 rise 2 fall 3 +{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9100 check inter 2000 rise 2 fall 3 {% endfor %} listen contrail-discovery bind *:5998 balance roundrobin option nolinger -{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }}:9110 check inter 2000 rise 2 fall 3 +{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9110 check inter 2000 rise 2 fall 3 {% endfor %} listen contrail-analytics-api @@ -37,18 +37,9 @@ listen contrail-analytics-api option tcp-check tcp-check connect port 6379 default-server error-limit 1 on-error mark-down -{% for cur_host in groups['opencontrail_collector'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }}:9081 check inter 2000 rise 2 fall 3 +{% for cur_host in groups['opencontrail_collector'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9081 check inter 2000 rise 2 fall 3 {% endfor %} -{% if contrail_tor_agents is defined %}listen contrail-tor-agent - bind {% for cur_agent in contrail_tor_agents %}*:{{ cur_agent['ovs_port'] }}{% if not loop.last %},{% endif %}{% endfor %} - - mode tcp - balance leastconn - option tcplog - option tcpka -{% for cur_host in groups['opencontrail_tsn'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }} check inter 2000 -{% endfor %}{% endif %} listen rabbitmq bind *:5673 @@ -60,7 +51,7 @@ listen rabbitmq option redispatch timeout client 48h timeout server 48h -{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['contrail_address'] }} {{ hostvars[cur_host]['contrail_address'] }}:5672 check inter 2000 rise 2 fall 3 weight 1 maxconn 500 +{% for cur_host in groups['opencontrail_config'] %} server {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:5672 check inter 2000 rise 2 fall 3 weight 1 maxconn 500 {% endfor %} #contrail-marker-end diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 index 7eee51ba..a4e35d67 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 @@ -1 +1 @@ -DISCOVERY={{ hostvars[groups['opencontrail_config'][0]]['contrail_address'] }} +DISCOVERY={{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
\ No newline at end of file diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml b/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml index c64f238f..d920eee8 100755 --- a/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/open-contrail/vars/Debian.yml @@ -1,6 +1,6 @@ --- -package: "contrail-install-packages_2.21-102~juno_all.deb" +package: "contrail-install-packages_2.21-102-ubuntu-14-04juno_all.deb" common_packages: - contrail-setup diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml index 015c99b7..22b3c826 100755 --- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml @@ -1,15 +1,16 @@ --- #package: "contrail-install-packages_2.21-102~juno_all.deb" # mv to {os}.yml kernel_install: no -ansible_ssh_user: "root" -ansible_ssh_pass: "root" +#ansible_ssh_user: "root" +#ansible_ssh_pass: "root" contrail_keystone_address: "{{ internal_vip.ip }}" contrail_admin_user: "keystone" -contrail_admin_password: "{{ keystone_PASS }}" +contrail_admin_password: "service" contrail_keepalived: no -contrail_haproxy_address: "10.0.0.22" # 10.0.0.80 +#contrail_haproxy_address: "10.0.0.22" # 10.0.0.80 +contrail_haproxy_address: "{{ internal_vip.ip }}" contrail_netmask: "255.255.255.0" contrail_prefixlen: "24" contrail_gateway: "10.0.0.1" |