Skip to content

Commit 1ba9a4d

Browse files
refactor: replace deprecated ansible_* variables with ansible_facts
Replace deprecated ansible_hostname and ansible_architecture variables with their ansible_facts equivalents to follow current Ansible best practices and ensure future compatibility
1 parent b6371e9 commit 1ba9a4d

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

roles/bootstrap/templates/motd.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cat <<'EOF_HEADER'
55
******************************************************************
66
7-
Hello, this is {{ ansible_hostname }}.
7+
Hello, this is {{ ansible_facts['hostname'] }}.
88
99
___________________ _-_
1010
\==============_=_/ ____.---'---`---.____

roles/openbao_agent/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
update_cache: true
88
- name: Set architecture mapping
99
ansible.builtin.set_fact:
10-
openbao_agent_arch: "{{ 'amd64' if ansible_architecture == 'x86_64' else 'arm64' if ansible_architecture == 'aarch64' else ansible_architecture }}"
10+
openbao_agent_arch: "{{ 'amd64' if ansible_facts['architecture'] == 'x86_64' else 'arm64' if ansible_facts['architecture'] == 'aarch64' else ansible_facts['architecture'] }}"
1111
- name: Download OpenBao GPG key
1212
ansible.builtin.get_url:
1313
url: https://openbao.org/assets/openbao-gpg-pub-20240618.asc

roles/teleport_agent/templates/teleport-config.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: v3
22
teleport:
3-
nodename: {{ ansible_hostname }}
3+
nodename: {{ ansible_facts['hostname'] }}
44
data_dir: /var/lib/teleport
55
join_params:
66
token_name: {{ teleport_agent_token }}

0 commit comments

Comments
 (0)