Fix VM Connection if hypervisor is VMware
This commit is contained in:
12
main.yml
12
main.yml
@@ -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:
|
||||
|
||||
@@ -9,3 +9,12 @@ hypervisor_node: "NodeName"
|
||||
hypervisor_storage: "local-btrfs"
|
||||
boot_iso: "local-btrfs:iso/archlinux-x86_64.iso"
|
||||
rhel_iso: "local-btrfs:rhel-9.4-x86_64-dvd.iso"
|
||||
|
||||
# For VMware-Tools
|
||||
ansible_vmware_host: "{{ hypervisor_url }}"
|
||||
ansible_vmware_user: "{{ hypervisor_username }}"
|
||||
ansible_vmware_password: "{{ hypervisor_password }}"
|
||||
ansible_vmware_guest_path: "/{{ hypervisor_cluster }}/vm{{ vm_path }}/{{ hostname }}"
|
||||
ansible_vmware_validate_certs: no
|
||||
ansible_vmware_tools_user: "root"
|
||||
ansible_vmware_tools_password: ""
|
||||
|
||||
Reference in New Issue
Block a user