Added some conditional testing playbooks used for learning
This commit is contained in:
parent
029e30e828
commit
a83635f4bf
@ -21,7 +21,7 @@ all:
|
|||||||
developer2:
|
developer2:
|
||||||
hosts:
|
hosts:
|
||||||
10.221.0.125:
|
10.221.0.125:
|
||||||
kubernetes-dev:
|
kubernetes_dev:
|
||||||
hosts:
|
hosts:
|
||||||
172.16.1.130:
|
172.16.1.130:
|
||||||
172.16.1.131:
|
172.16.1.131:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Reboots linux host and checks status
|
- name: Reboots linux host and checks status
|
||||||
hosts: all
|
hosts: kubernetes_dev
|
||||||
become: yes
|
become: yes
|
||||||
vars_files:
|
vars_files:
|
||||||
- global_vars/main.yml
|
- global_vars/main.yml
|
||||||
|
|||||||
30
dnaclab_linux/testing_version_operations.yaml
Normal file
30
dnaclab_linux/testing_version_operations.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: Testing OS version recognition
|
||||||
|
hosts: all
|
||||||
|
gather_facts: yes
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
become: yes
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- name: Distribution
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ ansible_distribution_version }}"
|
||||||
|
|
||||||
|
- name: Test recognition
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: Bingo!!!
|
||||||
|
when:
|
||||||
|
- ansible_facts["distribution"] == "Ubuntu"
|
||||||
|
- ansible_facts["distribution_version"] == "22.04"
|
||||||
|
|
||||||
|
- name: Apply containerd fix (Ubuntu 22.04 only) - generate base config to fix K8s issue https://github.com/kubernetes/kubernetes/issues/110177
|
||||||
|
ansible.builtin.shell: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- sudo mkdir -p /etc/containerd/
|
||||||
|
- containerd config default | sudo tee /etc/containerd/config.toml
|
||||||
|
- sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml
|
||||||
|
when:
|
||||||
|
- ansible_facts["distribution"] == "Ubuntu"
|
||||||
|
- ansible_facts["distribution_version"] == "22.04"
|
||||||
Loading…
Reference in New Issue
Block a user