tripleo-quickstart-extras/roles/overcloud-upgrade/tasks/pre-overcloud.yml
Attila Darazs 689d759e64 Use cachable facts to allow multiple runs
* add "cachable: true" to set_fact calls when the fact would be used by
  other roles in later runs; the other fact names were checked to make
  sure they are not referred to in other roles
* consolidate the formatting of the set_fact calls, using the proper
  yaml structure instead of `set_fact: foo=bar`

Depends-On: I987d51cc252b7ebc3972d60497234fa676864882
Change-Id: I5dd3084ead618e357b1e7d841ea2ee794bd0569a
2017-12-05 16:56:38 +01:00

61 lines
2.0 KiB
YAML

---
- name: Copy custom heat templates files if provided
template:
src: "{{ item.value.src }}"
dest: "{{ upgrade_working_dir }}/{{ item.value.name }}"
with_dict: "{{ upgrade_templates }}"
- name: Copy ignore warnings template file for ceph upgrade
template:
src: "ceph-upgrade.yaml.J2"
dest: "{{ upgrade_working_dir }}/ceph-upgrade.yaml"
when: enable_ceph|bool
- name: Make sure no Tht repo is present
when: not mixed_upgrade|bool
file: path={{ upgrade_working_dir }}/{{ tht_dir }} state=absent
- name: Copy new Tht directory to the upgrade working dir
when: not mixed_upgrade|bool
shell: >
cp -R /usr/share/openstack-tripleo-heat-templates \
{{ upgrade_working_dir }}/{{ tht_dir }};
- name: Add the no ssh finger print checking into upgrade-non-controller.sh
become: yes
shell: >
sed -i 's/ssh/ssh -o StrictHostKeyChecking=no/' \
{{ upgrade_non_controller_script }}
- name: allow traffic for the controller
become: yes
shell: >
sudo iptables -A BOOTSTACK_MASQ -s {{ network_isolation_ipv4_cidr }} ! \
-d {{ network_isolation_ipv4_cidr }} -j MASQUERADE -t nat;
sudo iptables-save > /etc/sysconfig/iptables;
when: network_isolation|bool and deployment_type == "virtual"
- name: get the number of core
when: set_heat_workers
register: core
shell: >
cat /proc/cpuinfo | grep processor | wc -l
- name: set the number of workers for heat engine before runnning OC upgrade
when: set_heat_workers
set_fact:
heat_workers: "{{ core.stdout|int / 2 }}"
# Hardcode the number of heat workers, to try to avoid the badstatusline in
# centos ci:
# 1 / append after the commented line
# 2 / make sure all heat engine workers are set to 6
# TODO: remove this with a smarter fix
- name: Set the num of heat workers
when: set_heat_workers
become: yes
shell: >
sed -i "/#num_engine_workers/a num_engine_workers = 6" /etc/heat/heat.conf;
sed -i "s/num_engine_workers.*$/num_engine_workers = 6/" /etc/heat/heat.conf;
systemctl restart openstack-heat-engine