bugfix: change opencontrail role name 29/7629/2
authorchenshuai@huawei.com <chenshuai@huawei.com>
Thu, 21 Jan 2016 15:30:24 +0000 (23:30 +0800)
committershuai chen <chenshuai@huawei.com>
Mon, 25 Jan 2016 02:31:40 +0000 (02:31 +0000)
JIRA: COMPASS-284

Change-Id: If47438396124f805efa739bbfdd1c61d4892b4a5
Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
14 files changed:
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/open-contrail/tasks/main.yml
deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-control.yml
deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-database.yml
deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-webui.yml
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-analytics-api-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-api-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-collector-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-device-manager-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-discovery-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-query-engine-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-schema-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-svc-monitor-conf.j2
deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2

index 1f64d39..cf49bd3 100644 (file)
   roles:
     - onos_cluster
 
-#- hosts: all
-#  remote_user: root
-#  sudo: True
-#  roles:
-#    - open-contrail
+- hosts: all
+  remote_user: root
+  sudo: True
+  roles:
+    - open-contrail
 
 - hosts: controller
   remote_user: root
index d7b9ceb..f562fd9 100755 (executable)
@@ -4,14 +4,15 @@
 
 - name: backup rabbitmq-server
   shell: cp /etc/init.d/rabbitmq-server /home/rabbitmq-server
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Disable Service Daemon
   shell: if [ -f “\/opt\/service” ] ; then mv /opt/service /opt/service.bak ; fi
+  when: groups['opencontrail']|length !=0
 
 - name: Install common on all hosts for Open Contrail
   include: install/install-common.yml
-  when: groups['controller']|length !=0
+  when: groups['opencontrail']|length !=0
   # Compass install OpenStack with not only OpenContrail but also ODL or ONOS, and sometimes user just installs OpenStack, so item 'opencontrail_control' is kind of a mark that whether Compass install OpenContrail or not.
 
 #- name: Install kernal on all hosts for Open Contrail
 
 - name: Install database for Open Contrail
   include: install/install-database.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Install config for Open Contrail
   include: install/install-config.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Install config for Open Contrail
   include: install/install-control.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Install collector for Open Contrail
   include: install/install-collector.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Install webui for Open Contrail
   include: install/install-webui.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Install compute for Open Contrail
   include: install/install-compute.yml
-  when: inventory_hostname in groups['compute']
+  when: groups['opencontrail']|length !=0 and inventory_hostname not in groups['opencontrail']
 # or inventory_hostname in groups['opencontrail_tsn']
 
 
 - name: Install interface on all hosts for Open Contrail
   include: install/install-interface.yml
-  when: groups['controller']|length !=0
+  when: groups['opencontrail']|length !=0
 
 #- include: install/install-common.yml
 #- include: install/install-kernel.yml
 
 - name: Provision increase limits for Open Contrail
   include: provision/provision-increase-limits.yml
-  when: inventory_hostname in groups['controller'] 
+  when: inventory_hostname in groups['opencontrail'] 
 #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
   include: provision/provision-database.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 
 - name: Provision config for Open Contrail
   include: provision/provision-config.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 - name: Provision control for Open Contrail
   include: provision/provision-control.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 
 - name: Provision collector for Open Contrail
   include: provision/provision-collector.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 
 - name: Provision add nodes for Open Contrail
   include: provision/provision-add-nodes.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 
 - name: Provision webui for Open Contrail
   include: provision/provision-webui.yml
-  when: inventory_hostname in groups['controller']
+  when: inventory_hostname in groups['opencontrail']
 
 
 - name: Provision compute for Open Contrail
   include: provision/provision-compute.yml
-  when: inventory_hostname in groups['compute']
+  when: groups['opencontrail']|length !=0 and inventory_hostname not in groups['opencontrail']
 
 - name: Enable Service Daemon
   shell: if [ -f “\/opt\/service.bak” ] ; then mv /opt/service.bak /opt/service ; fi
+  when: groups['opencontrail']|length !=0
 
 #- name: Provision tsn for Open Contrail
 #  include: provision/provision-tsn.yml
index 67b72c7..99c5bbc 100755 (executable)
     dest: "/etc/ifmap-server/basicauthusers.properties"
 #    line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}"
     line: "{{ haproxy_hosts[item] }}:{{ haproxy_hosts[item] }}"
-  with_items: groups['controller']
+  with_items: groups['opencontrail']
 
 - 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: "{{ haproxy_hosts[item] }}.dns:{{ haproxy_hosts[item] }}.dns"
-  with_items: groups['controller']
+  with_items: groups['opencontrail']
 
 - name: "node-common"
   include: -node-common.yml
index 7ccb5af..acb0659 100755 (executable)
@@ -54,7 +54,7 @@
   set_fact:
 #    dbseeds: "{{ hostvars[item.1][ contrail_address ] }}"
      dbseeds: "{{ haproxy_hosts[item.1] }}"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.0 == 0
 
 
@@ -66,7 +66,7 @@
   set_fact:
 #    dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}"
     dbseeds: "{{ dbseeds }},{{ haproxy_hosts[item.1] }}"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.0 == 1
 
 
     regexp: "server.{{ item.0 + 1 }}="
 #    line: "server.{{ item.0 + 1 }}={{ hostvars[item.1]['contrail_address'] }}:2888:3888"
     line: "server.{{ item.0 + 1 }}={{ haproxy_hosts[item.1] }}:2888:3888"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
 
 
 - name: "set zookeeper unique id"
   template:
     src: "../../templates/provision/zookeeper-unique-id.j2"
     dest: "/var/lib/zookeeper/myid"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.1 == inventory_hostname
 
 
   set_fact:
 #    zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181"
     zkaddrs: "{{ haproxy_hosts[item.1] }}:2181"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.0 == 0
 
 
   set_fact:
 #    zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181"
     zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts[item.1] }}:2181"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.0 > 0
 
 
index 7fa3ce9..8ee4168 100755 (executable)
   set_fact:
 #    cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'"
     cassandra_addrs: "'{{ haproxy_hosts[item.1]  }}'"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   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 }}, '{{ haproxy_hosts[item.1] }}'"
-  with_indexed_items: groups['controller']
+  with_indexed_items: groups['opencontrail']
   when: item.0 > 0
 
 - name: "modify webui global js"
index 9fbeeca..85f053b 100755 (executable)
@@ -4,7 +4,7 @@ rest_api_ip = {{ contrail_haproxy_address }}
 rest_api_port = 8081
 #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 #chenshuai: This kind of written is also correct, but the following is better, this as record
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 collectors = {{ contrail_haproxy_address }}:8086
 http_server_port = 8090
index 6558413..3c633f3 100755 (executable)
@@ -5,9 +5,9 @@ ifmap_server_ip = {{ contrail_haproxy_address }}
 ifmap_server_port = 8443
 ifmap_username = api-server
 ifmap_password = api-server
-zk_server_ip = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
 
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 disc_server_ip = {{ contrail_haproxy_address }}
 disc_server_port = 5998
index d4cf2cf..822d7a0 100755 (executable)
@@ -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['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 
 # IP address and port to be used to connect to kafka.
index b2b90a5..55ad492 100755 (executable)
@@ -1,9 +1,9 @@
 [DEFAULTS]
 api_server_ip = {{ contrail_haproxy_address }}
 api_server_port = 8082
-zk_server_ip = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
 
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 disc_server_ip = {{ contrail_haproxy_address }}
 disc_server_port = 5998
index d8dbb2c..dfcc0e3 100755 (executable)
@@ -1,10 +1,10 @@
 [DEFAULTS]
 listen_ip_addr = {{ contrail_haproxy_address }}
 listen_port = 5998
-zk_server_ip = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}{% if not loop.last %}, {% endif %}{% endfor %}
 
 zk_server_port = 2181
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 log_file = /var/log/contrail/contrail-discovery.log
 log_level = SYS_NOTICE
index d1228b1..7396334 100755 (executable)
@@ -5,7 +5,7 @@ hostip = {{ contrail_address }}
 #cassandra_server_list = {% for cur_host in groups['controller'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 collectors = {{ contrail_haproxy_address }}:8086
 http_server_port = 8091
index f65ab12..e57ef5e 100755 (executable)
@@ -7,9 +7,9 @@ ifmap_password = schema-transformer
 #api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
 api_server_ip = {{ contrail_haproxy_address }}
 api_server_port = 8082
-zk_server_ip = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host]  }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host]  }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
 
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 disc_server_ip = {{ contrail_haproxy_address }}
 disc_server_port = 5998
index 0f61236..993b01a 100755 (executable)
@@ -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['controller'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
+zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %}
 
-cassandra_server_list = {% for cur_host in groups['controller'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
+cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %}
 
 disc_server_ip = {{ contrail_haproxy_address }}
 disc_server_port = 5998
index d15ec38..e638ce1 100755 (executable)
@@ -77,7 +77,7 @@ server = {{ contrail_haproxy_address }}
 
 # Number of control-nodes info to be provided by Discovery service. Possible
 # values are 1 and 2
-max_control_nodes = {{ groups['controller'] | length }}
+max_control_nodes = {{ groups['opencontrail'] | length }}
 
 [DNS]
 # IP address and port to be used to connect to dns-node. Maximum of 2 IP