Fix deprecation warnings for inline templating

This commit is contained in:
waal70
2025-08-30 17:52:02 +02:00
parent 857c37a2c1
commit 95c26ad647
3 changed files with 11 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
- name: Check the primary key for the unprivileged user
ansible.posix.authorized_key:
user: "{{ interactive_user }}"
key: "{{ lookup('file', '../home/ssh-keys/{{ interactive_user }}/{{ interactive_user }}-yubi-1.pub') }}"
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
state: present
exclusive: false
register: setkey
@@ -22,14 +22,14 @@
when: setkey.changed
ansible.posix.authorized_key:
user: "{{ interactive_user }}"
key: "{{ lookup('file', '../home/ssh-keys/{{ interactive_user }}/{{ interactive_user }}-yubi-1.pub') }}"
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-1.pub') }}"
state: present
exclusive: true
- name: Set the secondary key for the unprivileged user
ansible.posix.authorized_key:
user: "{{ interactive_user }}"
key: "{{ lookup('file', '../home/ssh-keys/{{ interactive_user }}/{{ interactive_user }}-yubi-2.pub') }}"
key: "{{ lookup('file', '../home/ssh-keys/' ~ interactive_user ~ '/' ~ interactive_user ~ '-yubi-2.pub') }}"
state: present
exclusive: false