Fix password hashing;Delete temporary user;Housekeeping
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-06-10 16:53:03 +02:00
parent 4257849ca4
commit f15485e7c2
5 changed files with 11 additions and 3 deletions

View File

@ -4,4 +4,4 @@
state: absent
- name: Reboot host
ansible.builtin.shell:
cmd: reboot now
cmd: /usr/sbin/reboot now

View File

@ -1,7 +1,7 @@
- name: Set root password
ansible.builtin.user:
name: root
password: "{{ ovfproperties['guestinfo.rootpw'] }}"
password: "{{ ovfproperties['guestinfo.rootpw'] | password_hash('sha512', 65534 | random(seed=ovfproperties['guestinfo.hostname']) | string) }}"
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa

View File

@ -1,6 +1,6 @@
- name: Store current ovfEnvironment
ansible.builtin.shell:
cmd: vmtoolsd --cmd "info-get guestinfo.ovfEnv"
cmd: /usr/bin/vmtoolsd --cmd "info-get guestinfo.ovfEnv"
register: ovfenv
- name: Parse XML for vApp properties
community.general.xml:

View File

@ -15,3 +15,6 @@
- name: Install ansible
import_tasks: ansible.yml
- name: Delete temporary users
import_tasks: users.yml

View File

@ -0,0 +1,5 @@
- name: Delete 'ubuntu' user
ansible.builtin.user:
name: ubuntu
state: absent
remove: yes