Skip to content

Commit

Permalink
Updating task to generate random password.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Crowe committed Jan 8, 2023
1 parent e98c2e8 commit a64471b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@
dest: /var/lib/libvirt/images/centos8-kvm-cnv.qcow2
when: not centos8_cnv.stat.exists

- name: Generate the root password
set_fact:
bastion_password: "{{ lookup('password', '/dev/null length=12 chars=ascii_letters,digits') }}"

- name: Set the root password on the centos8-kvm-cnv image
ansible.builtin.command: >
virt-customize -a /var/lib/libvirt/images/centos8-kvm-cnv.qcow2 --root-password password:redhat
virt-customize -a /var/lib/libvirt/images/centos8-kvm-cnv.qcow2 --root-password password:"{{ bastion_password }}"
when: not centos8_cnv.stat.exists

- name: Setup httpd in the bastion image
Expand Down

0 comments on commit a64471b

Please sign in to comment.