diff options
| author | Colin Wilk <colin@wilk.cx> | 2026-06-28 20:51:50 +0000 |
|---|---|---|
| committer | Colin Wilk <colin@wilk.cx> | 2026-06-28 23:18:35 +0200 |
| commit | 1143a273413e8c3df0b4c0f553eab30acb0804f8 (patch) | |
| tree | 405d81ba5be99b55f7321d89d72ffbe1ff40c614 /tasks | |
| parent | 7d96c1a11fc442b4efddf9ce5250cf0a9dfaf02e (diff) | |
| download | ansible-role-borgbackup-1143a273413e8c3df0b4c0f553eab30acb0804f8.tar.gz ansible-role-borgbackup-1143a273413e8c3df0b4c0f553eab30acb0804f8.zip | |
fix: use ansible_facts for getent_passwd
Replace direct usage of getent_passwd with ansible_facts.getent_passwd
in both client_setup.yml and server_setup.yml.
Ansible 2.24+ will remove the INJECT_FACTS_AS_VARS feature, requiring
explicit use of ansible_facts dictionary instead of top-level fact
variables.
Fixes deprecation warning:
INJECT_FACTS_AS_VARS default to 'True' is deprecated, top-level facts
will not be auto injected after the change.
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/client_setup.yml | 2 | ||||
| -rw-r--r-- | tasks/server_setup.yml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tasks/client_setup.yml b/tasks/client_setup.yml index fc32e03..5d162ed 100644 --- a/tasks/client_setup.yml +++ b/tasks/client_setup.yml @@ -7,7 +7,7 @@ - name: Compute borg_client_user_home if not set ansible.builtin.set_fact: - borg_client_user_home: "{{ getent_passwd[borg_client_user][4] }}" + borg_client_user_home: "{{ ansible_facts.getent_passwd[borg_client_user][4] }}" when: borg_client_user_home is not defined - name: Validate borg_client_user home exists diff --git a/tasks/server_setup.yml b/tasks/server_setup.yml index 66b92bd..a8dfe23 100644 --- a/tasks/server_setup.yml +++ b/tasks/server_setup.yml @@ -24,7 +24,7 @@ msg: | User {{ borg_server_user }} does not exist on {{ borg_server_host }}. Please create the user before running this role or set borg_server_user_create: true. - when: getent_passwd[borg_server_user] is not defined + when: ansible_facts.getent_passwd[borg_server_user] is not defined delegate_to: "{{ borg_server_host }}" - name: Ensure borg server user home directory exists |