Skip to content

Commit

Permalink
Merge pull request #2 from thomas-crowe/TC_fix_bastion_password
Browse files Browse the repository at this point in the history
Tc fix bastion password
  • Loading branch information
fridim authored Jan 17, 2023
2 parents e98c2e8 + e6bd21e commit eb7d748
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 eb7d748

Please sign in to comment.