Don't set password for root. Just lock account.

This commit is contained in:
Timo Makinen 2020-08-26 20:24:08 +03:00
parent 54b5a74f54
commit d54fe7975c

View file

@ -40,16 +40,10 @@
delegate_to: localhost delegate_to: localhost
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms
- name: generate root password
command: "/srv/ansible/scripts/genpasswd {{ inventory_hostname }}"
register: root_password
delegate_to: localhost
when: inventory_hostname not in result.list_vms
- name: create inject file - name: create inject file
copy: copy:
content: | content: |
rootpw --iscrypted {{ root_password.stdout }} rootpw --lock
%post %post
umask 077 umask 077
mkdir -p /root/.ssh mkdir -p /root/.ssh