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.
This commit is contained in:
2026-06-27 21:11:13 -04:00
parent 27924cf55c
commit 51c1c5b611
5 changed files with 12 additions and 9 deletions
@@ -2,16 +2,16 @@
- name: Change root password
ansible.builtin.user:
name: root
password: "{{ lxc_password | password_hash('sha512') }}"
password: "{{ lxc_root_password | password_hash('sha512') }}"
update_password: always
when: lxc_password is defined
when: lxc_root_password is defined
- name: Change admin password
- name: Change user password
ansible.builtin.user:
name: admin
password: "{{ password | password_hash('sha512') }}"
name: "{{ lxc_user_name }}"
password: "{{ lxc_user_password | password_hash('sha512') }}"
update_password: always
when: password is defined
when: lxc_user_password is defined
- name: Regenerate SSH host keys
ansible.builtin.include_role: