Mikechau datadir#347
Open
aleiner wants to merge 5 commits into
Open
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
The rke2_data_dir ends up being always replaced by the host_rke2_config default if host_rke2_config["data-dir"] is not set.
This change checks to see if data-dir is defined in cluster_rke2_config, group_rke2_config and host_rke2_config, before setting rke2_data_dir. If none of them have data-dir, it will fallback to setting rke2_data_dir to /var/lib/rancher/rke2.
Special notes for your reviewer:
There's probably a more cleaner way to do this like instead of checking for data-dir individually we could combine these vars to create the full rke2_config:
name: Build merged rke2_config
ansible.builtin.set_fact:
rke2_config: >-
{{
(cluster_rke2_config | default({}))
| combine(group_rke2_config | default({}))
| combine(host_rke2_config | default({}))
}}
name: Set rke2_data_dir
ansible.builtin.set_fact:
rke2_data_dir: "{{ rke2_config.get('data-dir', '/var/lib/rancher/rke2') }}"
Testing
(fill-in or delete this section)
Release Notes