File tree Expand file tree Collapse file tree 5 files changed +10
-15
lines changed
environments/common/inventory/group_vars/all Expand file tree Collapse file tree 5 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11---
22
3- - hosts : " {{ target_hosts | default('all') }} "
3+ - hosts : cluster
44 gather_facts : no
55 become : no
66 tasks :
77 - name : Lock/Unlock instances
88 openstack.cloud.server_action :
9- action : " {{ server_action | default('lock') }}"
9+ action : " {{ appliances_server_action | default('lock') }}"
1010 server : " {{ inventory_hostname }}"
1111 delegate_to : localhost
Original file line number Diff line number Diff line change 1010
1111- name : Unlock compute instances for rebuild
1212 vars :
13- server_action : unlock
14- target_hosts : compute
15- ansible.builtin.import_playbook : lock_unlock_instances.yml
13+ appliances_server_action : unlock
14+ ansible.builtin.command : ansible-playbook --limit compute adhoc/lock_unlock_instances.yml
1615
1716- hosts : login
1817 run_once : true
Original file line number Diff line number Diff line change 22- hosts : localhost
33 gather_facts : no
44 become : no
5- vars :
6- protected_environments :
7- - prd
85 tasks :
96 - name : Confirm continuing if using production environment
107 ansible.builtin.pause :
1714 Do you really want to continue (yes/no)?
1815 register : env_confirm_safe
1916 when :
20- - appliances_environment_name in protected_environments
21- - not (prd_continue | default(false) | bool)
17+ - appliances_environment_name in appliances_protected_environments
18+ - not (appliances_protected_environment_autoapprove | default(false) | bool)
2219 failed_when : not (env_confirm_safe.user_input | bool)
Original file line number Diff line number Diff line change 22
33- ansible.builtin.import_playbook : safe-env.yml
44
5- - name : Lock all instances
6- vars :
7- server_action : lock
8- target_hosts : all
9- ansible.builtin.import_playbook : adhoc/lock_unlock_instances.yml
5+ - name : Lock cluster instances
6+ ansible.builtin.command : ansible-playbook adhoc/lock_unlock_instances.yml
107
118- name : Run pre.yml hook
129 vars :
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ ansible_user: rocky
44appliances_repository_root : " {{ lookup('env', 'APPLIANCES_REPO_ROOT') }}"
55appliances_environment_root : " {{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}"
66appliances_environment_name : " {{ appliances_environment_root | basename | regex_replace('\\ W+', '') }}" # [a-zA-Z0-9_] only
7+ appliances_protected_environments :
8+ - prd
79appliances_cockpit_state : absent # RHEL cockpit installed but not enabled in genericcloud images; appliance defaults to removing it
810# appliances_state_dir: # define an absolute path here to use for persistent state: NB: This is defined as /var/lib/state in inventory by the default Terraform
911appliances_mode : configure
You can’t perform that action at this time.
0 commit comments