From 4a02f9d8b5deba9e0d0ab42a0dd09944ea3b4754 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Fri, 7 Jun 2024 09:59:32 +0200 Subject: [PATCH] Set default version to 4.15; add feature to install olm via rpm This commit provides few features related to that project: - added workaround when the version file does not exists, so clean setup of the MicroShift 4.15 was not possible - added a feature to setup the OLM via MicroShift RPM package --- defaults/main.yaml | 9 +++++---- tasks/microshift.yaml | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/defaults/main.yaml b/defaults/main.yaml index ea2ce07..0a7d1da 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -39,10 +39,10 @@ firewalld_rules_permament: true use_copr_microshift: false # The Microshift version that is available in the repository. -microshift_version: 4.14 +microshift_version: 4.15 # Default settings from /etc/microshift/config.yaml.default -# https://github.com/openshift/microshift/blob/release-4.14/packaging/microshift/config.yaml +# https://github.com/openshift/microshift/blob/release-4.15/packaging/microshift/config.yaml microshift_config: {} # apiServer: # advertiseAddress: "" @@ -71,7 +71,7 @@ microshift_config: {} # nodeIP: "" # Default settings from /etc/microshift/lvmd.yaml.default -# https://github.com/openshift/microshift/blob/release-4.14/packaging/microshift/lvmd.yaml +# https://github.com/openshift/microshift/blob/release-4.15/packaging/microshift/lvmd.yaml microshift_lmvd: {} # socket-name: /run/lvmd/lvmd.socket # device-classes: @@ -85,7 +85,7 @@ microshift_lmvd: {} # - "" # Default settings from /etc/microshift/ovn.yaml.default -# https://github.com/openshift/microshift/blob/release-4.14/packaging/microshift/ovn.yaml +# https://github.com/openshift/microshift/blob/release-4.15/packaging/microshift/ovn.yaml microshift_ovn: {} # mtu: 1500 @@ -96,6 +96,7 @@ microshift_ovn: {} # Install the OLM - https://olm.operatorframework.io/ setup_olm: false # https://github.com/operator-framework/operator-lifecycle-manager/releases +microshift_olm_package: true olm_version: "v0.28.0" # Version of the Operator SDK diff --git a/tasks/microshift.yaml b/tasks/microshift.yaml index cd46412..1815f3c 100644 --- a/tasks/microshift.yaml +++ b/tasks/microshift.yaml @@ -24,6 +24,20 @@ notify: Restart Microshift when: not use_copr_microshift +- name: Check if version file exists + become: true + ansible.builtin.stat: + path: /var/lib/microshift/version + register: _microshift_version_file + +- name: "Create a version file if does not exists with version {{ microshift_version }}.0" + become: true + when: not _microshift_version_file.stat.exists + ansible.builtin.copy: + content: | + {{ microshift_version }}.0 + dest: /var/lib/microshift/version + - name: Change Microshift configuration files become: true ansible.builtin.copy: