![Raoul Scarazzini](/assets/img/avatar_default.png)
This commit adds the gathering for all the facts in each playbook, so to be able to point dynamic overcloud node names and use variables such as "{{ hostvars[item]['ansible_hostname'] }}" to identify the hostname from what's inside the inventory. Change-Id: I9ac6937a641f07f2e75bc764d057f2d1d8ec9bda
33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
---
|
|
- name: Load the STONITH creation script on the undercloud
|
|
template:
|
|
src: "{{ config_stonith_python_script }}"
|
|
dest: "{{ working_dir }}/config_stonith_from_instackenv.py"
|
|
mode: 0755
|
|
|
|
- name: Generate STONITH script
|
|
shell: |
|
|
source {{ working_dir }}/stackrc
|
|
{{ working_dir }}/config_stonith_from_instackenv.py {{ instack_env_file }} {{ stonith_action }} {{ stonith_devices }}
|
|
register: stonith_script
|
|
|
|
- name: Delete the STONITH script on the overcloud (if exists)
|
|
file:
|
|
path: "{{ overcloud_working_dir }}/config-stonith.sh"
|
|
state: absent
|
|
delegate_to: "{{ groups.controller[0] }}"
|
|
|
|
- name: Create the STONITH script on the overcloud
|
|
lineinfile:
|
|
destfile: "{{ overcloud_working_dir }}/config-stonith.sh"
|
|
line: "{{ stonith_script.stdout }}"
|
|
create: yes
|
|
mode: 0755
|
|
delegate_to: "{{ groups.controller[0] }}"
|
|
|
|
- name: Execute STONITH script
|
|
become: true
|
|
delegate_to: "{{ groups.controller[0] }}"
|
|
shell: >
|
|
{{ overcloud_working_dir }}/config-stonith.sh &> config_stonith.log
|