Merge "Persist bootstrap playbook config output file"
This commit is contained in:
commit
cfa69ee317
@ -181,7 +181,6 @@
|
|||||||
# Set this placeholder here to workaround an Ansible quirk
|
# Set this placeholder here to workaround an Ansible quirk
|
||||||
derived_network_params:
|
derived_network_params:
|
||||||
place_holder: place_holder
|
place_holder: place_holder
|
||||||
last_bootstrap_config_file: "{{ last_bootstrap_config_file }}"
|
|
||||||
|
|
||||||
- name: Turn on use_docker_proxy flag
|
- name: Turn on use_docker_proxy flag
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -233,6 +232,13 @@
|
|||||||
config_permdir: "{{ platform_path + '/config/' + software_version }}"
|
config_permdir: "{{ platform_path + '/config/' + software_version }}"
|
||||||
puppet_permdir: "{{ platform_path + '/puppet/' + software_version }}"
|
puppet_permdir: "{{ platform_path + '/puppet/' + software_version }}"
|
||||||
|
|
||||||
|
# Give the bootstrap config output file on the host a generic name so the
|
||||||
|
# same file is referenced if the host is bootstrapped locally and remotely
|
||||||
|
# in whatever order.
|
||||||
|
- name: Set bootstrap output file
|
||||||
|
set_fact:
|
||||||
|
last_bootstrap_config_file: "{{ config_permdir }}/last_bootstrap_config.yml"
|
||||||
|
|
||||||
- name: Check Docker status
|
- name: Check Docker status
|
||||||
command: systemctl status docker
|
command: systemctl status docker
|
||||||
failed_when: false
|
failed_when: false
|
||||||
@ -265,17 +271,29 @@
|
|||||||
register: last_config_file
|
register: last_config_file
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
- name: Set last config file to import (local)
|
||||||
|
set_fact:
|
||||||
|
last_config: "{{ last_bootstrap_config_file }}"
|
||||||
|
when: inventory_hostname == 'localhost'
|
||||||
|
|
||||||
# Currently Ansible include_vars only works with local file
|
# Currently Ansible include_vars only works with local file
|
||||||
- name: Fetch previous config file from this host
|
- block:
|
||||||
fetch:
|
# Give a host specific name in case the playbook is used to bootstrap
|
||||||
src: "{{ last_bootstrap_config_file }}"
|
# multiple remote hosts simultaneously
|
||||||
dest: /tmp/
|
- name: Set last config file to import (remote)
|
||||||
flat: yes
|
set_fact:
|
||||||
|
last_config: "/tmp/{{ (last_bootstrap_config_file | basename | splitext)[0] }}_{{ inventory_hostname }}.yml"
|
||||||
|
|
||||||
|
- name: Fetch previous config file from this host
|
||||||
|
fetch:
|
||||||
|
src: "{{ last_bootstrap_config_file }}"
|
||||||
|
dest: "{{ last_config }}"
|
||||||
|
flat: yes
|
||||||
when: inventory_hostname != 'localhost'
|
when: inventory_hostname != 'localhost'
|
||||||
|
|
||||||
- name: Read in last config values
|
- name: Read in last config values
|
||||||
include_vars:
|
include_vars:
|
||||||
file: "{{ last_bootstrap_config_file }}"
|
file: "{{ last_config }}"
|
||||||
|
|
||||||
- name: Turn on system attributes reconfiguration flag
|
- name: Turn on system attributes reconfiguration flag
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -2,6 +2,4 @@
|
|||||||
image_brand: StarlingX
|
image_brand: StarlingX
|
||||||
platform_path: /opt/platform
|
platform_path: /opt/platform
|
||||||
puppet_path: /opt/platform/puppet
|
puppet_path: /opt/platform/puppet
|
||||||
last_bootstrap_config_file: /tmp/last_bootstrap_config_{{ inventory_hostname }}.yml
|
|
||||||
|
|
||||||
standard_root_disk_size: 500
|
standard_root_disk_size: 500
|
||||||
|
Loading…
x
Reference in New Issue
Block a user