refactor(global_defaults): derive the primary user once for every consumer

This commit is contained in:
2026-10-05 16:54:28 +02:00
parent ef8d50e6be
commit 9aad42a4c2
4 changed files with 20 additions and 13 deletions
+3 -5
View File
@@ -119,15 +119,13 @@
when:
- post_reboot_can_connect | bool
no_log: true
vars:
_primary: "{{ (system_cfg.users | dict2items | selectattr('value.password', 'defined') | first) }}"
ansible.builtin.set_fact:
ansible_connection: ssh
ansible_host: "{{ system_cfg.network.ip }}"
ansible_port: 22
ansible_user: "{{ _primary.key }}"
ansible_password: "{{ _primary.value.password }}"
ansible_become_password: "{{ _primary.value.password }}"
ansible_user: "{{ bootstrap_primary_user.name }}"
ansible_password: "{{ bootstrap_primary_user.password }}"
ansible_become_password: "{{ bootstrap_primary_user.password }}"
ansible_ssh_extra_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
ansible_python_interpreter: /usr/bin/python3