diff options
20 files changed, 123 insertions, 123 deletions
diff --git a/build/make_repo.sh b/build/make_repo.sh index 16490c67..15e1f16e 100755 --- a/build/make_repo.sh +++ b/build/make_repo.sh @@ -169,46 +169,35 @@ function make_pip_repo() function make_all_repo() { - make_repo --package-tag pip - - make_repo --os-ver rhel7 --package-tag compass \ - --tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \ - --default-package "kernel-devel epel-release wget libxml2 glibc gcc perl openssl-libs mkisofs createrepo lsof \ - python-yaml python-jinja2 python-paramiko elasticsearch logstash bind-license vim nmap-ncat \ - yum cobbler cobbler-web createrepo mkisofs syslinux pykickstart bind rsync fence-agents \ - dhcp xinetd tftp-server httpd libselinux-python python-setuptools python-devel mysql-devel \ - mysql-server mysql MySQL-python redis mod_wsgi net-tools rabbitmq-server nfs-utils" \ - --special-package "kibana jdk" - - make_repo --os-ver trusty --package-tag juno \ - --ansible-dir $WORK_PATH/deploy/adapters/ansible \ - --default-package "openssh-server" \ - --special-package "openvswitch-switch" - - make_repo --os-ver trusty --package-tag kilo \ - --ansible-dir $WORK_PATH/deploy/adapters/ansible \ - --default-package "openssh-server" \ - --special-package "openvswitch-switch" - - make_repo --os-ver trusty --package-tag liberty \ +# make_repo --package-tag pip + +# make_repo --os-ver rhel7 --package-tag compass \ +# --tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \ +# --default-package "kernel-devel epel-release wget libxml2 glibc gcc perl openssl-libs mkisofs createrepo lsof \ +# python-yaml python-jinja2 python-paramiko elasticsearch logstash bind-license vim nmap-ncat \ +# yum cobbler cobbler-web createrepo mkisofs syslinux pykickstart bind rsync fence-agents \ +# dhcp xinetd tftp-server httpd libselinux-python python-setuptools python-devel mysql-devel \ +# mysql-server mysql MySQL-python redis mod_wsgi net-tools rabbitmq-server nfs-utils" \ +# --special-package "kibana jdk" + + for opv in juno kilo liberty; do + make_repo --os-ver trusty --package-tag $opv \ --ansible-dir $WORK_PATH/deploy/adapters/ansible \ --default-package "openssh-server" \ --special-package "openvswitch-switch" + done make_repo --os-ver rhel7 --package-tag juno \ --ansible-dir $WORK_PATH/deploy/adapters/ansible \ --default-package "rsyslog-7.6.7-1.el7 strace net-tools wget vim openssh-server \ dracut-config-rescue-033-241.el7_1.3 dracut-network-033-241.el7_1.3" + for opv in kilo liberty; do make_repo --os-ver rhel7 --package-tag kilo \ --ansible-dir $WORK_PATH/deploy/adapters/ansible \ --default-package "rsyslog-7.6.7-1.el7 strace net-tools wget vim openssh-server \ dracut-config-rescue-033-241.el7_1.5 dracut-network-033-241.el7_1.5" - - make_repo --os-ver rhel7 --package-tag liberty \ - --ansible-dir $WORK_PATH/deploy/adapters/ansible \ - --default-package "rsyslog-7.6.7-1.el7 strace net-tools wget vim openssh-server \ - dracut-config-rescue-033-241.el7_1.5 dracut-network-033-241.el7_1.5" + done } function main() diff --git a/build/templates/Debian_juno.tmpl b/build/templates/Debian_juno.tmpl index 2f88cb2e..4cf42975 100644 --- a/build/templates/Debian_juno.tmpl +++ b/build/templates/Debian_juno.tmpl @@ -1,9 +1,10 @@ #!/bin/bash set -ex -# add openstack juno repo +#set OPV="juno" + sudo apt-get update && apt-get install -y software-properties-common -sudo add-apt-repository -y cloud-archive:juno +sudo add-apt-repository -y cloud-archive:$OPV # add galeracluster repo #sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db @@ -30,8 +31,8 @@ sudo apt-get -d install $pkg -y #end for #make repo -mkdir -p trusty-juno-ppa/conf -cat <<EOF > trusty-juno-ppa/conf/distributions +mkdir -p trusty-$OPV-ppa/conf +cat <<EOF > trusty-$OPV-ppa/conf/distributions Codename: trusty Components: main Architectures: amd64 @@ -40,6 +41,6 @@ EOF mkdir deb find /var/cache/apt/ -name *.deb | xargs -i cp {} deb -reprepro -b trusty-juno-ppa includedeb trusty deb/*.deb +reprepro -b trusty-$OPV-ppa includedeb trusty deb/*.deb -tar -zcvf /trusty-juno-ppa.tar.gz ./trusty-juno-ppa +tar -zcvf /trusty-$OPV-ppa.tar.gz ./trusty-$OPV-ppa diff --git a/build/templates/Debian_kilo.tmpl b/build/templates/Debian_kilo.tmpl index 223173b5..d8efafbd 100644 --- a/build/templates/Debian_kilo.tmpl +++ b/build/templates/Debian_kilo.tmpl @@ -1,9 +1,10 @@ #!/bin/bash set -ex -# add openstack kilo repo +#set OPV="kilo" + sudo apt-get update && apt-get install -y software-properties-common -sudo add-apt-repository -y cloud-archive:kilo +sudo add-apt-repository -y cloud-archive:$OPV # add galeracluster repo sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 D669017EBC19DDBA @@ -28,8 +29,8 @@ sudo apt-get -d install $pkg -y #end for #make repo -mkdir -p trusty-kilo-ppa/conf -cat <<EOF > trusty-kilo-ppa/conf/distributions +mkdir -p trusty-$OPV-ppa/conf +cat <<EOF > trusty-$OPV-ppa/conf/distributions Codename: trusty Components: main Architectures: amd64 @@ -38,6 +39,6 @@ EOF mkdir deb find /var/cache/apt/ -name *.deb | xargs -i cp {} deb -reprepro -b trusty-kilo-ppa includedeb trusty deb/*.deb +reprepro -b trusty-$OPV-ppa includedeb trusty deb/*.deb -tar -zcvf /trusty-kilo-ppa.tar.gz ./trusty-kilo-ppa +tar -zcvf /trusty-$OPV-ppa.tar.gz ./trusty-$OPV-ppa diff --git a/build/templates/Debian_liberty.tmpl b/build/templates/Debian_liberty.tmpl index ede5b51f..93bd9f3e 100644 --- a/build/templates/Debian_liberty.tmpl +++ b/build/templates/Debian_liberty.tmpl @@ -1,9 +1,11 @@ #!/bin/bash set -ex -# add openstack liberty repo +#set OPV="liberty" + +# add openstack $OPV repo sudo apt-get update && apt-get install -y software-properties-common -sudo add-apt-repository -y cloud-archive:liberty +sudo add-apt-repository -y cloud-archive:$OPV # add galeracluster repo #sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db @@ -30,8 +32,8 @@ sudo apt-get -d install $pkg -y #end for #make repo -mkdir -p trusty-liberty-ppa/conf -cat <<EOF > trusty-liberty-ppa/conf/distributions +mkdir -p trusty-$OPV-ppa/conf +cat <<EOF > trusty-$OPV-ppa/conf/distributions Codename: trusty Components: main Architectures: amd64 @@ -44,6 +46,6 @@ rm -rf /var/cache/apt/python-pyasn1_0.1.7-1ubuntu2_all.deb mkdir deb find /var/cache/apt/ -name *.deb | xargs -i cp {} deb -reprepro -b trusty-liberty-ppa includedeb trusty deb/*.deb +reprepro -b trusty-$OPV-ppa includedeb trusty deb/*.deb -tar -zcvf /trusty-liberty-ppa.tar.gz ./trusty-liberty-ppa +tar -zcvf /trusty-$OPV-ppa.tar.gz ./trusty-$OPV-ppa diff --git a/build/templates/RedHat_juno.tmpl b/build/templates/RedHat_juno.tmpl index 60a03b9f..3e172637 100644 --- a/build/templates/RedHat_juno.tmpl +++ b/build/templates/RedHat_juno.tmpl @@ -1,6 +1,8 @@ #!/bin/bash set -x +#set OPV="juno" + yum remove systemd -y # add 163 repo yum install wget -y @@ -10,10 +12,10 @@ yum update -y #rm -f /etc/yum.repos.d/CentOS-*.repo yum repolist yum clean all -# add openstack juno repo + yum install yum-plugin-priorities -y yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y -yum install http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm -y +yum install http://rdo.fedorapeople.org/openstack-$OPV/rdo-release-$OPV.rpm -y # modify centos7 repo for workaround sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo @@ -75,19 +77,19 @@ yum -y install --skip-broken --downloadonly #echo ' '.join(packages) #make repo -mkdir -p /centos7-juno-ppa/{Packages,repodata} +mkdir -p /centos7-$OPV-ppa/{Packages,repodata} -find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-juno-ppa/Packages/ +find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-$OPV-ppa/Packages/ -rm /centos7-juno-ppa/Packages/selinux-policy* -f -rm /centos7-juno-ppa/Packages/systemd* -f +rm /centos7-$OPV-ppa/Packages/selinux-policy* -f +rm /centos7-$OPV-ppa/Packages/systemd* -f -mv /epel-release-7-5.noarch.rpm /centos7-juno-ppa/Packages/ -cp /comps.xml /centos7-juno-ppa/ -cp /ceph_key_release.asc /centos7-juno-ppa/ -createrepo -g comps.xml /centos7-juno-ppa -mkdir /centos7-juno-ppa/noarch -mkdir /centos7-juno-ppa/noarch/Packages -cp -r /centos7-juno-ppa/Packages/ceph* /centos7-juno-ppa/noarch/Packages/ -cp -r /centos7-juno-ppa/repodata/ /centos7-juno-ppa/noarch/ -tar -zcvf /centos7-juno-ppa.tar.gz /centos7-juno-ppa +mv /epel-release-7-5.noarch.rpm /centos7-$OPV-ppa/Packages/ +cp /comps.xml /centos7-$OPV-ppa/ +cp /ceph_key_release.asc /centos7-$OPV-ppa/ +createrepo -g comps.xml /centos7-$OPV-ppa +mkdir /centos7-$OPV-ppa/noarch +mkdir /centos7-$OPV-ppa/noarch/Packages +cp -r /centos7-$OPV-ppa/Packages/ceph* /centos7-$OPV-ppa/noarch/Packages/ +cp -r /centos7-$OPV-ppa/repodata/ /centos7-$OPV-ppa/noarch/ +tar -zcvf /centos7-$OPV-ppa.tar.gz /centos7-$OPV-ppa diff --git a/build/templates/RedHat_kilo.tmpl b/build/templates/RedHat_kilo.tmpl index 826acb8d..f9942d8f 100644 --- a/build/templates/RedHat_kilo.tmpl +++ b/build/templates/RedHat_kilo.tmpl @@ -1,6 +1,8 @@ #!/bin/bash set -x +#set OPV="kilo" + yum remove systemd -y # add 163 repo yum install wget -y @@ -10,10 +12,10 @@ yum update -y #rm -f /etc/yum.repos.d/CentOS-*.repo yum repolist yum clean all -# add openstack kilo repo + yum install yum-plugin-priorities -y yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y -yum install http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm -y +yum install http://rdo.fedorapeople.org/openstack-$OPV/rdo-release-$OPV.rpm -y # modify centos7 repo for workaround sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo @@ -81,21 +83,21 @@ yum -y install --skip-broken --downloadonly #echo ' '.join(packages) #make repo -mkdir -p /centos7-kilo-ppa/{Packages,repodata} +mkdir -p /centos7-$OPV-ppa/{Packages,repodata} -find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-kilo-ppa/Packages/ +find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-$OPV-ppa/Packages/ -rm /centos7-kilo-ppa/Packages/selinux-policy* -f -rm /centos7-kilo-ppa/Packages/systemd* -f -rm /centos7-kilo-ppa/Packages/openssl-1.0.1e-42.el7.9.x86_64.rpm -rm /centos7-kilo-ppa/Packages/libnl3-3.2.21-9.el7_1.x86_64.rpm +rm /centos7-$OPV-ppa/Packages/selinux-policy* -f +rm /centos7-$OPV-ppa/Packages/systemd* -f +rm /centos7-$OPV-ppa/Packages/openssl-1.0.1e-42.el7.9.x86_64.rpm +rm /centos7-$OPV-ppa/Packages/libnl3-3.2.21-9.el7_1.x86_64.rpm -mv /epel-release-7-5.noarch.rpm /centos7-kilo-ppa/Packages/ -cp /comps.xml /centos7-kilo-ppa/ -cp /ceph_key_release.asc /centos7-kilo-ppa/ -createrepo -g comps.xml /centos7-kilo-ppa -mkdir /centos7-kilo-ppa/noarch -mkdir /centos7-kilo-ppa/noarch/Packages -cp -r /centos7-kilo-ppa/Packages/ceph* /centos7-kilo-ppa/noarch/Packages/ -cp -r /centos7-kilo-ppa/repodata/ /centos7-kilo-ppa/noarch/ -tar -zcvf /centos7-kilo-ppa.tar.gz /centos7-kilo-ppa +mv /epel-release-7-5.noarch.rpm /centos7-$OPV-ppa/Packages/ +cp /comps.xml /centos7-$OPV-ppa/ +cp /ceph_key_release.asc /centos7-$OPV-ppa/ +createrepo -g comps.xml /centos7-$OPV-ppa +mkdir /centos7-$OPV-ppa/noarch +mkdir /centos7-$OPV-ppa/noarch/Packages +cp -r /centos7-$OPV-ppa/Packages/ceph* /centos7-$OPV-ppa/noarch/Packages/ +cp -r /centos7-$OPV-ppa/repodata/ /centos7-$OPV-ppa/noarch/ +tar -zcvf /centos7-$OPV-ppa.tar.gz /centos7-$OPV-ppa diff --git a/build/templates/RedHat_liberty.tmpl b/build/templates/RedHat_liberty.tmpl index baafc17f..74aada7b 100644 --- a/build/templates/RedHat_liberty.tmpl +++ b/build/templates/RedHat_liberty.tmpl @@ -1,15 +1,17 @@ #!/bin/bash set -x +#set OPV="liberty" + yum remove systemd -y # add 163 repo #rm -f /etc/yum.repos.d/CentOS-*.repo yum repolist yum clean all -# add openstack liberty repo + yum install yum-plugin-priorities -y yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm -y -yum install http://rdo.fedorapeople.org/openstack-liberty/rdo-release-liberty.rpm -y +yum install http://rdo.fedorapeople.org/openstack-$OPV/rdo-release-$OPV.rpm -y # modify centos7 repo for workaround sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo @@ -78,19 +80,19 @@ yum -y install --skip-broken --downloadonly #echo ' '.join(packages) yum -y install --skip-broken --downloadonly #echo ' '.join(packages) #make repo -mkdir -p /centos7-liberty-ppa/{Packages,repodata} - -find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-liberty-ppa/Packages/ - -rm /centos7-liberty-ppa/Packages/selinux-policy* -f -rm /centos7-liberty-ppa/Packages/systemd* -f - -mv /epel-release-7-5.noarch.rpm /centos7-liberty-ppa/Packages/ -cp /comps.xml /centos7-liberty-ppa/ -cp /ceph_key_release.asc /centos7-liberty-ppa/ -createrepo -g comps.xml /centos7-liberty-ppa -mkdir /centos7-liberty-ppa/noarch -mkdir /centos7-liberty-ppa/noarch/Packages -cp -r /centos7-liberty-ppa/Packages/ceph* /centos7-liberty-ppa/noarch/Packages/ -cp -r /centos7-liberty-ppa/repodata/ /centos7-liberty-ppa/noarch/ -tar -zcvf /centos7-liberty-ppa.tar.gz /centos7-liberty-ppa +mkdir -p /centos7-$OPV-ppa/{Packages,repodata} + +find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-$OPV-ppa/Packages/ + +rm /centos7-$OPV-ppa/Packages/selinux-policy* -f +rm /centos7-$OPV-ppa/Packages/systemd* -f + +mv /epel-release-7-5.noarch.rpm /centos7-$OPV-ppa/Packages/ +cp /comps.xml /centos7-$OPV-ppa/ +cp /ceph_key_release.asc /centos7-$OPV-ppa/ +createrepo -g comps.xml /centos7-$OPV-ppa +mkdir /centos7-$OPV-ppa/noarch +mkdir /centos7-$OPV-ppa/noarch/Packages +cp -r /centos7-$OPV-ppa/Packages/ceph* /centos7-$OPV-ppa/noarch/Packages/ +cp -r /centos7-$OPV-ppa/repodata/ /centos7-$OPV-ppa/noarch/ +tar -zcvf /centos7-$OPV-ppa.tar.gz /centos7-$OPV-ppa 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 c785ad42..e719a461 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 @@ -24,14 +24,14 @@ lineinfile: dest: "/etc/ifmap-server/basicauthusers.properties" # line: "{{ hostvars[item]['contrail_address' ] }}:{{ hostvars[item]['contrail_address' ] }}" - line: "{{ haproxy_hosts[item] }}:{{ haproxy_hosts[item] }}" + line: "{{ ip_settings[item]['br-prv']['ip'] }}:{{ ip_settings[item]['br-prv']['ip'] }}" 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" + line: "{{ ip_settings[item]['br-prv']['ip'] }}.dns:{{ ip_settings[item]['br-prv']['ip'] }}.dns" with_items: groups['opencontrail'] - name: "node-common" 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 757aba2b..9c99270d 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 @@ -61,7 +61,7 @@ # sudo: True set_fact: # dbseeds: "{{ hostvars[item.1][ contrail_address ] }}" - dbseeds: "{{ haproxy_hosts[item.1] }}" + dbseeds: "{{ ip_settings[item.1]['br-prv']['ip'] }}" with_indexed_items: groups['opencontrail'] when: item.0 == 0 @@ -73,7 +73,7 @@ # sudo: True set_fact: # dbseeds: "{{ dbseeds }},{{ hostvars[item.1]['contrail_address'] }}" - dbseeds: "{{ dbseeds }},{{ haproxy_hosts[item.1] }}" + dbseeds: "{{ dbseeds }},{{ ip_settings[item.1]['br-prv']['ip'] }}" with_indexed_items: groups['opencontrail'] when: item.0 == 1 @@ -129,7 +129,7 @@ dest: "/etc/zookeeper/conf/zoo.cfg" 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" + line: "server.{{ item.0 + 1 }}={{ ip_settings[item.1]['br-prv']['ip'] }}:2888:3888" with_indexed_items: groups['opencontrail'] @@ -153,7 +153,7 @@ # sudo: True set_fact: # zkaddrs: "{{ hostvars[item.1]['contrail_address'] }}:2181" - zkaddrs: "{{ haproxy_hosts[item.1] }}:2181" + zkaddrs: "{{ ip_settings[item.1]['br-prv']['ip'] }}:2181" with_indexed_items: groups['opencontrail'] when: item.0 == 0 @@ -162,7 +162,7 @@ # sudo: True set_fact: # zkaddrs: "{{ zkaddrs }},{{ hostvars[item.1]['contrail_address'] }}:2181" - zkaddrs: "{{ zkaddrs }},{{ haproxy_hosts[item.1] }}:2181" + zkaddrs: "{{ zkaddrs }},{{ ip_settings[item.1]['br-prv']['ip'] }}:2181" with_indexed_items: groups['opencontrail'] 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 158c0cec..99441b6d 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 @@ -25,14 +25,14 @@ - name: "set first cassandra host address" set_fact: # cassandra_addrs: "'{{ hostvars[item.1]['contrail_address'] }}'" - cassandra_addrs: "'{{ haproxy_hosts[item.1] }}'" + cassandra_addrs: "'{{ ip_settings[item.1]['br-prv']['ip'] }}'" 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] }}'" + cassandra_addrs: "{{ cassandra_addrs }}, '{{ ip_settings[item.1]['br-prv']['ip'] }}'" with_indexed_items: groups['opencontrail'] 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 85f053b6..21fb733b 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 @@ -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['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_haproxy_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 3c633f3e..19004ce3 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_haproxy_address }} ifmap_server_port = 8443 ifmap_username = api-server ifmap_password = api-server -zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}: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 822d7a09..11509603 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'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['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 55ad492a..a13a00b4 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'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}: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 dfcc0e3a..f54fdc94 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 = {{ contrail_haproxy_address }} listen_port = 5998 -zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}{% if not loop.last %}, {% endif %}{% endfor %} zk_server_port = 2181 -cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}: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 73963344..d947addb 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 @@ -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['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:9160{% if not loop.last %} {% endif %}{% endfor %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:9160{% if not loop.last %} {% endif %}{% endfor %} collectors = {{ contrail_haproxy_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 e57ef5e7..d112dbee 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,15 +1,13 @@ [DEFAULTS] -#ifmap_server_ip = {{ ip_settings[haproxy_hosts.keys()[0]]['mgmt']['ip'] }} ifmap_server_ip = {{ contrail_haproxy_address }} 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 = {{ contrail_haproxy_address }} api_server_port = 8082 -zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}: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 993b01a4..0c6bfc07 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'] %}{{ haproxy_hosts[cur_host] }}:2181{% if not loop.last %}, {% endif %}{% endfor %} +zk_server_ip = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}:2181{% 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 %} +cassandra_server_list = {% for cur_host in groups['opencontrail'] %}{{ ip_settings[cur_host]['br-prv']['ip'] }}: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/vrouter-nodemgr-param.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/vrouter-nodemgr-param.j2 index 436967b7..ee5dcbd7 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={{ haproxy_hosts.values()[0] }} +DISCOVERY={{ ip_settings['host1']['br-prv']['ip'] }} diff --git a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml index eb840cec..17b78849 100755 --- a/deploy/adapters/ansible/roles/open-contrail/vars/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/vars/main.yml @@ -12,13 +12,15 @@ kernel_install: no #ansible_ssh_user: "root" #ansible_ssh_pass: "root" -contrail_keystone_address: "{{ internal_vip.ip }}" +#contrail_keystone_address: "{{ internal_vip.ip }}" +contrail_keystone_address: "{{ public_vip.ip }}" contrail_admin_user: "admin" contrail_admin_password: "console" # network infor adapter for compass -contrail_address: "{{ internal_ip }}" +# contrail_address: "{{ internal_ip }}" +contrail_address: " {{ ip_settings[inventory_hostname]['br-prv']['ip'] }} " #contrail_device: # compass openstack device contrail_netmask: "255.255.255.0" #contrail_gateway: "10.84.50.254" @@ -43,7 +45,8 @@ contrail_vhost_netmask: "{{ ip_settings[inventory_hostname]['br-prv']['netmask'] contrail_keepalived: no #contrail_haproxy_address: "10.0.0.22" # 10.0.0.80 -contrail_haproxy_address: "{{ internal_vip.ip }}" +#contrail_haproxy_address: "{{ internal_vip.ip }}" +contrail_haproxy_address: "{{ public_vip.ip }}" contrail_netmask: "255.255.255.0" contrail_prefixlen: "24" contrail_gateway: "10.0.0.1" |