kube: cut config drift and standardize apt repos
This commit is contained in:
		@@ -23,11 +23,6 @@
 | 
			
		||||
      ansible.builtin.shell: update-grub
 | 
			
		||||
      when: grub_defaults.changed
 | 
			
		||||
 | 
			
		||||
    - name: Ensure nfs-common is installed
 | 
			
		||||
      ansible.builtin.apt:
 | 
			
		||||
        name: nfs-common
 | 
			
		||||
        state: present
 | 
			
		||||
 | 
			
		||||
- name: Reconfigure Kubernetes nodes
 | 
			
		||||
  hosts: kubernetes
 | 
			
		||||
  vars:
 | 
			
		||||
@@ -35,35 +30,17 @@
 | 
			
		||||
    CRIO_VERSION: v1.33
 | 
			
		||||
    IP: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
 | 
			
		||||
  tasks:
 | 
			
		||||
    - name: Remove APT packages
 | 
			
		||||
      ansible.builtin.apt:
 | 
			
		||||
        name: "{{ item }}"
 | 
			
		||||
        state: absent
 | 
			
		||||
      loop:
 | 
			
		||||
        - kubelet
 | 
			
		||||
        - kubeadm
 | 
			
		||||
        - kubectl
 | 
			
		||||
 | 
			
		||||
    - name: Delete old repos
 | 
			
		||||
      ansible.builtin.shell: "rm /etc/apt/sources.list.d/kubernetes.list"
 | 
			
		||||
      changed_when: false
 | 
			
		||||
      failed_when: false
 | 
			
		||||
 | 
			
		||||
    - name: Delete old repos
 | 
			
		||||
      ansible.builtin.shell: "rm -rf /etc/apt/sources.list.d/devel*"
 | 
			
		||||
      changed_when: false
 | 
			
		||||
      failed_when: false
 | 
			
		||||
 | 
			
		||||
    - name: Add cri-o apt signing key
 | 
			
		||||
      ansible.builtin.apt_key:
 | 
			
		||||
        url: "https://download.opensuse.org/repositories/isv:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/Release.key"
 | 
			
		||||
        state: present
 | 
			
		||||
      get_url:
 | 
			
		||||
        url: https://download.opensuse.org/repositories/isv:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/Release.key
 | 
			
		||||
        dest: /usr/share/keyrings/cri-o.asc
 | 
			
		||||
        mode: ugo+rw
 | 
			
		||||
 | 
			
		||||
    - name: Add cri-o apt repo
 | 
			
		||||
      ansible.builtin.apt_repository:
 | 
			
		||||
        repo: "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://download.opensuse.org/repositories/isv:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/ /"
 | 
			
		||||
        repo: "deb [signed-by=/usr/share/keyrings/cri-o.asc] https://download.opensuse.org/repositories/isv:/cri-o:/stable:/{{ CRIO_VERSION }}/deb/ /"
 | 
			
		||||
        state: present
 | 
			
		||||
        filename: crio
 | 
			
		||||
        filename: cri-o
 | 
			
		||||
 | 
			
		||||
    - name: Install cri-o and conntrack
 | 
			
		||||
      ansible.builtin.apt:
 | 
			
		||||
@@ -71,7 +48,7 @@
 | 
			
		||||
        state: latest
 | 
			
		||||
      loop:
 | 
			
		||||
        - cri-o
 | 
			
		||||
        - conntrack  
 | 
			
		||||
        - conntrack
 | 
			
		||||
 | 
			
		||||
    - name: Enable crio service
 | 
			
		||||
      ansible.builtin.systemd_service:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user