Fix VM Connection if hypervisor is VMware

This commit is contained in:
2024-10-30 17:57:22 +01:00
parent cdd8062937
commit c60fcca86d
2 changed files with 17 additions and 4 deletions

View File

@@ -23,16 +23,20 @@
vars:
hypervisor: "vmware"
install_drive: "/dev/sda"
ansible_user: "{{ user_name }}"
ansible_password: "{{ user_password }}"
ansible_become_password: "{{ user_password }}"
ansible_ssh_extra_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
pre_tasks:
- name: Set ansible_python_interpreter
when: os | lower in ["almalinux", "rhel9", "rhel8", "rocky"]
ansible.builtin.set_fact:
ansible_python_interpreter: /usr/bin/python3
- name: Set SSH Access
when: hypervisor != "vmware"
ansible.builtin.set_fact:
ansible_user: "{{ user_name }}"
ansible_password: "{{ user_password }}"
ansible_become_password: "{{ user_password }}"
ansible_ssh_extra_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
- name: Validate variables
ansible.builtin.assert:
that: