X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fansible%2Fplaybooks%2Fconfigure_undercloud.yml;h=fbac6eeb65c45a13af97f728a14627ff71aed58a;hb=f6dbb3929d904b4d5a9ee01f8270051e29ac1ec3;hp=7b236624a11c948dff5bc446e8c395467841019b;hpb=f4d388ea508ba00771e43a219ac64e0d430b73bd;p=apex.git diff --git a/lib/ansible/playbooks/configure_undercloud.yml b/lib/ansible/playbooks/configure_undercloud.yml index 7b236624..fbac6eeb 100644 --- a/lib/ansible/playbooks/configure_undercloud.yml +++ b/lib/ansible/playbooks/configure_undercloud.yml @@ -16,7 +16,7 @@ src: /root/.ssh/id_rsa.pub dest: /home/stack/jumphost_id_rsa.pub owner: stack - owner: stack + group: stack mode: 0644 - copy: src: "{{ apex_temp_dir }}/{{ item }}.yaml" @@ -32,6 +32,18 @@ regexp: 'Defaults\s*requiretty' state: absent become: yes + - lineinfile: + path: /etc/environment + regexp: '^http_proxy' + line: "http_proxy={{ http_proxy }}" + become: yes + when: http_proxy + - lineinfile: + path: /etc/environment + regexp: '^https_proxy' + line: "https_proxy={{ https_proxy }}" + become: yes + when: https_proxy - name: openstack-configs undercloud shell: openstack-config --set undercloud.conf DEFAULT {{ item }} with_items: "{{ undercloud_config }}" @@ -39,18 +51,27 @@ shell: openstack-config --set /etc/ironic/ironic.conf {{ item }} become: yes with_items: "{{ ironic_config }}" - - name: openstack-configs undercloud aarch64 - shell: openstack-config --set undercloud.conf DEFAULT ipxe_enabled false - when: "{{ aarch64 }}" - lineinfile: path: /usr/lib/python2.7/site-packages/ironic/common/pxe_utils.py regexp: '_link_ip_address_pxe_configs' - line: '_link_mac_pxe_configs(task)' - when: "{{ aarch64 }}" - - name: undercloud install - shell: openstack undercloud install &> apex-undercloud-install.log - become: yes - become_user: stack + line: ' _link_mac_pxe_configs(task)' + when: aarch64 + - block: + - name: undercloud install + shell: openstack undercloud install &> apex-undercloud-install.log + become: yes + become_user: stack + rescue: + - name: undercloud install retry + shell: openstack undercloud install >> apex-undercloud-install.log 2>&1 + become: yes + become_user: stack + always: + - name: fetch undercloud log + fetch: + src: /home/stack/apex-undercloud-install.log + dest: "{{ apex_temp_dir }}/" + flat: yes - name: openstack-configs nova shell: openstack-config --set /etc/nova/nova.conf DEFAULT {{ item }} become: yes @@ -94,23 +115,76 @@ when: - external_network.vlan != "native" - external_network.enabled - - name: assign IP to native eth2 + - name: assign IP to native eth2 shell: ip a a {{ external_network.ip }}/{{ external_network.prefix }} dev eth2 become: yes when: - external_network.vlan == "native" - external_network.enabled + - not aarch64 - name: bring up eth2 shell: ip link set up dev eth2 when: - external_network.vlan == "native" - external_network.enabled + - not aarch64 + become: yes + - name: assign IP to native eth0 if aarch64 + shell: ip a a {{ external_network.ip }}/{{ external_network.prefix }} dev eth0 + become: yes + when: + - external_network.vlan == "native" + - external_network.enabled + - aarch64 + - name: bring up eth0 if aarch64 + shell: ip link set up dev eth0 + when: + - external_network.vlan == "native" + - external_network.enabled + - aarch64 become: yes + - block: + - name: Undercloud NAT - MASQUERADE interface + iptables: + table: nat + chain: POSTROUTING + out_interface: eth0 + jump: MASQUERADE + - name: Undercloud NAT - MASQUERADE interface with subnet + iptables: + table: nat + chain: POSTROUTING + out_interface: eth0 + jump: MASQUERADE + source: "{{ nat_cidr }}" + - name: Undercloud NAT - Allow Forwarding + iptables: + chain: FORWARD + in_interface: eth2 + jump: ACCEPT + - name: Undercloud NAT - Allow Stateful Forwarding + iptables: + chain: FORWARD + in_interface: eth2 + jump: ACCEPT + source: "{{ nat_cidr }}" + ctstate: ESTABLISHED,RELATED + - name: Undercloud NAT - Save iptables + shell: service iptables save + become: yes + when: + - not nat_network_ipv6 + - virtual_overcloud - name: fetch storage environment file fetch: src: /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml dest: "{{ apex_temp_dir }}/" flat: yes + - name: fetch sriov environment file + fetch: + src: /usr/share/openstack-tripleo-heat-templates/environments/neutron-opendaylight-sriov.yaml + dest: "{{ apex_temp_dir }}/" + flat: yes - include: undercloud_aarch64.yml when: aarch64