add and use common crictl role (#6978)
This commit is contained in:
parent
8331c1f858
commit
878fe80ca3
8 changed files with 31 additions and 48 deletions
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
- name: crictl | Download crictl
|
|
||||||
include_tasks: "../../../download/tasks/download_file.yml"
|
|
||||||
vars:
|
|
||||||
download: "{{ download_defaults | combine(downloads.crictl) }}"
|
|
||||||
|
|
||||||
- name: Install crictl config
|
|
||||||
template:
|
|
||||||
src: ../templates/crictl.yaml.j2 # noqa 404 not in role_path when task is included from download role
|
|
||||||
dest: /etc/crictl.yaml
|
|
||||||
owner: bin
|
|
||||||
mode: 0644
|
|
||||||
|
|
||||||
- name: Copy crictl binary from download dir
|
|
||||||
copy:
|
|
||||||
src: "{{ local_release_dir }}/crictl"
|
|
||||||
dest: "{{ bin_dir }}/crictl"
|
|
||||||
mode: 0755
|
|
||||||
remote_src: true
|
|
||||||
|
|
||||||
- name: Get crictl completion
|
|
||||||
command: "{{ bin_dir }}/crictl completion"
|
|
||||||
changed_when: False
|
|
||||||
register: cri_completion
|
|
||||||
check_mode: False
|
|
||||||
|
|
||||||
- name: Install crictl completion
|
|
||||||
copy:
|
|
||||||
dest: /etc/bash_completion.d/crictl
|
|
||||||
content: "{{ cri_completion.stdout }}"
|
|
||||||
become: True
|
|
|
@ -138,4 +138,5 @@
|
||||||
- ansible_distribution_major_version == "8"
|
- ansible_distribution_major_version == "8"
|
||||||
notify: restart containerd
|
notify: restart containerd
|
||||||
|
|
||||||
- include_tasks: crictl.yml
|
- include_role:
|
||||||
|
name: container-engine/crictl
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
import_tasks: "crio_repo.yml"
|
import_tasks: "crio_repo.yml"
|
||||||
when: crio_add_repos
|
when: crio_add_repos
|
||||||
|
|
||||||
- import_tasks: "crictl.yml"
|
- include_role:
|
||||||
|
name: container-engine/crictl
|
||||||
|
|
||||||
- name: Build a list of crio runtimes with Katacontainers runtimes
|
- name: Build a list of crio runtimes with Katacontainers runtimes
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|
12
roles/container-engine/crictl/handlers/main.yml
Normal file
12
roles/container-engine/crictl/handlers/main.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
- name: Get crictl completion
|
||||||
|
command: "{{ bin_dir }}/crictl completion"
|
||||||
|
changed_when: False
|
||||||
|
register: cri_completion
|
||||||
|
check_mode: false
|
||||||
|
|
||||||
|
- name: Install crictl completion
|
||||||
|
copy:
|
||||||
|
dest: /etc/bash_completion.d/crictl
|
||||||
|
content: "{{ cri_completion.stdout }}"
|
||||||
|
mode: 0644
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
- name: Install crictl config
|
- name: Install crictl config
|
||||||
template:
|
template:
|
||||||
src: ../templates/crictl.yaml.j2 # noqa 404 not in role_path when task is included from download role
|
src: crictl.yaml.j2
|
||||||
dest: /etc/crictl.yaml
|
dest: /etc/crictl.yaml
|
||||||
owner: bin
|
owner: bin
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
@ -17,14 +17,10 @@
|
||||||
dest: "{{ bin_dir }}/crictl"
|
dest: "{{ bin_dir }}/crictl"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
remote_src: true
|
remote_src: true
|
||||||
|
notify:
|
||||||
|
- Get crictl completion
|
||||||
|
- Install crictl completion
|
||||||
|
|
||||||
- name: Get crictl completion
|
- name: Set fact crictl_installed
|
||||||
command: "{{ bin_dir }}/crictl completion"
|
set_fact:
|
||||||
changed_when: False
|
crictl_installed: true
|
||||||
register: cri_completion
|
|
||||||
|
|
||||||
- name: Install crictl completion
|
|
||||||
copy:
|
|
||||||
dest: /etc/bash_completion.d/crictl
|
|
||||||
content: "{{ cri_completion.stdout }}"
|
|
||||||
become: True
|
|
4
roles/container-engine/crictl/tasks/main.yml
Normal file
4
roles/container-engine/crictl/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: install crictĺ
|
||||||
|
include_tasks: crictl.yml
|
||||||
|
when: not crictl_installed | default(false)
|
|
@ -7,10 +7,10 @@
|
||||||
- download
|
- download
|
||||||
- upload
|
- upload
|
||||||
|
|
||||||
- include_tasks: ../../container-engine/containerd/tasks/crictl.yml
|
- name: install crictl
|
||||||
when:
|
import_role:
|
||||||
- not skip_downloads|default(false)
|
name: container-engine/crictl
|
||||||
- container_manager in ['containerd', 'crio']
|
when: not skip_downloads|default(false)
|
||||||
|
|
||||||
- name: download | Get kubeadm binary and list of required images
|
- name: download | Get kubeadm binary and list of required images
|
||||||
include_tasks: prep_kubeadm_images.yml
|
include_tasks: prep_kubeadm_images.yml
|
||||||
|
|
Loading…
Reference in a new issue