From a064d417868b72451db3c3294b0439a5cdd790e9 Mon Sep 17 00:00:00 2001 From: Apollo3zehn Date: Fri, 15 Dec 2023 11:09:05 +0100 Subject: [PATCH] Use original fact names instead of injected ones --- molecule/default/converge.yml | 4 ++-- tasks/install-bin.yml | 2 +- tasks/main.yml | 6 +++--- templates/etc/ansible/facts.d/rclone.fact.j2 | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 3db08d5..afd5072 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -9,7 +9,7 @@ ansible.builtin.apt: update_cache: yes cache_valid_time: 600 - when: ansible_os_family == 'Debian' + when: ansible_facts.os_family == 'Debian' - name: Wait for systemd to complete initialization. # noqa command-instead-of-module ansible.builtin.command: systemctl is-system-running @@ -19,7 +19,7 @@ 'degraded' in systemctl_status.stdout retries: 30 delay: 5 - when: ansible_distribution == 'Fedora' + when: ansible_facts.distribution == 'Fedora' changed_when: false - name: Show ansible version diff --git a/tasks/install-bin.yml b/tasks/install-bin.yml index f22a3ba..236130f 100644 --- a/tasks/install-bin.yml +++ b/tasks/install-bin.yml @@ -5,7 +5,7 @@ ansible.builtin.apt: update_cache: true become: true - when: ansible_distribution == 'Ubuntu' + when: ansible_facts.distribution == 'Ubuntu' - name: Install required packages ansible.builtin.package: diff --git a/tasks/main.yml b/tasks/main.yml index 0bcaa25..111f984 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,9 +3,9 @@ - name: Gather OS specific variables ansible.builtin.include_vars: "{{ item }}" with_first_found: - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml' - - '{{ ansible_distribution }}.yml' - - '{{ ansible_os_family }}.yml' + - '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml' + - '{{ ansible_facts.distribution }}.yml' + - '{{ ansible_facts.os_family }}.yml' tags: - vars diff --git a/templates/etc/ansible/facts.d/rclone.fact.j2 b/templates/etc/ansible/facts.d/rclone.fact.j2 index 5fa313c..1992201 100644 --- a/templates/etc/ansible/facts.d/rclone.fact.j2 +++ b/templates/etc/ansible/facts.d/rclone.fact.j2 @@ -1,4 +1,4 @@ -#!{{ ansible_python['executable'] }} +#!{{ ansible_facts.python['executable'] }} # -*- coding: utf-8 -*- # Copyright (C) 2018 Maciej Delmanowski