tripleo-quickstart-extras/roles/overcloud-scale/tasks/pre-scale.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

62 lines
1.9 KiB
YAML

---
# Prepare deployment args
- name: Enable pacemaker
set_fact:
pacemaker_args: >-
-e {{ overcloud_templates_path }}/environments/puppet-pacemaker.yaml
when: enable_pacemaker|bool
- name: extract the number of controllers to be deployed
set_fact:
number_of_controllers: "{{ scale_args| regex_replace('^.*--control-scale +([0-9]+).*$', '\\1') | regex_replace('^[^ 0-9]+$', '1') }}"
- name: disable L3 HA
set_fact:
pacemaker_args: >-
{{ pacemaker_args }}
-e $HOME/neutronl3ha.yaml
when: enable_pacemaker|bool and number_of_controllers|int < 3
# Prep for scaling overcloud
- name: Determine initial number of node(s) that will be scaled
shell: >
source {{ working_dir }}/stackrc;
nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l
register: initial_node_count
- name: Register uuid of original {{ node_to_scale }} node
shell: >
source {{ working_dir }}/stackrc;
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}'
register: node_id_to_delete
- name: Register the Name of the original {{ node_to_scale }} node
shell: >
source {{ working_dir }}/stackrc;
nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}'
register: node_name_to_delete
- name: Register pre-scale nova list
shell: >
source {{ working_dir }}/stackrc;
nova list
register: pre_scale_nova_list
- name: Display pre-scale nova list
debug: msg={{ pre_scale_nova_list.stdout_lines }}
when: pre_scale_nova_list is defined
- name: Copy scale deployment template to undercloud
template:
src: scale-deployment.j2
dest: "{{ working_dir }}/scale-deployment.sh"
mode: 0755
- name: Copy neutron l3 ha heat template
when: enable_pacemaker|bool and number_of_controllers|int < 3
template:
src: neutronl3ha.yaml.j2
dest: "{{ working_dir }}/neutronl3ha.yaml"
mode: 0755