Skip to content

Commit c240d11

Browse files
evgeniclaude
andcommitted
Use ansible_facts dict instead of top level facts
This fixes the massive amount of warnings Ansible has been raising. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 16b9b83 commit c240d11

69 files changed

Lines changed: 135 additions & 135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pipelines/candlepin/03-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
beaker_puppet_module: "puppet-candlepin"
1515
beaker_os: "{{ pipeline_os.replace('-stream', '') }}"
1616
beaker_environment:
17-
BEAKER_FACTER_CANDLEPIN_BASEURL: "https://stagingyum.theforeman.org/candlepin/{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/x86_64"
17+
BEAKER_FACTER_CANDLEPIN_BASEURL: "https://stagingyum.theforeman.org/candlepin/{{ pipeline_version }}/el{{ ansible_facts['distribution_major_version'] }}/x86_64"

pipelines/foreman_split_puppet.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@
3737
- "--no-enable-foreman-cli"
3838
- "--no-enable-foreman-proxy"
3939
- "--puppet-server true"
40-
- "--puppet-server-foreman-url https://{{ forklift_server_name }}.{{ ansible_domain }}"
40+
- "--puppet-server-foreman-url https://{{ forklift_server_name }}.{{ ansible_facts['domain'] }}"
4141
- "--puppet-server-admin-api-whitelist localhost"
42-
- "--puppet-server-admin-api-whitelist {{ forklift_puppet_name }}.{{ ansible_domain }}"
43-
- "--puppet-server-admin-api-whitelist {{ forklift_proxy_name }}.{{ ansible_domain }}"
42+
- "--puppet-server-admin-api-whitelist {{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}"
43+
- "--puppet-server-admin-api-whitelist {{ forklift_proxy_name }}.{{ ansible_facts['domain'] }}"
4444
- "--puppet-server-ca-client-whitelist localhost"
45-
- "--puppet-server-ca-client-whitelist {{ forklift_puppet_name }}.{{ ansible_domain }}"
46-
- "--puppet-server-ca-client-whitelist {{ forklift_proxy_name }}.{{ ansible_domain }}"
47-
- "--puppet-autosign-entries {{ forklift_server_name }}.{{ ansible_domain }}"
48-
- "--puppet-autosign-entries {{ forklift_proxy_name }}.{{ ansible_domain }}"
45+
- "--puppet-server-ca-client-whitelist {{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}"
46+
- "--puppet-server-ca-client-whitelist {{ forklift_proxy_name }}.{{ ansible_facts['domain'] }}"
47+
- "--puppet-autosign-entries {{ forklift_server_name }}.{{ ansible_facts['domain'] }}"
48+
- "--puppet-autosign-entries {{ forklift_proxy_name }}.{{ ansible_facts['domain'] }}"
4949

50-
# TODO: set foreman's trusted hosts to [{{ forklift_puppet_name }}.{{ ansible_domain }}]
50+
# TODO: set foreman's trusted hosts to [{{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}]
5151
- hosts: "{{ forklift_server_name }}"
5252
become: yes
5353
vars_files:
@@ -58,7 +58,7 @@
5858
scenario_os: "{{ pipeline_os }}"
5959
scenario_version: "{{ pipeline_version }}"
6060
- role: puppet_agent
61-
puppet_agent_bootstrap_server: "{{ forklift_puppet_name }}.{{ ansible_domain }}"
61+
puppet_agent_bootstrap_server: "{{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}"
6262
- role: foreman_installer
6363
foreman_installer_options_internal_use_only:
6464
- "--enable-foreman"
@@ -79,7 +79,7 @@
7979
scenario_os: "{{ pipeline_os }}"
8080
scenario_version: "{{ pipeline_version }}"
8181
- role: puppet_agent
82-
puppet_agent_bootstrap_server: "{{ forklift_puppet_name }}.{{ ansible_domain }}"
82+
puppet_agent_bootstrap_server: "{{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}"
8383
- role: foreman_installer
8484
foreman_installer_options_internal_use_only:
8585
- "--no-enable-foreman"
@@ -90,15 +90,15 @@
9090
- "--foreman-proxy-tftp false"
9191
- "--foreman-proxy-puppet true"
9292
- "--foreman-proxy-puppetca true"
93-
- "--foreman-proxy-puppet-url https://{{ forklift_puppet_name }}.{{ ansible_domain }}:8140"
94-
- "--foreman-proxy-foreman-base-url https://{{ forklift_server_name }}.{{ ansible_domain }}"
93+
- "--foreman-proxy-puppet-url https://{{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}:8140"
94+
- "--foreman-proxy-foreman-base-url https://{{ forklift_server_name }}.{{ ansible_facts['domain'] }}"
9595
- "--foreman-proxy-oauth-consumer-key oauth-key"
9696
- "--foreman-proxy-oauth-consumer-secret oauth-secret"
97-
- "--foreman-proxy-trusted-hosts {{ forklift_proxy_name }}.{{ ansible_domain }}"
98-
- "--foreman-proxy-trusted-hosts {{ forklift_server_name }}.{{ ansible_domain }}"
97+
- "--foreman-proxy-trusted-hosts {{ forklift_proxy_name }}.{{ ansible_facts['domain'] }}"
98+
- "--foreman-proxy-trusted-hosts {{ forklift_server_name }}.{{ ansible_facts['domain'] }}"
9999
- "--enable-puppet"
100100
- "--puppet-server false"
101-
- "--puppet-puppetmaster {{ forklift_puppet_name }}.{{ ansible_domain }}"
101+
- "--puppet-puppetmaster {{ forklift_puppet_name }}.{{ ansible_facts['domain'] }}"
102102

103103
- hosts: "{{ forklift_puppet_name }}"
104104
become: yes

pipelines/install/04-install_proxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
foreman_installer_options_internal_use_only:
1212
- "--certs-tar-file {{ foreman_proxy_content_certs_tar }}"
1313
- "--foreman-proxy-trusted-hosts {{ server_fqdn }}"
14-
- "--foreman-proxy-trusted-hosts {{ ansible_nodename }}"
14+
- "--foreman-proxy-trusted-hosts {{ ansible_facts['nodename'] }}"
1515
- "--foreman-proxy-foreman-base-url https://{{ server_fqdn }}"
1616
- "--foreman-proxy-oauth-consumer-key {{ oauth_consumer_key }}"
1717
- "--foreman-proxy-oauth-consumer-secret {{ oauth_consumer_secret }}"

pipelines/pulpcore/03-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
beaker_puppet_module: "puppet-pulpcore"
1515
beaker_os: "{{ pipeline_os.replace('-stream', '') }}"
1616
beaker_environment:
17-
BEAKER_FACTER_PULPCORE_BASEURL: "https://stagingyum.theforeman.org/pulpcore/{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/x86_64"
17+
BEAKER_FACTER_PULPCORE_BASEURL: "https://stagingyum.theforeman.org/pulpcore/{{ pipeline_version }}/el{{ ansible_facts['distribution_major_version'] }}/x86_64"
1818
BEAKER_FACTER_PULPCORE_VERSION: "{{ pipeline_version }}"

pipelines/upgrade/04-install_proxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
foreman_installer_options_internal_use_only:
1111
- "--certs-tar-file {{ foreman_proxy_content_certs_tar }}"
1212
- "--foreman-proxy-trusted-hosts {{ server_fqdn }}"
13-
- "--foreman-proxy-trusted-hosts {{ ansible_nodename }}"
13+
- "--foreman-proxy-trusted-hosts {{ ansible_facts['nodename'] }}"
1414
- "--foreman-proxy-foreman-base-url https://{{ server_fqdn }}"
1515
- "--foreman-proxy-oauth-consumer-key {{ oauth_consumer_key }}"
1616
- "--foreman-proxy-oauth-consumer-secret {{ oauth_consumer_secret }}"

playbooks/foreman_proxy_content.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- '--certs-tar-file "{{ foreman_proxy_content_certs_tar }}"'
1818
- "--foreman-proxy-content-enable-ostree true"
1919
- '--foreman-proxy-trusted-hosts "{{ server_fqdn }}"'
20-
- '--foreman-proxy-trusted-hosts "{{ ansible_nodename }}"'
20+
- "--foreman-proxy-trusted-hosts \"{{ ansible_facts['nodename'] }}\""
2121
- '--foreman-proxy-foreman-base-url "https://{{ server_fqdn }}"'
2222
- '--foreman-proxy-register-in-foreman true'
2323
- '--foreman-proxy-oauth-consumer-key "{{ oauth_consumer_key }}"'

playbooks/foreman_proxy_content_dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
- role: etc_hosts
1313
become: true
1414
- role: foreman_proxy_content
15-
foreman_directory: "{{ ansible_user_dir }}/foreman/config/"
15+
foreman_directory: "{{ ansible_facts['user_dir'] }}/foreman/config/"
1616
devel: true
1717
become: true
18-
base_foreman_directory: "{{ ansible_user_dir }}/foreman/"
18+
base_foreman_directory: "{{ ansible_facts['user_dir'] }}/foreman/"
1919
- role: foreman_installer
2020
become: true
2121
foreman_installer_scenario: foreman-proxy-content
@@ -24,7 +24,7 @@
2424
- '--certs-tar-file "{{ foreman_proxy_content_certs_tar }}"'
2525
- "--foreman-proxy-content-enable-ostree true"
2626
- '--foreman-proxy-trusted-hosts "{{ server_fqdn }}"'
27-
- '--foreman-proxy-trusted-hosts "{{ ansible_nodename }}"'
27+
- "--foreman-proxy-trusted-hosts \"{{ ansible_facts['nodename'] }}\""
2828
- '--foreman-proxy-foreman-base-url "https://{{ server_fqdn }}"'
2929
- '--foreman-proxy-register-in-foreman true'
3030
- '--foreman-proxy-oauth-consumer-key "{{ oauth_consumer_key }}"'

playbooks/kubevirt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
state: started
102102

103103
- name: init cluster
104-
command: kubeadm init --pod-network-cidr={{ pod_network }} --apiserver-advertise-address={{ ansible_eth0['ipv4']['address'] }}
104+
command: kubeadm init --pod-network-cidr={{ pod_network }} --apiserver-advertise-address={{ ansible_facts['eth0']['ipv4']['address'] }}
105105
args:
106106
creates: /etc/kubernetes/admin.conf
107107

playbooks/resize_disk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
- name: Install cloud-utils-growpart package
1010
package:
1111
name: cloud-utils-growpart
12-
when: ansible_os_family == 'RedHat'
12+
when: ansible_facts['os_family'] == 'RedHat'
1313

1414
- name: Install cloud-guest-utils package
1515
package:
1616
name: cloud-guest-utils
17-
when: ansible_os_family == 'Debian'
17+
when: ansible_facts['os_family'] == 'Debian'
1818

1919
- name: Install e2fsprogs package
2020
package:

playbooks/setup_forklift.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- hosts: all
1212
vars:
1313
forklift_url: "https://github.com/theforeman/forklift"
14-
forklift_dest: "{{ ansible_env.HOME }}/forklift"
14+
forklift_dest: "{{ ansible_facts['env'].HOME }}/forklift"
1515
forklift_version: master
1616
forklift_install_from_galaxy: True
1717
forklift_install_pulp_from_galaxy: False
@@ -45,7 +45,7 @@
4545
state: 'present'
4646
when:
4747
- forklift_telemetry|default(false)
48-
- ansible_distribution_major_version != '7'
48+
- ansible_facts['distribution_major_version'] != '7'
4949

5050
- name: 'install telemetry dependencies'
5151
become: true
@@ -58,7 +58,7 @@
5858
executable: pip3.11
5959
when:
6060
- forklift_telemetry|default(false)
61-
- ansible_distribution_major_version != '7'
61+
- ansible_facts['distribution_major_version'] != '7'
6262

6363
- name: 'Clone Forklift'
6464
git:

0 commit comments

Comments
 (0)