mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-06-19 13:47:45 -02:30
Replace injected Ansible fact variables in bootstrap_os role (#13264)
* Replace injected Ansible fact variables in bootstrap_os role * Restore stale setup task in opensuse role
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
- name: Add proxy to yum.conf or dnf.conf if http_proxy is defined
|
||||
community.general.ini_file:
|
||||
path: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('/etc/yum.conf', '/etc/dnf/dnf.conf') }}"
|
||||
path: "{{ ((ansible_facts['distribution_major_version'] | int) < 8) | ternary('/etc/yum.conf', '/etc/dnf/dnf.conf') }}"
|
||||
section: main
|
||||
option: proxy
|
||||
value: "{{ http_proxy | default(omit) }}"
|
||||
@@ -20,28 +20,28 @@
|
||||
|
||||
- name: Install EPEL for Oracle Linux repo package
|
||||
package:
|
||||
name: "oracle-epel-release-el{{ ansible_distribution_major_version }}"
|
||||
name: "oracle-epel-release-el{{ ansible_facts['distribution_major_version'] }}"
|
||||
state: present
|
||||
when:
|
||||
- use_oracle_public_repo
|
||||
- '''ID="ol"'' in os_release.stdout_lines'
|
||||
- (ansible_distribution_version | float) >= 7.6
|
||||
- (ansible_facts['distribution_version'] | float) >= 7.6
|
||||
|
||||
- name: Enable Oracle Linux repo
|
||||
community.general.ini_file:
|
||||
dest: "/etc/yum.repos.d/oracle-linux-ol{{ ansible_distribution_major_version }}.repo"
|
||||
section: "ol{{ ansible_distribution_major_version }}_addons"
|
||||
dest: "/etc/yum.repos.d/oracle-linux-ol{{ ansible_facts['distribution_major_version'] }}.repo"
|
||||
section: "ol{{ ansible_facts['distribution_major_version'] }}_addons"
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- { option: "name", value: "ol{{ ansible_distribution_major_version }}_addons" }
|
||||
- { option: "name", value: "ol{{ ansible_facts['distribution_major_version'] }}_addons" }
|
||||
- { option: "enabled", value: "1" }
|
||||
- { option: "baseurl", value: "http://yum.oracle.com/repo/OracleLinux/OL{{ ansible_distribution_major_version }}/addons/$basearch/" }
|
||||
- { option: "baseurl", value: "http://yum.oracle.com/repo/OracleLinux/OL{{ ansible_facts['distribution_major_version'] }}/addons/$basearch/" }
|
||||
when:
|
||||
- use_oracle_public_repo
|
||||
- '''ID="ol"'' in os_release.stdout_lines'
|
||||
- (ansible_distribution_version | float) >= 7.6
|
||||
- (ansible_facts['distribution_version'] | float) >= 7.6
|
||||
|
||||
- name: Enable Centos extra repo for Oracle Linux
|
||||
community.general.ini_file:
|
||||
@@ -51,15 +51,15 @@
|
||||
value: "{{ item.value }}"
|
||||
mode: "0644"
|
||||
with_items:
|
||||
- { option: "name", value: "CentOS-{{ ansible_distribution_major_version }} - Extras" }
|
||||
- { option: "name", value: "CentOS-{{ ansible_facts['distribution_major_version'] }} - Extras" }
|
||||
- { option: "enabled", value: "1" }
|
||||
- { option: "gpgcheck", value: "0" }
|
||||
- { option: "baseurl", value: "http://mirror.centos.org/centos/{{ ansible_distribution_major_version }}/extras/$basearch/os/" }
|
||||
- { option: "baseurl", value: "http://mirror.centos.org/centos/{{ ansible_facts['distribution_major_version'] }}/extras/$basearch/os/" }
|
||||
when:
|
||||
- use_oracle_public_repo
|
||||
- '''ID="ol"'' in os_release.stdout_lines'
|
||||
- (ansible_distribution_version | float) >= 7.6
|
||||
- (ansible_distribution_version | float) < 9
|
||||
- (ansible_facts['distribution_version'] | float) >= 7.6
|
||||
- (ansible_facts['distribution_version'] | float) < 9
|
||||
|
||||
# CentOS ships with python installed
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
- name: Add proxy to yum.conf or dnf.conf if http_proxy is defined
|
||||
community.general.ini_file:
|
||||
path: "{{ ((ansible_distribution_major_version | int) < 8) | ternary('/etc/yum.conf', '/etc/dnf/dnf.conf') }}"
|
||||
path: "{{ ((ansible_facts['distribution_major_version'] | int) < 8) | ternary('/etc/yum.conf', '/etc/dnf/dnf.conf') }}"
|
||||
section: main
|
||||
option: proxy
|
||||
value: "{{ http_proxy | default(omit) }}"
|
||||
@@ -71,7 +71,7 @@
|
||||
- "rhel-8-for-*-appstream-rpms"
|
||||
state: "{{ 'enabled' if (rhel_enable_repos | bool) else 'disabled' }}"
|
||||
when:
|
||||
- ansible_distribution_major_version == "8"
|
||||
- ansible_facts['distribution_major_version'] == "8"
|
||||
- (not rh_subscription_status.changed) or (rh_subscription_username is defined) or (rh_subscription_org_id is defined)
|
||||
|
||||
- name: Check presence of fastestmirror.conf
|
||||
|
||||
Reference in New Issue
Block a user