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

M #: Disable automatic updates on deb based systems #71

Merged
merged 1 commit into from
Jul 22, 2024
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ __pycache__/
!/inventory/evpn-ha.yml
/.env.yml
/poetry.lock
.vscode
9 changes: 5 additions & 4 deletions roles/helper/cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ N/A
Role Variables
--------------

| Name | Type | Default | Example | Description |
|--------------------|--------|---------|---------|-------------------------|
| `update_pkg_cache` | `bool` | `false` | `true` | Update APT / DNF cache. |
| Name | Type | Default | Example | Description |
|--------------------|--------|---------|---------|----------------------------------------|
| `update_pkg_cache` | `bool` | `false` | `true` | Update APT / DNF cache. |
| `unattend_disable` | `bool` | `false` | `true` | Purges the unattended upgrade service |

Dependencies
------------
Expand All @@ -25,7 +26,7 @@ Example Playbook

- hosts: frontend:node
roles:
- { role: opennebula.deploy.helper.cache, update_pkg_cache: true }
- { role: opennebula.deploy.helper.cache, update_pkg_cache: true, unattend_disable: true }

License
-------
Expand Down
1 change: 1 addition & 0 deletions roles/helper/cache/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
update_pkg_cache: false
unattend_disable: false
9 changes: 9 additions & 0 deletions roles/helper/cache/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
---
- name: Purge unattended upgrade service
ansible.builtin.package:
name: unattended-upgrades
state: absent
purge: true
when:
- unattend_disable | bool is true
- ansible_os_family == "Debian"

- name: Update package cache
ansible.builtin.package:
update_cache: true
Expand Down