Move host_architecture to kubespray-defaults (#5811)

The variable is defined in `kubernetes/preinstall` role and used in several roles. Since `kubernetes/preinstall` is not always included when `ansible-playbook` is run with tag selectors (see #5734 for reason), they will fail, or individual roles must copy the same fact definitions (as in #3846). Moving the definition to the always-included `kubespray-defaults` role will resolve the dependency problem.
This commit is contained in:
Xiaodu 2020-03-26 03:58:25 +08:00 committed by GitHub
parent 6ad6609872
commit 63fa406c3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 31 deletions

View file

@ -1,19 +1,4 @@
--- ---
- name: set architecture_groups
set_fact:
architecture_groups:
x86_64: amd64
aarch64: arm64
- name: ansible_architecture_rename
set_fact:
host_architecture: >-
{%- if ansible_architecture in architecture_groups -%}
{{ architecture_groups[ansible_architecture] }}
{%- else -%}
{{ ansible_architecture }}
{% endif %}
- include_tasks: check_certs.yml - include_tasks: check_certs.yml
when: cert_management == "script" when: cert_management == "script"
tags: tags:

View file

@ -1,20 +1,4 @@
--- ---
- name: set architecture_groups
set_fact:
architecture_groups:
x86_64: amd64
aarch64: arm64
armv7l: arm
- name: ansible_architecture_rename
set_fact:
host_architecture: >-
{%- if ansible_architecture in architecture_groups -%}
{{ architecture_groups[ansible_architecture] }}
{%- else -%}
{{ ansible_architecture }}
{% endif %}
- name: Force binaries directory for Container Linux by CoreOS and Flatcar - name: Force binaries directory for Container Linux by CoreOS and Flatcar
set_fact: set_fact:
bin_dir: "/opt/bin" bin_dir: "/opt/bin"

View file

@ -539,3 +539,14 @@ etcd_config_dir: /etc/ssl/etcd
etcd_cert_dir: "{{ etcd_config_dir }}/ssl" etcd_cert_dir: "{{ etcd_config_dir }}/ssl"
typha_enabled: false typha_enabled: false
_host_architecture_groups:
x86_64: amd64
aarch64: arm64
armv7l: arm
host_architecture: >-
{%- if ansible_architecture in _host_architecture_groups -%}
{{ _host_architecture_groups[ansible_architecture] }}
{%- else -%}
{{ ansible_architecture }}
{%- endif -%}