c12s-kubespray/roles/container-engine/cri-o/tasks/main.yaml
chz8494 941aaf93fd
remove duplicate ppa step and replace with circtl package download (#5455)
fix error that crictl package not downloaded before install.
```
TASK [container-engine/cri-o : Install crictl] *********************************
fatal: [more-crab]: FAILED! => {"changed": false, "msg": "Source '/tmp/releases/crictl-v1.16.1-linux-amd64.tar.gz' does not exist"}
```
2020-03-30 01:11:53 -07:00

83 lines
2.1 KiB
YAML

---
- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distribution|lower }}.yml"
- "{{ ansible_os_family|lower }}-{{ ansible_architecture }}.yml"
- "{{ ansible_os_family|lower }}.yml"
- defaults.yml
paths:
- ../vars
skip: true
tags:
- facts
- name: Add OpenShift Origin repository
yum_repository:
name: origin
description: OpenShift Origin Repo
baseurl: "{{ crio_rhel_repo_base_url }}"
gpgcheck: no
when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_atomic
- name: Add CRI-O PPA
apt_repository:
repo: ppa:projectatomic/ppa
state: present
when: ansible_distribution in ["Ubuntu"]
- name: crictl | Download crictl
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.crictl) }}"
- name: Install crictl
unarchive:
src: "{{ local_release_dir }}/crictl-{{ crictl_version }}-linux-{{ image_arch }}.tar.gz"
dest: "/usr/local/bin"
mode: 0755
remote_src: yes
- name: Make sure needed folders exist in the system
with_items:
- /etc/crio
- /etc/containers
file:
path: "{{ item }}"
state: directory
- name: Install cri-o packages
package:
name: "{{ item }}"
state: present
with_items: "{{ crio_packages }}"
- name: Install cri-o config
template:
src: crio.conf.j2
dest: /etc/crio/crio.conf
- name: Copy mounts.conf
copy:
src: mounts.conf
dest: /etc/containers/mounts.conf
when:
- ansible_os_family == 'RedHat'
- name: Create directory for oci hooks
file:
path: /etc/containers/oci/hooks.d
state: directory
owner: root
mode: 0755
- name: Install cri-o service
service:
name: "{{ crio_service }}"
enabled: yes
state: restarted