2018-08-09 17:53:11 +00:00
|
|
|
---
|
2018-08-28 11:48:37 +00:00
|
|
|
- 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
|
|
|
|
|
2018-08-09 17:53:11 +00:00
|
|
|
- name: Add OpenShift Origin repository
|
|
|
|
yum_repository:
|
|
|
|
name: origin
|
|
|
|
description: OpenShift Origin Repo
|
|
|
|
baseurl: "{{ crio_rhel_repo_base_url }}"
|
|
|
|
gpgcheck: no
|
2018-08-28 11:48:37 +00:00
|
|
|
when: ansible_distribution in ["CentOS","RedHat"] and not is_atomic
|
2018-08-09 17:53:11 +00:00
|
|
|
|
2019-06-29 21:09:20 +00:00
|
|
|
- name: Add CRI-O PPA
|
|
|
|
apt_repository:
|
|
|
|
repo: ppa:projectatomic/ppa
|
|
|
|
state: present
|
|
|
|
when: ansible_distribution in ["Ubuntu"]
|
|
|
|
|
2018-12-18 09:39:25 +00:00
|
|
|
- name: Make sure needed folders exist in the system
|
|
|
|
with_items:
|
|
|
|
- /etc/crio
|
|
|
|
- /etc/containers
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
|
2018-08-28 11:48:37 +00:00
|
|
|
- name: Install cri-o packages
|
2018-08-09 17:53:11 +00:00
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
2018-08-28 11:48:37 +00:00
|
|
|
with_items: "{{ crio_packages }}"
|
2018-08-09 17:53:11 +00:00
|
|
|
|
|
|
|
- name: Install cri-o config
|
|
|
|
template:
|
|
|
|
src: crio.conf.j2
|
|
|
|
dest: /etc/crio/crio.conf
|
|
|
|
|
|
|
|
- name: Copy mounts.conf
|
2018-08-28 11:48:37 +00:00
|
|
|
copy:
|
|
|
|
src: mounts.conf
|
|
|
|
dest: /etc/containers/mounts.conf
|
|
|
|
when:
|
|
|
|
- ansible_os_family == 'RedHat'
|
2018-08-09 17:53:11 +00:00
|
|
|
|
|
|
|
- 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:
|
2018-08-28 11:48:37 +00:00
|
|
|
name: "{{ crio_service }}"
|
2018-08-09 17:53:11 +00:00
|
|
|
enabled: yes
|
|
|
|
state: restarted
|