summaryrefslogtreecommitdiffstats
path: root/lib/ansible/playbooks/post_deploy_undercloud.yml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/playbooks/post_deploy_undercloud.yml')
-rw-r--r--lib/ansible/playbooks/post_deploy_undercloud.yml94
1 files changed, 44 insertions, 50 deletions
diff --git a/lib/ansible/playbooks/post_deploy_undercloud.yml b/lib/ansible/playbooks/post_deploy_undercloud.yml
index 2e1bf0f..8cdfedf 100644
--- a/lib/ansible/playbooks/post_deploy_undercloud.yml
+++ b/lib/ansible/playbooks/post_deploy_undercloud.yml
@@ -9,6 +9,7 @@
- name: Configure external network
shell: "{{ overcloudrc }} && {{ item }}"
with_items: "{{ external_network_cmds }}"
+ when: vim == 'openstack'
- name: Configure gluon networks
shell: "{{ overcloudrc }} && {{ item }}"
when: gluon
@@ -26,9 +27,7 @@
group: stack
mode: 0644
become: yes
- with_items:
- - overcloudrc
- - overcloudrc.v3
+ with_items: "{{ overcloudrc_files }}"
- name: Inject OS_PROJECT_ID and OS_TENANT_NAME into overcloudrc
lineinfile:
line: "{{ item }}"
@@ -74,56 +73,45 @@
when: sdn != false
become: yes
become_user: stack
- with_items:
- - overcloudrc
- - overcloudrc.v3
- - name: Undercloud NAT - MASQUERADE interface
- iptables:
- table: nat
- chain: POSTROUTING
- out_interface: eth0
- jump: MASQUERADE
- when:
- - virtual
- - not external_network_ipv6
- become: yes
- - name: Undercloud NAT - MASQUERADE interface with subnet
- iptables:
- table: nat
- chain: POSTROUTING
- out_interface: eth0
- jump: MASQUERADE
- source: "{{ external_cidr }}"
- when:
- - virtual
- - not external_network_ipv6
+ with_items: "{{ overcloudrc_files }}"
+ - name: Write SDN WEB and REST PORT to overcloudrc
+ lineinfile:
+ line: "export {{ item[0] }}=8081"
+ regexp: "{{ item[0] }}"
+ path: "/home/stack/{{ item[1] }}"
+ when: sdn != false
become: yes
- - name: Undercloud NAT - Allow Forwarding
- iptables:
- chain: FORWARD
- in_interface: eth2
- jump: ACCEPT
- when:
- - virtual
- - not external_network_ipv6
+ become_user: stack
+ with_nested:
+ - [ 'SDN_CONTROLLER_WEBPORT', 'SDN_CONTROLLER_RESTCONFPORT' ]
+ - "{{ overcloudrc_files }}"
+ - name: Grab Heat Environment variables
+ shell: "{{ stackrc }} && openstack stack environment show overcloud -f json"
+ register: heat_env
become: yes
- - name: Undercloud NAT - Allow Stateful Forwarding
- iptables:
- chain: FORWARD
- in_interface: eth2
- jump: ACCEPT
- source: "{{ external_cidr }}"
- ctstate: ESTABLISHED,RELATED
- when:
- - virtual
- - not external_network_ipv6
+ become_user: stack
+ - name: Write SDN controller password to overcloudrc for ODL
+ lineinfile:
+ line: "export SDN_CONTROLLER_PASSWORD={{(heat_env.stdout|from_json)['parameter_defaults']['OpenDaylightPassword']}}"
+ regexp: 'SDN_CONTROLLER_PASSWORD'
+ path: "/home/stack/{{ item }}"
+ when: sdn == 'opendaylight'
become: yes
- - name: Undercloud NAT - Save iptables
- shell: service iptables save
+ become_user: stack
+ with_items: "{{ overcloudrc_files }}"
+ - name: Register OS Region
+ shell: "{{ overcloudrc }} && openstack endpoint list -c Region -f json"
+ register: region
+ when: vim == 'openstack'
+ - name: Write Region into overcloudrc
+ lineinfile:
+ line: "export OS_REGION_NAME={{(region.stdout|from_json)[1]['Region']}}"
+ regexp: 'OS_REGION_NAME'
+ path: "/home/stack/{{ item }}"
become: yes
- when:
- - virtual
- - not external_network_ipv6
+ become_user: stack
+ with_items: "{{ overcloudrc_files }}"
+ when: vim == 'openstack'
- name: Create congress datasources
shell: "{{ overcloudrc }} && openstack congress datasource create {{ item }}"
become: yes
@@ -133,6 +121,10 @@
ignore_errors: yes
- name: Configure Calipso
block:
+ - name: Install pip3
+ yum:
+ name: python34-pip
+ state: present
- name: Install Calipso dependencies
pip:
name: "{{ item }}"
@@ -153,6 +145,8 @@
- docker-common
- docker-selinux
- docker-engine
+ - name: Add Docker CE repo
+ shell: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- name: Install Docker CE
package:
name: docker-ce
@@ -166,6 +160,6 @@
command: >
python3 /root/calipso-installer.py --command start-all
--copy q --hostname {{ calipso_ip }} --dbport 37017 --webport 81
- --apiport 8001 --rabbitmport 15673
+ --apiport 8001 --rabbitmport 15673 --home /root
become: yes
when: calipso