Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add pre-checks to avoid failing at a later stage #277

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions ansible/00-check-cluster-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Ensure required options are present
hosts: all
gather_facts: no
vars_files:
- ../cluster.yml
tasks:

- name: Check if `cluster_name` is configured
ansible.builtin.fail:
msg: "`cluster_name` is a mandatory setting, please define it in `cluster.yml`"
when: cluster_name is not defined

- name: Check if `dns_provider` is configured
ansible.builtin.fail:
msg: |-
`dns_provider` is a mandatory setting, please define it in `cluster.yml` with
one of the following values: route53, cloudflare, gcp, azure,transip, hetzner or none
Please check the README.md for most updated list.
when: dns_provider is not defined

- name: Check if `image_pull_secret` is configured
ansible.builtin.fail:
msg: "`image_pull_secret` is a mandatory setting, please define it in `cluster.yml`"
when: image_pull_secret is not defined and image_pull_secret | json_query('auths.quay\.io') | length == 0

- name: Check if `public_domain` is configured
ansible.builtin.fail:
msg: "`public_domain` is a mandatory setting, please define it in `cluster.yml`"
when: public_domain is not defined
5 changes: 0 additions & 5 deletions ansible/02-create-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
- ../cluster.yml

tasks:
- name: Check IPv6 & OpenShift version 4.12 or greater
ansible.builtin.fail:
msg: "Currently, it is not possible to install OpenShift 4.12 with IPv6 enabled with hetzner-ocp4 because of Issue #247"
when: (ip_families is defined and "IPv6" in ip_families) and (openshift_version is defined and openshift_version >= "4.12")

- name: Deploy cluster
import_role:
name: openshift-4-cluster
Expand Down
6 changes: 4 additions & 2 deletions ansible/setup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
- import_playbook: 01-prepare-host.yml
- import_playbook: 02-create-cluster.yml
- ansible.builtin.import_playbook: 00-check-cluster-config.yml
- ansible.builtin.import_playbook: 00-provision-hetzner.yml
- ansible.builtin.import_playbook: 01-prepare-host.yml
- ansible.builtin.import_playbook: 02-create-cluster.yml
5 changes: 5 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# RELEASE NOTES

## 2023-05-13
* Added pre-check routines to avoid failing at a later time
- all parameters which are required have to be provided, otherwise the playbook will fail early.
* Removed blocker for installation of OpenShift 4.12 with IPv6 enabled. Installation is now completing without issues.

## 2023-04-14

* Bump OpenShift version to 4.12.10
Expand Down