Browse Source

Rename bootstrap-os to bootstrap_os

Role names in ansible collections should not have hyphens.
pull/12203/head
Max Gautier 4 months ago
parent
commit
47508d5c6e
Failed to extract signature
38 changed files with 39 additions and 39 deletions
  1. 2
      .gitlab-ci/molecule.yml
  2. 4
      docs/ansible/ansible.md
  3. 4
      docs/operating_systems/bootstrap-os.md
  4. 6
      extra_playbooks/upgrade-only-k8s.yml
  5. 2
      playbooks/facts.yml
  6. 0
      roles/bootstrap_os/defaults/main.yml
  7. 0
      roles/bootstrap_os/files/bootstrap.sh
  8. 0
      roles/bootstrap_os/handlers/main.yml
  9. 0
      roles/bootstrap_os/meta/main.yml
  10. 2
      roles/bootstrap_os/molecule/default/converge.yml
  11. 0
      roles/bootstrap_os/molecule/default/molecule.yml
  12. 0
      roles/bootstrap_os/molecule/default/tests/test_default.py
  13. 0
      roles/bootstrap_os/tasks/amzn.yml
  14. 0
      roles/bootstrap_os/tasks/centos.yml
  15. 0
      roles/bootstrap_os/tasks/clear-linux-os.yml
  16. 0
      roles/bootstrap_os/tasks/debian.yml
  17. 0
      roles/bootstrap_os/tasks/fedora-coreos.yml
  18. 0
      roles/bootstrap_os/tasks/fedora.yml
  19. 0
      roles/bootstrap_os/tasks/flatcar.yml
  20. 0
      roles/bootstrap_os/tasks/main.yml
  21. 0
      roles/bootstrap_os/tasks/openEuler.yml
  22. 0
      roles/bootstrap_os/tasks/opensuse-leap.yml
  23. 0
      roles/bootstrap_os/tasks/opensuse-tumbleweed.yml
  24. 0
      roles/bootstrap_os/tasks/opensuse.yml
  25. 0
      roles/bootstrap_os/tasks/rhel.yml
  26. 0
      roles/bootstrap_os/tasks/ubuntu.yml
  27. 0
      roles/bootstrap_os/vars/fedora-coreos.yml
  28. 0
      roles/bootstrap_os/vars/flatcar.yml
  29. 2
      roles/container-engine/containerd/molecule/default/prepare.yml
  30. 2
      roles/container-engine/cri-dockerd/molecule/default/prepare.yml
  31. 2
      roles/container-engine/cri-o/molecule/default/prepare.yml
  32. 2
      roles/container-engine/gvisor/molecule/default/prepare.yml
  33. 2
      roles/container-engine/kata-containers/molecule/default/prepare.yml
  34. 2
      roles/container-engine/youki/molecule/default/prepare.yml
  35. 8
      roles/kubernetes/preinstall/tasks/0050-create_directories.yml
  36. 8
      roles/kubernetes/preinstall/tasks/0080-system-configurations.yml
  37. 20
      roles/kubernetes/preinstall/tasks/main.yml
  38. 10
      roles/system_packages/tasks/main.yml

2
.gitlab-ci/molecule.yml

@ -37,7 +37,7 @@ molecule:
- container-engine/cri-o - container-engine/cri-o
- adduser - adduser
- bastion-ssh-config - bastion-ssh-config
- bootstrap-os
- bootstrap_os
molecule_full: molecule_full:
allow_failure: true allow_failure: true

4
docs/ansible/ansible.md

@ -62,7 +62,7 @@ The following tags are defined in playbooks:
| aws-ebs-csi-driver | Configuring csi driver: aws-ebs | | aws-ebs-csi-driver | Configuring csi driver: aws-ebs |
| azure-csi-driver | Configuring csi driver: azure | | azure-csi-driver | Configuring csi driver: azure |
| bastion | Setup ssh config for bastion | | bastion | Setup ssh config for bastion |
| bootstrap-os | Anything related to host OS configuration |
| bootstrap_os | Anything related to host OS configuration |
| calico | Network plugin Calico | | calico | Network plugin Calico |
| calico_rr | Configuring Calico route reflector | | calico_rr | Configuring Calico route reflector |
| cert-manager | Configuring certificate manager for K8s | | cert-manager | Configuring certificate manager for K8s |
@ -167,7 +167,7 @@ Example command to filter and apply only DNS configuration tasks and skip
everything else related to host OS configuration and downloading images of containers: everything else related to host OS configuration and downloading images of containers:
```ShellSession ```ShellSession
ansible-playbook -i inventory/sample/hosts.ini cluster.yml --tags preinstall,facts --skip-tags=download,bootstrap-os
ansible-playbook -i inventory/sample/hosts.ini cluster.yml --tags preinstall,facts --skip-tags=download,bootstrap_os
``` ```
And this play only removes the K8s cluster DNS resolver IP from hosts' /etc/resolv.conf files: And this play only removes the K8s cluster DNS resolver IP from hosts' /etc/resolv.conf files:

4
docs/operating_systems/bootstrap-os.md

@ -1,4 +1,4 @@
# bootstrap-os
# bootstrap_os
Bootstrap an Ansible host to be able to run Ansible modules. Bootstrap an Ansible host to be able to run Ansible modules.
@ -49,7 +49,7 @@ Remember to disable fact gathering since Python might not be present on hosts.
gather_facts: false # not all hosts might be able to run modules yet gather_facts: false # not all hosts might be able to run modules yet
roles: roles:
- kubespray_defaults - kubespray_defaults
- bootstrap-os
- bootstrap_os
``` ```
## License ## License

6
extra_playbooks/upgrade-only-k8s.yml

@ -22,12 +22,12 @@
any_errors_fatal: "{{ any_errors_fatal | default(true) }}" any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
gather_facts: false gather_facts: false
vars: vars:
# Need to disable pipelining for bootstrap-os as some systems have requiretty in sudoers set, which makes pipelining
# fail. bootstrap-os fixes this on these systems, so in later plays it can be enabled.
# Need to disable pipelining for bootstrap_os as some systems have requiretty in sudoers set, which makes pipelining
# fail. bootstrap_os fixes this on these systems, so in later plays it can be enabled.
ansible_ssh_pipelining: false ansible_ssh_pipelining: false
roles: roles:
- { role: kubespray_defaults} - { role: kubespray_defaults}
- { role: bootstrap-os, tags: bootstrap-os}
- { role: bootstrap_os, tags: bootstrap_os}
- name: Preinstall - name: Preinstall
hosts: k8s_cluster:etcd:calico_rr hosts: k8s_cluster:etcd:calico_rr

2
playbooks/facts.yml

@ -6,7 +6,7 @@
gather_facts: false gather_facts: false
environment: "{{ proxy_disable_env }}" environment: "{{ proxy_disable_env }}"
roles: roles:
- { role: bootstrap-os, tags: bootstrap-os}
- { role: bootstrap_os, tags: bootstrap_os}
- name: Gather facts - name: Gather facts
hosts: k8s_cluster:etcd:calico_rr hosts: k8s_cluster:etcd:calico_rr

roles/bootstrap-os/defaults/main.yml → roles/bootstrap_os/defaults/main.yml

roles/bootstrap-os/files/bootstrap.sh → roles/bootstrap_os/files/bootstrap.sh

roles/bootstrap-os/handlers/main.yml → roles/bootstrap_os/handlers/main.yml

roles/bootstrap-os/meta/main.yml → roles/bootstrap_os/meta/main.yml

roles/bootstrap-os/molecule/default/converge.yml → roles/bootstrap_os/molecule/default/converge.yml

@ -4,4 +4,4 @@
gather_facts: false gather_facts: false
become: true become: true
roles: roles:
- role: bootstrap-os
- role: bootstrap_os

roles/bootstrap-os/molecule/default/molecule.yml → roles/bootstrap_os/molecule/default/molecule.yml

roles/bootstrap-os/molecule/default/tests/test_default.py → roles/bootstrap_os/molecule/default/tests/test_default.py

roles/bootstrap-os/tasks/amzn.yml → roles/bootstrap_os/tasks/amzn.yml

roles/bootstrap-os/tasks/centos.yml → roles/bootstrap_os/tasks/centos.yml

roles/bootstrap-os/tasks/clear-linux-os.yml → roles/bootstrap_os/tasks/clear-linux-os.yml

roles/bootstrap-os/tasks/debian.yml → roles/bootstrap_os/tasks/debian.yml

roles/bootstrap-os/tasks/fedora-coreos.yml → roles/bootstrap_os/tasks/fedora-coreos.yml

roles/bootstrap-os/tasks/fedora.yml → roles/bootstrap_os/tasks/fedora.yml

roles/bootstrap-os/tasks/flatcar.yml → roles/bootstrap_os/tasks/flatcar.yml

roles/bootstrap-os/tasks/main.yml → roles/bootstrap_os/tasks/main.yml

roles/bootstrap-os/tasks/openEuler.yml → roles/bootstrap_os/tasks/openEuler.yml

roles/bootstrap-os/tasks/opensuse-leap.yml → roles/bootstrap_os/tasks/opensuse-leap.yml

roles/bootstrap-os/tasks/opensuse-tumbleweed.yml → roles/bootstrap_os/tasks/opensuse-tumbleweed.yml

roles/bootstrap-os/tasks/opensuse.yml → roles/bootstrap_os/tasks/opensuse.yml

roles/bootstrap-os/tasks/rhel.yml → roles/bootstrap_os/tasks/rhel.yml

roles/bootstrap-os/tasks/ubuntu.yml → roles/bootstrap_os/tasks/ubuntu.yml

roles/bootstrap-os/vars/fedora-coreos.yml → roles/bootstrap_os/vars/fedora-coreos.yml

roles/bootstrap-os/vars/flatcar.yml → roles/bootstrap_os/vars/flatcar.yml

2
roles/container-engine/containerd/molecule/default/prepare.yml

@ -7,7 +7,7 @@
ignore_assert_errors: true ignore_assert_errors: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: network_facts - role: network_facts
- role: kubernetes/preinstall - role: kubernetes/preinstall
- role: adduser - role: adduser

2
roles/container-engine/cri-dockerd/molecule/default/prepare.yml

@ -4,7 +4,7 @@
become: true become: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: adduser - role: adduser
user: "{{ addusers.kube }}" user: "{{ addusers.kube }}"
tasks: tasks:

2
roles/container-engine/cri-o/molecule/default/prepare.yml

@ -7,7 +7,7 @@
ignore_assert_errors: true ignore_assert_errors: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: network_facts - role: network_facts
- role: kubernetes/preinstall - role: kubernetes/preinstall
- role: adduser - role: adduser

2
roles/container-engine/gvisor/molecule/default/prepare.yml

@ -4,7 +4,7 @@
become: true become: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: adduser - role: adduser
user: "{{ addusers.kube }}" user: "{{ addusers.kube }}"
tasks: tasks:

2
roles/container-engine/kata-containers/molecule/default/prepare.yml

@ -4,7 +4,7 @@
become: true become: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: adduser - role: adduser
user: "{{ addusers.kube }}" user: "{{ addusers.kube }}"
tasks: tasks:

2
roles/container-engine/youki/molecule/default/prepare.yml

@ -4,7 +4,7 @@
become: true become: true
roles: roles:
- role: kubespray_defaults - role: kubespray_defaults
- role: bootstrap-os
- role: bootstrap_os
- role: adduser - role: adduser
user: "{{ addusers.kube }}" user: "{{ addusers.kube }}"
tasks: tasks:

8
roles/kubernetes/preinstall/tasks/0050-create_directories.yml

@ -11,7 +11,7 @@
- kubelet - kubelet
- kube-controller-manager - kube-controller-manager
- kube-apiserver - kube-apiserver
- bootstrap-os
- bootstrap_os
- apps - apps
- network - network
- master # master tag is deprecated and replaced by control-plane - master # master tag is deprecated and replaced by control-plane
@ -35,7 +35,7 @@
- kubelet - kubelet
- kube-controller-manager - kube-controller-manager
- kube-apiserver - kube-apiserver
- bootstrap-os
- bootstrap_os
- apps - apps
- network - network
- master # master tag is deprecated and replaced by control-plane - master # master tag is deprecated and replaced by control-plane
@ -86,7 +86,7 @@
- weave - weave
- kube-ovn - kube-ovn
- kube-router - kube-router
- bootstrap-os
- bootstrap_os
- name: Create calico cni directories - name: Create calico cni directories
file: file:
@ -102,7 +102,7 @@
tags: tags:
- network - network
- calico - calico
- bootstrap-os
- bootstrap_os
- name: Create local volume provisioner directories - name: Create local volume provisioner directories
file: file:

8
roles/kubernetes/preinstall/tasks/0080-system-configurations.yml

@ -20,7 +20,7 @@
- "'Amazon' not in ansible_distribution" - "'Amazon' not in ansible_distribution"
- slc.stat.exists - slc.stat.exists
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Disable IPv6 DNS lookup - name: Disable IPv6 DNS lookup
lineinfile: lineinfile:
@ -34,7 +34,7 @@
- disable_ipv6_dns - disable_ipv6_dns
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] - not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Clean previously used sysctl file locations - name: Clean previously used sysctl file locations
file: file:
@ -52,7 +52,7 @@
get_mime: false get_mime: false
register: sysctl_file_stat register: sysctl_file_stat
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Change sysctl file path to link source if linked - name: Change sysctl file path to link source if linked
set_fact: set_fact:
@ -61,7 +61,7 @@
- sysctl_file_stat.stat.islnk is defined - sysctl_file_stat.stat.islnk is defined
- sysctl_file_stat.stat.islnk - sysctl_file_stat.stat.islnk
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Make sure sysctl file path folder exists - name: Make sure sysctl file path folder exists
file: file:

20
roles/kubernetes/preinstall/tasks/main.yml

@ -32,7 +32,7 @@
- systemd_resolved_enabled.rc != 0 - systemd_resolved_enabled.rc != 0
- networkmanager_enabled.rc != 0 - networkmanager_enabled.rc != 0
tags: tags:
- bootstrap-os
- bootstrap_os
- resolvconf - resolvconf
- name: Apply systemd-resolved settings - name: Apply systemd-resolved settings
@ -42,7 +42,7 @@
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- systemd_resolved_enabled.rc == 0 - systemd_resolved_enabled.rc == 0
tags: tags:
- bootstrap-os
- bootstrap_os
- resolvconf - resolvconf
- name: Apply networkmanager unmanaged devices settings - name: Apply networkmanager unmanaged devices settings
@ -50,7 +50,7 @@
when: when:
- networkmanager_enabled.rc == 0 - networkmanager_enabled.rc == 0
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Apply networkmanager DNS settings - name: Apply networkmanager DNS settings
import_tasks: 0063-networkmanager-dns.yml import_tasks: 0063-networkmanager-dns.yml
@ -59,7 +59,7 @@
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- networkmanager_enabled.rc == 0 - networkmanager_enabled.rc == 0
tags: tags:
- bootstrap-os
- bootstrap_os
- resolvconf - resolvconf
- name: Apply system configurations - name: Apply system configurations
@ -67,7 +67,7 @@
when: when:
- not dns_late - not dns_late
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Configure NTP - name: Configure NTP
import_tasks: 0081-ntp-configurations.yml import_tasks: 0081-ntp-configurations.yml
@ -75,12 +75,12 @@
- not dns_late - not dns_late
- ntp_enabled - ntp_enabled
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Configure /etc/hosts - name: Configure /etc/hosts
import_tasks: 0090-etchosts.yml import_tasks: 0090-etchosts.yml
tags: tags:
- bootstrap-os
- bootstrap_os
- etchosts - etchosts
- name: Configure dhclient - name: Configure dhclient
@ -91,7 +91,7 @@
- dhclientconffile is defined - dhclientconffile is defined
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] - not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags: tags:
- bootstrap-os
- bootstrap_os
- resolvconf - resolvconf
- name: Configure dhclient dhclient hooks - name: Configure dhclient dhclient hooks
@ -102,7 +102,7 @@
- dhclientconffile is defined - dhclientconffile is defined
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] - not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags: tags:
- bootstrap-os
- bootstrap_os
- resolvconf - resolvconf
# We need to make sure the network is restarted early enough so that docker can later pick up the correct system # We need to make sure the network is restarted early enough so that docker can later pick up the correct system
@ -120,7 +120,7 @@
when: when:
- not dns_late - not dns_late
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Run calico checks - name: Run calico checks
include_role: include_role:

10
roles/system_packages/tasks/main.yml

@ -13,14 +13,14 @@
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
when: when:
- ansible_pkg_mgr == 'zypper' - ansible_pkg_mgr == 'zypper'
tags: bootstrap-os
tags: bootstrap_os
- name: Add debian 10 required repos - name: Add debian 10 required repos
when: when:
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_version == "10" - ansible_distribution_version == "10"
tags: tags:
- bootstrap-os
- bootstrap_os
block: block:
- name: Add Debian Backports apt repo - name: Add Debian Backports apt repo
apt_repository: apt_repository:
@ -44,7 +44,7 @@
cache_valid_time: 3600 cache_valid_time: 3600
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Remove legacy docker repo file - name: Remove legacy docker repo file
file: file:
@ -63,7 +63,7 @@
- not is_fedora_coreos - not is_fedora_coreos
- epel_enabled | bool - epel_enabled | bool
tags: tags:
- bootstrap-os
- bootstrap_os
- name: Install packages requirements - name: Install packages requirements
package: package:
@ -75,4 +75,4 @@
delay: "{{ retry_stagger | random + 3 }}" delay: "{{ retry_stagger | random + 3 }}"
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos) when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos)
tags: tags:
- bootstrap-os
- bootstrap_os
Loading…
Cancel
Save