diff --git a/README.md b/README.md index db5a526..ced9c9c 100644 --- a/README.md +++ b/README.md @@ -188,11 +188,12 @@ configuration. The below variables are used to change the way the role executes in Ansible, particularly with regards to privilege escalation. -| Variable | Description | Default Value | -|-----------------------|----------------------------------------------------------------|---------------| -| `k3s_skip_validation` | Skip all tasks that validate configuration. | `false` | -| `k3s_skip_env_checks` | Skip all tasks that check environment configuration. | `false` | -| `k3s_become` | Escalate user privileges for tasks that need root permissions. | `false` | +| Variable | Description | Default Value | +|------------------------|----------------------------------------------------------------|---------------| +| `k3s_skip_validation` | Skip all tasks that validate configuration. | `false` | +| `k3s_skip_env_checks` | Skip all tasks that check environment configuration. | `false` | +| `k3s_skip_post_checks` | Skip all tasks that check post execution state. | `false` | +| `k3s_become` | Escalate user privileges for tasks that need root permissions. | `false` | #### Important note about Python diff --git a/defaults/main.yml b/defaults/main.yml index dcbc35f..d0766d5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -38,6 +38,9 @@ k3s_skip_validation: false # Skip all tasks that check environment configuration k3s_skip_env_checks: false +# Skip post-checks +k3s_skip_post_checks: false + # Installation directory for k3s k3s_install_dir: /usr/local/bin diff --git a/molecule/highavailabilityetcd/converge.yml b/molecule/highavailabilityetcd/converge.yml index 2762bcb..b227774 100644 --- a/molecule/highavailabilityetcd/converge.yml +++ b/molecule/highavailabilityetcd/converge.yml @@ -13,6 +13,7 @@ node-ip: "{{ ansible_default_ipv4.address }}" snapshotter: native k3s_skip_validation: "{{ k3s_service_handler[ansible_service_mgr] == 'service' }}" + k3s_skip_post_checks: "{{ ansible_os_family | lower == 'redhat' }}" pre_tasks: - name: Set each node to be a control node ansible.builtin.set_fact: diff --git a/tasks/ensure_cluster.yml b/tasks/ensure_cluster.yml index b25f43b..8954b78 100644 --- a/tasks/ensure_cluster.yml +++ b/tasks/ensure_cluster.yml @@ -93,10 +93,14 @@ - not k3s_primary_control_node - import_tasks: post_checks_control_plane.yml - when: not k3s_skip_validation + when: + - not k3s_skip_validation + - not k3s_skip_post_checks - name: Flush Handlers ansible.builtin.meta: flush_handlers - import_tasks: post_checks_nodes.yml - when: not k3s_skip_validation + when: + - not k3s_skip_validation + - not k3s_skip_post_checks diff --git a/tasks/state_uninstalled.yml b/tasks/state_uninstalled.yml index fea45dc..7d15d89 100644 --- a/tasks/state_uninstalled.yml +++ b/tasks/state_uninstalled.yml @@ -7,4 +7,6 @@ - import_tasks: ensure_uninstalled.yml - import_tasks: post_checks_uninstalled.yml - when: not k3s_skip_validation + when: + - not k3s_skip_validation + - not k3s_skip_post_checks