diff --git a/roles/crio/defaults/main.yaml b/roles/crio/defaults/main.yaml new file mode 100644 index 0000000..23547c4 --- /dev/null +++ b/roles/crio/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +crio_version: 1.23 diff --git a/roles/crio/tasks/default.yaml b/roles/crio/tasks/default.yaml new file mode 100644 index 0000000..e69de29 diff --git a/roles/crio/tasks/main.yaml b/roles/crio/tasks/main.yaml new file mode 100644 index 0000000..8045911 --- /dev/null +++ b/roles/crio/tasks/main.yaml @@ -0,0 +1,53 @@ +--- +- name: gather os specific variables + include_vars: "{{ lookup('first_found', possible_files) }}" + vars: + possible_files: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - vars + +- name: include os specific tasks + include_tasks: "{{ lookup('first_found', possible_files) }}" + vars: + possible_files: + files: + - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" + - "{{ ansible_distribution }}.yaml" + - "{{ ansible_os_family }}.yaml" + - "default.yaml" + paths: + - tasks + +- name: yum repo (devel:kubic:libcontainers:stable) + yum_repository: + name: devel:kubic:libcontainers:stable + description: "Stable Releases of Upstream github.com/containers packages ({{ crio_os }}) type=rpm-md" + baseurl: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ crio_os }}/" + gpgcheck: yes + gpgkey: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ crio_os }}/repodata/repomd.xml.key" + enabled: yes + +- name: "yum repo (devel:kubic:libcontainers:stable:cri-o:{{ crio_version }})" + yum_repository: + name: "devel_kubic_libcontainers_stable_cri-o_{{ crio_version }}" + description: "devel:kubic:libcontainers:stable:cri-o:{{ crio_version }} ({{ crio_os }})" + baseurl: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/{{ crio_os }}/" + gpgcheck: yes + gpgkey: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/{{ crio_os }}/repodata/repomd.xml.key" + enabled: yes + +- name: install + package: + name: "{{ crio_package_name | default('cri-o') }}" + state: "{{ crio_package_state | default('present') }}" + +- name: manage service + service: + name: "{{ crio_service_name | default('crio') }}" + state: "{{ crio_service_state | default('started') }}" + enabled: "{{ crio_service_enabled | default(true) }}" diff --git a/roles/crio/vars/Rocky.yaml b/roles/crio/vars/Rocky.yaml new file mode 100644 index 0000000..131129c --- /dev/null +++ b/roles/crio/vars/Rocky.yaml @@ -0,0 +1 @@ +crio_os: "CentOS_{{ ansible_distribution_major_version }}"