diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/templates')
13 files changed, 76 insertions, 49 deletions
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 f5586349..6e2bcce3 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 @@ -1,8 +1,10 @@ [DEFAULTS] host_ip = {{ contrail_address }} -rest_api_ip = 0.0.0.0 +rest_api_ip = {{ contrail_haproxy_address }} rest_api_port = 9081 -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}: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 %} +#chenshuai: This kind of written is also correct, but the following is better, this as record +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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 cb747638..e4acf3ea 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 @@ -1,13 +1,13 @@ [DEFAULTS] -listen_ip_addr = 0.0.0.0 +listen_ip_addr = {{ contrail_haproxy_address }} listen_port = 8082 -ifmap_server_ip = {{ contrail_address }} +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['opencontrail_database'] %}{{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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 ea843880..da5cf2ab 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'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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 24575aa3..7ab29f6f 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]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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 6abcb590..509b3569 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_ip_addr = {{ contrail_haproxy_address }} listen_port = 5998 -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_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}{% if not loop.last %}, {% endif %}{% endfor %} zk_server_port = 2181 -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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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-dns-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2 index 0a2ab433..9d415563 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-dns-conf.j2 @@ -1,6 +1,6 @@ [DEFAULT] hostip = {{ contrail_address }} -hostname = {{ ansible_hostname }} +hostname = {{ inventory_hostname }} log_file = /var/log/contrail/contrail-dns.log log_level = SYS_NOTICE log_local = 1 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 a9f7c281..7564d26d 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,8 +1,9 @@ [DEFAULT] hostip = {{ contrail_address }} -cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ ip_settings[cur_host]['mgmt']['ip'] }}: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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} -collectors = {{ contrail_address }}:8086 +collectors = {{ contrail_haproxy_address }}:8086 http_server_port = 8091 log_file = /var/log/contrail/contrail-query-engine.log log_level = SYS_NOTICE 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 f394948d..cf5dead3 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,15 @@ [DEFAULTS] -ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} +#ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} +ifmap_server_ip = {{ haproxy_hosts.values()[0] }} ifmap_server_port = 8443 ifmap_username = schema-transformer ifmap_password = schema-transformer -api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} +#api_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} +api_server_ip = {{ haproxy_hosts.values()[0] }} api_server_port = 8082 -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 %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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 070a60c3..6ad5ec2d 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 @@ -1,13 +1,13 @@ [DEFAULTS] -ifmap_server_ip = {{ contrail_address }} +ifmap_server_ip = {{ contrail_haproxy_address }} ifmap_server_port = 8443 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]['ansible_' + internal_nic].ipv4.address }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail_database'] %}{{ haproxy_hosts[cur_host] }}: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-tor-agent-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2 index fb483c3e..8d336e52 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-tor-agent-conf.j2 @@ -78,7 +78,7 @@ server = {{ contrail_haproxy_address }} [NETWORKS] # control-channel IP address used by WEB-UI to connect to vnswad to fetch # required information (Optional) -control_network_ip = {{ contrail_address }} +control_network_ip = {{ contrail_haproxy_address }} [TOR] # IP address of the TOR to manage 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 e99917bd..d7691b6b 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 @@ -1,57 +1,78 @@ #contrail-marker-start listen contrail-stats - bind *:5937 +# bind *:5937 + bind {{ internal_vip.ip }}:5937 + bind {{ public_vip.ip }}:5937 mode http stats enable stats uri / stats auth haproxy:contrail123 -listen neutron-server - bind *:9696 - balance roundrobin - option nolinger -{% 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 %} +# compass has bind neutron-server +#listen neutron-server +# bind *:9696 +# balance roundrobin +# option nolinger +#{% for host,ip in haproxy_hosts.items() %} +# server {{ host }} {{ ip }}:9697 weight 1 check inter 2000 rise 2 fall 3 +#{% endfor %} + + listen contrail-api - bind *:8082 +# bind *:8082 + bind {{ internal_vip.ip }}:8082 + bind {{ public_vip.ip }}:8082 balance roundrobin option nolinger timeout client 3m timeout server 3m -{% 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 +{% for host,ip in haproxy_hosts.items() %} + server {{ host }} {{ ip }}:9100 weight 1 check inter 2000 rise 2 fall 3 {% endfor %} + + listen contrail-discovery - bind *:5998 +# bind *:5998 + bind {{ internal_vip.ip }}:5998 + bind {{ public_vip.ip }}:5998 balance roundrobin option nolinger -{% 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 +{% for host,ip in haproxy_hosts.items() %} + server {{ host }} {{ ip }}:9110 weight 1 check inter 2000 rise 2 fall 3 {% endfor %} + + listen contrail-analytics-api - bind *:8081 +# bind *:8081 + bind {{ internal_vip.ip }}:8081 + bind {{ public_vip.ip }}:8081 balance roundrobin option nolinger 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]['ansible_' + internal_nic].ipv4.address }} {{ hostvars[cur_host]['ansible_' + internal_nic].ipv4.address }}:9081 check inter 2000 rise 2 fall 3 +{% for host,ip in haproxy_hosts.items() %} + server {{ host }} {{ ip }}:9081 weight 1 check inter 2000 rise 2 fall 5 {% endfor %} -listen rabbitmq - bind *:5673 - mode tcp - balance roundrobin - maxconn 10000 - option tcplog - option tcpka - option redispatch - timeout client 48h - timeout server 48h -{% 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 +# compass doesn't use ha for rabbitmq, but use cluster mode +#listen rabbitmq +# bind *:5673 +# mode tcp +# balance roundrobin +# maxconn 10000 +# option tcplog +# option tcpka +# option redispatch +# timeout client 48h +# timeout server 48h +{% for host,ip in haproxy_hosts.items() %} + server {{ host }} {{ ip }}:5672 weight 1 check inter 2000 rise 2 fall 5 {% endfor %} #contrail-marker-end diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 index 1b3e60f7..6728eddb 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/rabbitmq-env-conf.j2 @@ -1,2 +1,2 @@ NODE_IP_ADDRESS={{ contrail_address }} -NODENAME=rabbit@{{ ansible_hostname }}-ctrl +NODENAME=rabbit@{{ inventory_hostname }}-ctrl 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 a4e35d67..c81b07db 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,2 @@ -DISCOVERY={{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }}
\ No newline at end of file +#DISCOVERY={{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} +DISCOVERY={{ haproxy_hosts.value()[0] }} |