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

Create registries.yaml if k3s_registries.mirrors or k3s_registries.configs are not None #208

Merged
merged 1 commit into from
Jun 17, 2023

Conversation

matteyeux
Copy link
Contributor

Create registries.yaml if k3s_registries.mirrors or k3s_registries.configs are not None

Summary

The task Ensure containerd registries is run when k3s_registries is defined, but k3s_registries is always defined in defaults. This then creates a yaml file with null values for configs and mirrors :

root@deb11:~# cat /etc/rancher/k3s/registries.yaml 
---
configs: null
mirrors: null

It can be problematic if there is already a registries.yaml file present and it's overwritten by the role.

This MR adds a two conditions when importing the task. The task is imported only if k3s_registries.mirrors or k3s_registries.configs are not None. Both values are set to None by default.

Fixes #205

Issue type

  • Bugfix

Test instructions

If registries variable is not set (in the inventory or in a playbook) then the task Ensure containerd registries file exists is skipped and {{ k3s_config_dir }}/registries.yaml is not created.

Acceptance Criteria

Additional Information


@matteyeux matteyeux marked this pull request as ready for review June 1, 2023 12:27
@xanmanning xanmanning merged commit 37cca2e into PyratLabs:main Jun 17, 2023
coolguy1771 referenced this pull request in coolguy1771/home-ops Jun 20, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [xanmanning.k3s](https://togithub.com/PyratLabs/ansible-role-k3s) |
role | patch | `v3.4.1` -> `v3.4.2` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>PyratLabs/ansible-role-k3s (xanmanning.k3s)</summary>

###
[`v3.4.2`](https://togithub.com/PyratLabs/ansible-role-k3s/releases/tag/v3.4.2)

[Compare
Source](https://togithub.com/PyratLabs/ansible-role-k3s/compare/v3.4.1...v3.4.2)

#### What's Changed

- fix: static pods should be deployed to all control nodes by
[@&#8203;onedr0p](https://togithub.com/onedr0p) in
[https://github.com/PyratLabs/ansible-role-k3s/pull/207](https://togithub.com/PyratLabs/ansible-role-k3s/pull/207)
- Create registries.yaml if k3s_registries.mirrors or
k3s_registries.configs are not None by
[@&#8203;matteyeux](https://togithub.com/matteyeux) in
[https://github.com/PyratLabs/ansible-role-k3s/pull/208](https://togithub.com/PyratLabs/ansible-role-k3s/pull/208)

#### New Contributors

- [@&#8203;matteyeux](https://togithub.com/matteyeux) made their first
contribution in
[https://github.com/PyratLabs/ansible-role-k3s/pull/208](https://togithub.com/PyratLabs/ansible-role-k3s/pull/208)

**Full Changelog**:
PyratLabs/ansible-role-k3s@v3.4.1...v3.4.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMjQuNCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: lumiere-bot <98047013+lumiere-bot[bot]@users.noreply.github.com>
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Jul 27, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [xanmanning.k3s](https://github.com/PyratLabs/ansible-role-k3s) | role | minor | `v3.3.1` -> `v3.4.2` |

---

### Release Notes

<details>
<summary>PyratLabs/ansible-role-k3s (xanmanning.k3s)</summary>

### [`v3.4.2`](https://github.com/PyratLabs/ansible-role-k3s/releases/tag/v3.4.2)

[Compare Source](PyratLabs/ansible-role-k3s@v3.4.1...v3.4.2)

#### What's Changed

-   fix: static pods should be deployed to all control nodes by [@&#8203;onedr0p](https://github.com/onedr0p) in PyratLabs/ansible-role-k3s#207
-   Create registries.yaml if k3s_registries.mirrors or k3s_registries.configs are not None by [@&#8203;matteyeux](https://github.com/matteyeux) in PyratLabs/ansible-role-k3s#208

#### New Contributors

-   [@&#8203;matteyeux](https://github.com/matteyeux) made their first contribution in PyratLabs/ansible-role-k3s#208

**Full Changelog**: PyratLabs/ansible-role-k3s@v3.4.1...v3.4.2

### [`v3.4.1`](https://github.com/PyratLabs/ansible-role-k3s/blob/HEAD/CHANGELOG.md#2023-05-17-v341)

[Compare Source](PyratLabs/ansible-role-k3s@v3.4.0...v3.4.1)

##### Notable changes

-   fix: resolve ansible lint warnings and fix molecule tests in github actions

##### Contributors

-   [dbrennand](https://github.com/dbrennand)

***

### [`v3.4.0`](https://github.com/PyratLabs/ansible-role-k3s/blob/HEAD/CHANGELOG.md#2023-03-11-v340)

[Compare Source](PyratLabs/ansible-role-k3s@v3.3.1...v3.4.0)

##### Notable changes

-   refactor: add `until: 1.23.15` to `secrets-encryption` from `k3s_experimental_config` as it is no longer experimental. Fixes [#&#8203;200](PyratLabs/ansible-role-k3s#200).
-   docs(fix): typo in `CONTRIBUTING.md`

##### Contributors

-   [dbrennand](https://github.com/dbrennand)

***

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yMy4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: Nicolas Dufour <[email protected]>
Reviewed-on: https://git.home/nrdufour/home-ops/pulls/11
Co-authored-by: Renovate <[email protected]>
Co-committed-by: Renovate <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k3s_registries always defined
2 participants