Files
ansible-collection-infrastr…/roles/proxmox_lxc_provision/tasks/post-clone.yml
T
patrick 51c1c5b611 refactor(proxmox_lxc_provision): rename password vars and parameterize user name
Rename lxc_password to lxc_root_password for consistency with the new
lxc_user_password (replaces the previously bare 'password' variable in
post-clone.yml, which silently collided with any same-named caller var).
Add lxc_user_name (default: admin) so the non-root account managed in
post-clone.yml is no longer hardcoded. Apply default(omit) to the root
password in create.yml so it is genuinely optional as documented.

BREAKING CHANGE: callers passing lxc_password or a bare 'password' var
must rename to lxc_root_password and lxc_user_password respectively.
2026-06-27 21:11:13 -04:00

28 lines
746 B
YAML
Executable File

---
- name: Change root password
ansible.builtin.user:
name: root
password: "{{ lxc_root_password | password_hash('sha512') }}"
update_password: always
when: lxc_root_password is defined
- name: Change user password
ansible.builtin.user:
name: "{{ lxc_user_name }}"
password: "{{ lxc_user_password | password_hash('sha512') }}"
update_password: always
when: lxc_user_password is defined
- name: Regenerate SSH host keys
ansible.builtin.include_role:
name: system_setup
tasks_from: ssh
vars:
regenerate_ssh_keys: true
- name: Remove previous entry from known hosts
ansible.builtin.known_hosts:
name: "{{ hostvars[lxc_hostname]['ansible_host'] }}"
state: absent
delegate_to: localhost