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

fix(linting): ensure tests pass #194

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
feat(post-checks): add option to skip post-checks
  • Loading branch information
xanmanning committed Sep 2, 2022
commit 21fe3bccbf1bd7237074e61ec717e5c37b879e9b
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions molecule/highavailabilityetcd/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions tasks/ensure_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion tasks/state_uninstalled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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