Allow passwordless ssh for VMware Setup
This commit is contained in:
parent
12a7549aaa
commit
f8ac22cfab
@ -43,8 +43,27 @@
|
|||||||
changed_when: result.rc == 0
|
changed_when: result.rc == 0
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Set connection back to SSH
|
- name: Configure SSH for root login
|
||||||
when: hypervisor == "vmware" and vmware_ssh | bool
|
when: hypervisor == "vmware" and vmware_ssh | bool
|
||||||
|
block:
|
||||||
|
- name: Allow empty passwords temporarily
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?PermitEmptyPasswords.*"
|
||||||
|
replace: "PermitEmptyPasswords yes"
|
||||||
|
|
||||||
|
- name: Allow root login
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "^#?PermitRootLogin.*"
|
||||||
|
replace: "PermitRootLogin yes"
|
||||||
|
|
||||||
|
- name: Reload SSH service to apply changes
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: sshd
|
||||||
|
state: reloaded
|
||||||
|
|
||||||
|
- name: Set connection back to SSH
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ansible_connection: ssh
|
ansible_connection: ssh
|
||||||
ansible_user: "root"
|
ansible_user: "root"
|
||||||
|
Loading…
Reference in New Issue
Block a user