mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-06-27 17:38:04 -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
|
- name: Add proxy to yum.conf or dnf.conf if http_proxy is defined
|
||||||
community.general.ini_file:
|
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
|
section: main
|
||||||
option: proxy
|
option: proxy
|
||||||
value: "{{ http_proxy | default(omit) }}"
|
value: "{{ http_proxy | default(omit) }}"
|
||||||
@@ -20,28 +20,28 @@
|
|||||||
|
|
||||||
- name: Install EPEL for Oracle Linux repo package
|
- name: Install EPEL for Oracle Linux repo package
|
||||||
package:
|
package:
|
||||||
name: "oracle-epel-release-el{{ ansible_distribution_major_version }}"
|
name: "oracle-epel-release-el{{ ansible_facts['distribution_major_version'] }}"
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- use_oracle_public_repo
|
- use_oracle_public_repo
|
||||||
- '''ID="ol"'' in os_release.stdout_lines'
|
- '''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
|
- name: Enable Oracle Linux repo
|
||||||
community.general.ini_file:
|
community.general.ini_file:
|
||||||
dest: "/etc/yum.repos.d/oracle-linux-ol{{ ansible_distribution_major_version }}.repo"
|
dest: "/etc/yum.repos.d/oracle-linux-ol{{ ansible_facts['distribution_major_version'] }}.repo"
|
||||||
section: "ol{{ ansible_distribution_major_version }}_addons"
|
section: "ol{{ ansible_facts['distribution_major_version'] }}_addons"
|
||||||
option: "{{ item.option }}"
|
option: "{{ item.option }}"
|
||||||
value: "{{ item.value }}"
|
value: "{{ item.value }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
with_items:
|
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: "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:
|
when:
|
||||||
- use_oracle_public_repo
|
- use_oracle_public_repo
|
||||||
- '''ID="ol"'' in os_release.stdout_lines'
|
- '''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
|
- name: Enable Centos extra repo for Oracle Linux
|
||||||
community.general.ini_file:
|
community.general.ini_file:
|
||||||
@@ -51,15 +51,15 @@
|
|||||||
value: "{{ item.value }}"
|
value: "{{ item.value }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
with_items:
|
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: "enabled", value: "1" }
|
||||||
- { option: "gpgcheck", value: "0" }
|
- { 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:
|
when:
|
||||||
- use_oracle_public_repo
|
- use_oracle_public_repo
|
||||||
- '''ID="ol"'' in os_release.stdout_lines'
|
- '''ID="ol"'' in os_release.stdout_lines'
|
||||||
- (ansible_distribution_version | float) >= 7.6
|
- (ansible_facts['distribution_version'] | float) >= 7.6
|
||||||
- (ansible_distribution_version | float) < 9
|
- (ansible_facts['distribution_version'] | float) < 9
|
||||||
|
|
||||||
# CentOS ships with python installed
|
# CentOS ships with python installed
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
- name: Add proxy to yum.conf or dnf.conf if http_proxy is defined
|
- name: Add proxy to yum.conf or dnf.conf if http_proxy is defined
|
||||||
community.general.ini_file:
|
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
|
section: main
|
||||||
option: proxy
|
option: proxy
|
||||||
value: "{{ http_proxy | default(omit) }}"
|
value: "{{ http_proxy | default(omit) }}"
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
- "rhel-8-for-*-appstream-rpms"
|
- "rhel-8-for-*-appstream-rpms"
|
||||||
state: "{{ 'enabled' if (rhel_enable_repos | bool) else 'disabled' }}"
|
state: "{{ 'enabled' if (rhel_enable_repos | bool) else 'disabled' }}"
|
||||||
when:
|
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)
|
- (not rh_subscription_status.changed) or (rh_subscription_username is defined) or (rh_subscription_org_id is defined)
|
||||||
|
|
||||||
- name: Check presence of fastestmirror.conf
|
- name: Check presence of fastestmirror.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user