refactor(vmware): move ansible_connection out of global_defaults into role params
This commit is contained in:
12
main.yml
12
main.yml
@@ -110,6 +110,10 @@
|
||||
ansible.builtin.import_role:
|
||||
name: system_check
|
||||
|
||||
- name: Determine target connection type
|
||||
ansible.builtin.set_fact:
|
||||
_target_connection: "{{ 'vmware_tools' if hypervisor_type == 'vmware' else 'ssh' }}"
|
||||
|
||||
roles:
|
||||
- role: virtualization
|
||||
when: system_cfg.type == "virtual"
|
||||
@@ -117,24 +121,28 @@
|
||||
ansible_connection: local
|
||||
|
||||
- role: environment
|
||||
vars:
|
||||
ansible_connection: "{{ 'vmware_tools' if hypervisor_type == 'vmware' else 'ssh' }}"
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
|
||||
- role: partitioning
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
vars:
|
||||
partitioning_boot_partition_suffix: 1
|
||||
partitioning_main_partition_suffix: 2
|
||||
|
||||
- role: bootstrap
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
|
||||
- role: configuration
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
|
||||
- role: cis
|
||||
when: system_cfg.features.cis.enabled | bool
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
|
||||
- role: cleanup
|
||||
when: system_cfg.type in ["virtual", "physical"]
|
||||
become: false
|
||||
ansible_connection: "{{ _target_connection }}"
|
||||
|
||||
post_tasks:
|
||||
- name: Set post-reboot connection flags
|
||||
|
||||
Reference in New Issue
Block a user