Move to new ansible_facts format

This commit is contained in:
uumas
2026-03-11 22:15:19 +02:00
parent ad5e1cbcc0
commit 59cb9da0a4
3 changed files with 5 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
- name: Add ssh key to authorized_keys
ansible.posix.authorized_key:
user: "{{ hostvars[target.host].ansible_user_id }}"
user: "{{ hostvars[target.host].ansible_facts.user_id }}"
key: >-
{{
_borgmatic_key.public_key + ' ' + _borgmatic_key.comment
@@ -22,7 +22,7 @@
- name: Create backup directories
ansible.builtin.file:
path: "{{ hostvars[target.host].ansible_user_dir }}/{{ item }}/{{ ansible_fqdn }}"
path: "{{ hostvars[target.host].ansible_facts.user_dir }}/{{ item }}/{{ ansible_facts.fqdn }}"
state: directory
mode: "0700"
loop: "{{ target.directories }}"

View File

@@ -21,8 +21,8 @@
components:
- main
when: >
(ansible_distribution == 'Debian' and ansible_distribution_major_version | int == 11) or
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version | int < 24)
(ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version | int == 11) or
(ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_major_version | int < 24)
- name: Install caddy
ansible.builtin.apt:

View File

@@ -1,5 +1,5 @@
---
- name: Include variables for os family {{ ansible_os_family }}
- name: Include variables for os family {{ ansible_facts.os_family }}
ansible.builtin.include_vars: "{{ ansible_facts.os_family }}.yaml"
- name: Install locales package