Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use ansible_facts instead of ansible_* variables #474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .config/molecule/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ verifier:
env:
PYTHONPATH: "${MOLECULE_PROJECT_DIRECTORY}/../../.testinfra:${PYTHONPATH}"
provisioner:
env:
ANSIBLE_INJECT_FACT_VARS: false
playbooks:
converge: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/converge.yml"
inventory:
Expand Down
4 changes: 2 additions & 2 deletions roles/_common/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ argument_specs:
options:
_common_dependencies:
description: "Package dependencies to install"
default: "{% if (ansible_pkg_mgr == 'apt') %}\
{{ ('python-apt' if ansible_python_version is version('3', '<') else 'python3-apt') }}
default: "{% if (ansible_facts['pkg_mgr'] == 'apt') %}\
{{ ('python-apt' if ansible_facts['python_version'] is version('3', '<') else 'python3-apt') }}
{% else %}\
{% endif %}"
_common_web_listen_address:
Expand Down
2 changes: 1 addition & 1 deletion roles/_common/tasks/preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

- name: Assert usage of systemd as an init system
ansible.builtin.assert:
that: ansible_service_mgr == 'systemd'
that: ansible_facts['service_mgr'] == 'systemd'
msg: "This module only works with systemd"
tags:
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}"
Expand Down
4 changes: 2 additions & 2 deletions roles/_common/tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
- name: Install selinux python packages [RedHat]
ansible.builtin.package:
name: "{{ ['libselinux-python', 'policycoreutils-python']
if ansible_python_version is version('3', '<') else
if ansible_facts['python_version'] is version('3', '<') else
['python3-libselinux', 'python3-policycoreutils'] }}"
state: present
register: __common_install_selinux_packages
until: __common_install_selinux_packages is success
retries: 5
delay: 2
become: true
when: ansible_os_family | lower == "redhat"
when: ansible_facts['os_family'] | lower == "redhat"
tags:
- "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}"
- configure
Expand Down
4 changes: 2 additions & 2 deletions roles/_common/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ _common_selinux_port: ""
_common_service_name: "{{ __common_parent_role_short_name }}"
_common_system_user: ""
_common_system_group: ""
_common_dependencies: "{% if (ansible_pkg_mgr == 'apt') %}\
{{ ('python-apt' if ansible_python_version is version('3', '<') else 'python3-apt') }}
_common_dependencies: "{% if (ansible_facts['pkg_mgr'] == 'apt') %}\
{{ ('python-apt' if ansible_facts['python_version'] is version('3', '<') else 'python3-apt') }}
{% else %}\
{% endif %}"
_common_binary_unarchive_opts: ""
Expand Down
4 changes: 2 additions & 2 deletions roles/alertmanager/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
alertmanager_version: 0.27.0
alertmanager_binary_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/\
alertmanager-{{ alertmanager_version }}.{{ ansible_system | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz"
alertmanager-{{ alertmanager_version }}.{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz"
alertmanager_checksums_url: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt"

alertmanager_config_dir: /etc/alertmanager
Expand Down Expand Up @@ -136,7 +136,7 @@ alertmanager_amtool_config_output: 'extended'
alertmanager_binary_install_dir: '/usr/local/bin'

# Local path to stash the archive and its extraction
alertmanager_local_cache_path: "/tmp/alertmanager-{{ ansible_system | lower }}-{{ _alertmanager_go_ansible_arch }}/{{ alertmanager_version }}"
alertmanager_local_cache_path: "/tmp/alertmanager-{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}/{{ alertmanager_version }}"

alertmanager_system_user: alertmanager
alertmanager_system_group: "{{ alertmanager_system_user }}"
4 changes: 2 additions & 2 deletions roles/alertmanager/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument_specs:
default: 0.27.0
alertmanager_binary_url:
description: "URL of the alertmanager binaries .tar.gz file"
default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/alertmanager-{{ alertmanager_version }}.{{ ansible_system | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz"
default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/alertmanager-{{ alertmanager_version }}.{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}.tar.gz"
alertmanager_checksums_url:
description: "URL of the alertmanager checksums file"
default: "https://github.com/{{ _alertmanager_repo }}/releases/download/v{{ alertmanager_version }}/sha256sums.txt"
Expand Down Expand Up @@ -108,7 +108,7 @@ argument_specs:
default: "extended"
alertmanager_local_cache_path:
description: 'Local path to stash the archive and its extraction'
default: "/tmp/alertmanager-{{ ansible_system | lower }}-{{ _alertmanager_go_ansible_arch }}/{{ alertmanager_version }}"
default: "/tmp/alertmanager-{{ ansible_facts['system'] | lower }}-{{ _alertmanager_go_ansible_arch }}/{{ alertmanager_version }}"
alertmanager_system_user:
description:
- "I(Advanced)"
Expand Down
2 changes: 1 addition & 1 deletion roles/alertmanager/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ alertmanager_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
when: ansible_facts['selinux'].status == "enabled"
tags:
- alertmanager
- configure
Expand Down
2 changes: 1 addition & 1 deletion roles/alertmanager/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _alertmanager_go_ansible_arch: "{{ {'i386': '386',
'x86_64': 'amd64',
'aarch64': 'arm64',
'armv7l': 'armv7',
'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}"
'armv6l': 'armv6'}.get(ansible_facts['architecture'], ansible_facts['architecture']) }}"

# The expected location of the amtool configuration file
_alertmanager_amtool_config_dir: '/etc/amtool'
Expand Down
4 changes: 2 additions & 2 deletions roles/bind_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
bind_exporter_version: 0.8.0
bind_exporter_binary_url: "https://github.com/{{ _bind_exporter_repo }}/releases/download/v{{ bind_exporter_version }}/\
bind_exporter-{{ bind_exporter_version }}.{{ ansible_system | lower }}-{{ _bind_exporter_go_ansible_arch }}.tar.gz"
bind_exporter-{{ bind_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _bind_exporter_go_ansible_arch }}.tar.gz"
bind_exporter_checksums_url: "https://github.com/{{ _bind_exporter_repo }}/releases/download/v{{ bind_exporter_version }}/sha256sums.txt"

bind_exporter_web_listen_address: "0.0.0.0:9119"
Expand All @@ -23,4 +23,4 @@ bind_exporter_system_user: "{{ bind_exporter_system_group }}"
bind_exporter_binary_install_dir: "/usr/local/bin"

bind_exporter_config_dir: "/etc/bind_exporter"
bind_exporter_local_cache_path: "/tmp/bind_exporter-{{ ansible_system | lower }}-{{ _bind_exporter_go_ansible_arch }}/{{ bind_exporter_version }}"
bind_exporter_local_cache_path: "/tmp/bind_exporter-{{ ansible_facts['system'] | lower }}-{{ _bind_exporter_go_ansible_arch }}/{{ bind_exporter_version }}"
4 changes: 2 additions & 2 deletions roles/bind_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument_specs:
default: "0.8.0"
bind_exporter_binary_url:
description: "URL of the bind_exporter binaries .tar.gz file"
default: "https://github.com/{{ _bind_exporter_repo }}/releases/download/v{{ bind_exporter_version }}/bind_exporter-{{ bind_exporter_version }}.{{ ansible_system | lower }}-{{ _bind_exporter_go_ansible_arch }}.tar.gz"
default: "https://github.com/{{ _bind_exporter_repo }}/releases/download/v{{ bind_exporter_version }}/bind_exporter-{{ bind_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _bind_exporter_go_ansible_arch }}.tar.gz"
bind_exporter_checksums_url:
description: "URL of the bind_exporter checksums file"
default: "https://github.com/{{ _bind_exporter_repo }}/releases/download/v{{ bind_exporter_version }}/sha256sums.txt"
Expand Down Expand Up @@ -81,4 +81,4 @@ argument_specs:
default: "bind-exp"
bind_exporter_local_cache_path:
description: "Local path to stash the archive and its extraction"
default: "/tmp/bind_exporter-{{ ansible_system | lower }}-{{ _bind_exporter_go_ansible_arch }}/{{ bind_exporter_version }}"
default: "/tmp/bind_exporter-{{ ansible_facts['system'] | lower }}-{{ _bind_exporter_go_ansible_arch }}/{{ bind_exporter_version }}"
2 changes: 1 addition & 1 deletion roles/bind_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ bind_exporter_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
when: ansible_facts['selinux'].status == "enabled"
tags:
- bind_exporter_configure

Expand Down
2 changes: 1 addition & 1 deletion roles/bind_exporter/templates/bind_exporter.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RestartSec=1
StartLimitInterval=0

{% set protect_home = 'yes' %}
{% for m in ansible_mounts if m.mount.startswith('/home') %}
{% for m in ansible_facts['mounts'] if m.mount.startswith('/home') %}
{% set protect_home = 'read-only' %}
{% endfor %}
ProtectHome={{ protect_home }}
Expand Down
2 changes: 1 addition & 1 deletion roles/bind_exporter/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _bind_exporter_go_ansible_arch: "{{ {'i386': '386',
'x86_64': 'amd64',
'aarch64': 'arm64',
'armv7l': 'armv7',
'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}"
'armv6l': 'armv6'}.get(ansible_facts['architecture'], ansible_facts['architecture']) }}"
_bind_exporter_repo: "prometheus-community/bind_exporter"
_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"
_bind_exporter_binaries: ['bind_exporter']
4 changes: 2 additions & 2 deletions roles/blackbox_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
blackbox_exporter_version: 0.25.0
blackbox_exporter_binary_url: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/\
blackbox_exporter-{{ blackbox_exporter_version }}.{{ ansible_system | lower }}-{{ _blackbox_exporter_go_ansible_arch }}.tar.gz"
blackbox_exporter-{{ blackbox_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _blackbox_exporter_go_ansible_arch }}.tar.gz"
blackbox_exporter_checksums_url: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/sha256sums.txt"

blackbox_exporter_web_listen_address: "0.0.0.0:9115"
Expand Down Expand Up @@ -72,7 +72,7 @@ blackbox_exporter_configuration_modules:
blackbox_exporter_config_dir: /etc/blackbox_exporter

# Local path to stash the archive and its extraction
blackbox_exporter_local_cache_path: "/tmp/blackbox_exporter-{{ ansible_system | lower }}-{{ _blackbox_exporter_go_ansible_arch }}/\
blackbox_exporter_local_cache_path: "/tmp/blackbox_exporter-{{ ansible_facts['system'] | lower }}-{{ _blackbox_exporter_go_ansible_arch }}/\
{{ blackbox_exporter_version }}"

blackbox_exporter_binary_install_dir: "/usr/local/bin"
4 changes: 2 additions & 2 deletions roles/blackbox_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument_specs:
default: "0.25.0"
blackbox_exporter_binary_url:
description: "URL of the blackbox_exporter binaries .tar.gz file"
default: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/blackbox_exporter-{{ blackbox_exporter_version }}.{{ ansible_system | lower }}-{{ _blackbox_exporter_go_ansible_arch }}.tar.gz"
default: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/blackbox_exporter-{{ blackbox_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _blackbox_exporter_go_ansible_arch }}.tar.gz"
blackbox_exporter_checksums_url:
description: "URL of the blackbox exporter checksums file"
default: "https://github.com/{{ _blackbox_exporter_repo }}/releases/download/v{{ blackbox_exporter_version }}/sha256sums.txt"
Expand Down Expand Up @@ -49,4 +49,4 @@ argument_specs:
default: "blackbox-exp"
blackbox_exporter_local_cache_path:
description: 'Local path to stash the archive and its extraction'
default: "/tmp/blackbox_exporter-{{ ansible_system | lower }}-{{ _blackbox_exporter_go_ansible_arch }}/{{ blackbox_exporter_version }}"
default: "/tmp/blackbox_exporter-{{ ansible_facts['system'] | lower }}-{{ _blackbox_exporter_go_ansible_arch }}/{{ blackbox_exporter_version }}"
2 changes: 1 addition & 1 deletion roles/blackbox_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ blackbox_exporter_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
when: ansible_facts['selinux'].status == "enabled"
tags:
- blackbox_exporter_configure

Expand Down
6 changes: 3 additions & 3 deletions roles/blackbox_exporter/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ _blackbox_exporter_go_ansible_arch: "{{ {'i386': '386',
'x86_64': 'amd64',
'aarch64': 'arm64',
'armv7l': 'armv7',
'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}"
'armv6l': 'armv6'}.get(ansible_facts['architecture'], ansible_facts['architecture']) }}"
_blackbox_exporter_repo: "prometheus/blackbox_exporter"
_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"
_blackbox_exporter_binaries: ['blackbox_exporter']
_blackbox_exporter_dependencies: "{% if (ansible_pkg_mgr == 'apt') %}\
{{ (['python-apt', 'libcap2-bin'] if ansible_python_version is version('3', '<') else ['python3-apt', 'libcap2-bin']) }}
_blackbox_exporter_dependencies: "{% if (ansible_facts['pkg_mgr'] == 'apt') %}\
{{ (['python-apt', 'libcap2-bin'] if ansible_facts['python_version'] is version('3', '<') else ['python3-apt', 'libcap2-bin']) }}
{% else %}\
{% endif %}"
4 changes: 2 additions & 2 deletions roles/cadvisor/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
cadvisor_version: 0.49.1
cadvisor_binary_url: "https://github.com/{{ _cadvisor_repo }}/releases/download/v{{ cadvisor_version }}/\
cadvisor-v{{ cadvisor_version }}-{{ ansible_system | lower }}-{{ _cadvisor_go_ansible_arch }}"
cadvisor-v{{ cadvisor_version }}-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}"

cadvisor_listen_ip: "0.0.0.0"
cadvisor_port: "8080"
Expand All @@ -18,6 +18,6 @@ cadvisor_system_group: "root"
cadvisor_system_user: "{{ cadvisor_system_group }}"

# Local path to stash the archive and its extraction
cadvisor_local_cache_path: "/tmp/cadvisor-{{ ansible_system | lower }}-{{ _cadvisor_go_ansible_arch }}/{{ cadvisor_version }}"
cadvisor_local_cache_path: "/tmp/cadvisor-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}/{{ cadvisor_version }}"

cadvisor_binary_install_dir: "/usr/local/bin"
4 changes: 2 additions & 2 deletions roles/cadvisor/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument_specs:
default: "0.49.1"
cadvisor_binary_url:
description: "URL of the cadvisor binary file"
default: "https://github.com/{{ _cadvisor_repo }}/releases/download/v{{ cadvisor_version }}/cadvisor-v{{ cadvisor_version }}-{{ ansible_system | lower }}-{{ _cadvisor_go_ansible_arch }}"
default: "https://github.com/{{ _cadvisor_repo }}/releases/download/v{{ cadvisor_version }}/cadvisor-v{{ cadvisor_version }}-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}"
cadvisor_listen_ip:
description: "Address on which cadvisor will listen"
default: "0.0.0.0"
Expand Down Expand Up @@ -88,4 +88,4 @@ argument_specs:
default: "/usr/local/bin"
cadvisor_local_cache_path:
description: 'Local path to stash the archive and its extraction'
default: "/tmp/cadvisor-{{ ansible_system | lower }}-{{ _cadvisor_go_ansible_arch }}/{{ cadvisor_version }}"
default: "/tmp/cadvisor-{{ ansible_facts['system'] | lower }}-{{ _cadvisor_go_ansible_arch }}/{{ cadvisor_version }}"
2 changes: 1 addition & 1 deletion roles/cadvisor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ cadvisor_port }}"
when: ansible_selinux.status == "enabled"
when: ansible_facts['selinux'].status == "enabled"
tags:
- cadvisor_configure

Expand Down
2 changes: 1 addition & 1 deletion roles/cadvisor/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ _cadvisor_go_ansible_arch: "{{ {'i386': '386',
'x86_64': 'amd64',
'aarch64': 'arm64',
'armv7l': 'armv7',
'armv6l': 'armv6'}.get(ansible_architecture, ansible_architecture) }}"
'armv6l': 'armv6'}.get(ansible_facts['architecture'], ansible_facts['architecture']) }}"
_cadvisor_repo: "google/cadvisor"
_github_api_headers: "{{ {'GITHUB_TOKEN': lookup('ansible.builtin.env', 'GITHUB_TOKEN')} if (lookup('ansible.builtin.env', 'GITHUB_TOKEN')) else {} }}"
_cadvisor_binaries: ['cadvisor']
4 changes: 2 additions & 2 deletions roles/chrony_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
chrony_exporter_version: 0.11.0
chrony_exporter_binary_url: "https://github.com/{{ _chrony_exporter_repo }}/releases/download/v{{ chrony_exporter_version }}/\
chrony_exporter-{{ chrony_exporter_version }}.{{ ansible_system | lower }}-{{ _chrony_exporter_go_ansible_arch }}.tar.gz"
chrony_exporter-{{ chrony_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _chrony_exporter_go_ansible_arch }}.tar.gz"
chrony_exporter_checksums_url: "https://github.com/{{ _chrony_exporter_repo }}/releases/download/v{{ chrony_exporter_version }}/sha256sums.txt"

chrony_exporter_web_listen_address: "0.0.0.0:9123"
Expand All @@ -24,7 +24,7 @@ chrony_exporter_system_group: "{{ chrony_exporter_system_user }}"


# Local path to stash the archive and its extraction
chrony_exporter_local_cache_path: "/tmp/chrony_exporter-{{ ansible_system | lower }}-{{ _chrony_exporter_go_ansible_arch }}/{{ chrony_exporter_version }}"
chrony_exporter_local_cache_path: "/tmp/chrony_exporter-{{ ansible_facts['system'] | lower }}-{{ _chrony_exporter_go_ansible_arch }}/{{ chrony_exporter_version }}"

chrony_exporter_binary_install_dir: "/usr/local/bin"
chrony_exporter_config_dir: "/etc/chrony_exporter"
4 changes: 2 additions & 2 deletions roles/chrony_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ argument_specs:
default: "0.11.0"
chrony_exporter_binary_url:
description: "URL of the chrony_exporter binaries .tar.gz file"
default: "https://github.com/{{ _chrony_exporter_repo }}/releases/download/v{{ chrony_exporter_version }}/chrony_exporter-{{ chrony_exporter_version }}.{{ ansible_system | lower }}-{{ _chrony_exporter_go_ansible_arch }}.tar.gz"
default: "https://github.com/{{ _chrony_exporter_repo }}/releases/download/v{{ chrony_exporter_version }}/chrony_exporter-{{ chrony_exporter_version }}.{{ ansible_facts['system'] | lower }}-{{ _chrony_exporter_go_ansible_arch }}.tar.gz"
chrony_exporter_checksums_url:
description: "URL of the chrony_exporter checksums file"
default: "https://github.com/{{ _chrony_exporter_repo }}/releases/download/v{{ chrony_exporter_version }}/sha256sums.txt"
Expand Down Expand Up @@ -66,7 +66,7 @@ argument_specs:
default: "/usr/local/bin"
chrony_exporter_local_cache_path:
description: 'Local path to stash the archive and its extraction'
default: "/tmp/chrony_exporter-{{ ansible_system | lower }}-{{ _chrony_exporter_go_ansible_arch }}/{{ chrony_exporter_version }}"
default: "/tmp/chrony_exporter-{{ ansible_facts['system'] | lower }}-{{ _chrony_exporter_go_ansible_arch }}/{{ chrony_exporter_version }}"
chrony_exporter_config_dir:
description: "Path to directory with chrony_exporter configuration"
default: "/etc/chrony_exporter"
2 changes: 1 addition & 1 deletion roles/chrony_exporter/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ chrony_exporter_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
when: ansible_facts['selinux'].status == "enabled"
tags:
- chrony_exporter_configure

Expand Down
Loading
Loading