Introduced internal_facts.yml and adapt playbooks to use this (#12492)

This commit is contained in:
vdveldet
2025-08-28 09:11:10 +02:00
committed by GitHub
parent e52e262e78
commit a01e96e21a
7 changed files with 47 additions and 41 deletions

View File

@@ -3,7 +3,7 @@
import_playbook: boilerplate.yml import_playbook: boilerplate.yml
- name: Gather facts - name: Gather facts
import_playbook: facts.yml import_playbook: internal_facts.yml
- name: Prepare for etcd install - name: Prepare for etcd install
hosts: k8s_cluster:etcd hosts: k8s_cluster:etcd

View File

@@ -1,39 +1,6 @@
--- ---
- name: Bootstrap hosts for Ansible - name: Common tasks for every playbooks
hosts: k8s_cluster:etcd:calico_rr import_playbook: boilerplate.yml
strategy: linear
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
gather_facts: false
environment: "{{ proxy_disable_env }}"
roles:
- { role: bootstrap_os, tags: bootstrap_os}
- name: Gather facts - name: Gather facts
hosts: k8s_cluster:etcd:calico_rr import_playbook: internal_facts.yml
gather_facts: false
tags: always
tasks:
- name: Gather and compute network facts
import_role:
name: network_facts
- name: Gather minimal facts
setup:
gather_subset: '!all'
# filter match the following variables:
# ansible_default_ipv4
# ansible_default_ipv6
# ansible_all_ipv4_addresses
# ansible_all_ipv6_addresses
- name: Gather necessary facts (network)
setup:
gather_subset: '!all,!min,network'
filter: "ansible_*_ipv[46]*"
# filter match the following variables:
# ansible_memtotal_mb
# ansible_swaptotal_mb
- name: Gather necessary facts (hardware)
setup:
gather_subset: '!all,!min,hardware'
filter: "ansible_*total_mb"

View File

@@ -0,0 +1,39 @@
---
- name: Bootstrap hosts for Ansible
hosts: k8s_cluster:etcd:calico_rr
strategy: linear
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
gather_facts: false
environment: "{{ proxy_disable_env }}"
roles:
- { role: bootstrap_os, tags: bootstrap_os}
- name: Gather facts
hosts: k8s_cluster:etcd:calico_rr
gather_facts: false
tags: always
tasks:
- name: Gather and compute network facts
import_role:
name: network_facts
- name: Gather minimal facts
setup:
gather_subset: '!all'
# filter match the following variables:
# ansible_default_ipv4
# ansible_default_ipv6
# ansible_all_ipv4_addresses
# ansible_all_ipv6_addresses
- name: Gather necessary facts (network)
setup:
gather_subset: '!all,!min,network'
filter: "ansible_*_ipv[46]*"
# filter match the following variables:
# ansible_memtotal_mb
# ansible_swaptotal_mb
- name: Gather necessary facts (hardware)
setup:
gather_subset: '!all,!min,hardware'
filter: "ansible_*total_mb"

View File

@@ -32,7 +32,7 @@
when: pause_result.user_input | default('yes') != 'yes' when: pause_result.user_input | default('yes') != 'yes'
- name: Gather facts - name: Gather facts
import_playbook: facts.yml import_playbook: internal_facts.yml
when: reset_nodes | default(True) | bool when: reset_nodes | default(True) | bool
- name: Reset node - name: Reset node

View File

@@ -3,7 +3,7 @@
import_playbook: boilerplate.yml import_playbook: boilerplate.yml
- name: Gather facts - name: Gather facts
import_playbook: facts.yml import_playbook: internal_facts.yml
- name: Reset cluster - name: Reset cluster
hosts: etcd:k8s_cluster:calico_rr hosts: etcd:k8s_cluster:calico_rr

View File

@@ -3,7 +3,7 @@
import_playbook: boilerplate.yml import_playbook: boilerplate.yml
- name: Gather facts - name: Gather facts
import_playbook: facts.yml import_playbook: internal_facts.yml
- name: Install etcd - name: Install etcd
vars: vars:

View File

@@ -3,7 +3,7 @@
import_playbook: boilerplate.yml import_playbook: boilerplate.yml
- name: Gather facts - name: Gather facts
import_playbook: facts.yml import_playbook: internal_facts.yml
- name: Download images to ansible host cache via first kube_control_plane node - name: Download images to ansible host cache via first kube_control_plane node
hosts: kube_control_plane[0] hosts: kube_control_plane[0]