Skip to content

Commit

Permalink
Enable experimental modules when rpm-ostree version >= 2021.9 (kubern…
Browse files Browse the repository at this point in the history
…etes-sigs#8202)

* Enable experimental modules when rpm-ostree version >= 2021.9

* cleanup code
  • Loading branch information
zhengtianbao authored and sakuraiyuta committed Apr 16, 2022
1 parent db98c4d commit 45f1923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roles/container-engine/cri-o/tasks/crio_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@
- repo: "fedora-modular"
section: "fedora-modular"

- name: Enable CRI-O ex module
command: "rpm-ostree ex module enable cri-o:{{ crio_version }}"
become: true
when:
- is_ostree
- ostree_version is defined and ostree_version.stdout is version('2021.9', '>=')

- name: Enable CRI-O module
command: "dnf -y module enable cri-o:{{ crio_version }}"
args:
Expand Down
7 changes: 7 additions & 0 deletions roles/container-engine/cri-o/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
set_fact:
is_ostree: "{{ ostree.stat.exists }}"

- name: get ostree version
shell: "set -o pipefail && rpm-ostree --version | awk -F\\' '/Version/{print $2}'"
args:
executable: /bin/bash
register: ostree_version
when: is_ostree

- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
Expand Down

0 comments on commit 45f1923

Please sign in to comment.