Skip to content
Open
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
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ apt_dependencies:
- aptitude
- python3-apt
- python3-pycurl
# do cache update
apt_update: true
# sets the amount of time the cache is valid
apt_cache_valid_time: 3600
# upgrade system: safe | full | dist
Expand All @@ -44,7 +46,10 @@ apt_autoclean: yes
# .deb packages to install.
apt_deb_packages: []

# manage general and periodic entries via template
apt_general_periodic: true
# https://people.debian.org/~hmh/invokerc.d-policyrc.d-specification.txt
# skip config if less than 0 (-1=disable)
apt_policy: 101
# whether or not suggested packages should be installed.
apt_install_suggests: no
Expand Down
2 changes: 2 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
owner: "root"
group: "root"
mode: "0644"
when: apt_general_periodic | bool
with_items:
- "etc/apt/apt.conf.d/10general"
- "etc/apt/apt.conf.d/10periodic"
Expand Down Expand Up @@ -68,3 +69,4 @@
content: "exit {{ apt_policy }}"
dest: /usr/sbin/policy-rc.d
mode: "0755"
when: apt_policy | int >= 0
2 changes: 1 addition & 1 deletion tasks/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

- name: Updating cache
apt:
update_cache: yes
update_cache: "{{ apt_update | bool }}"
cache_valid_time: "{{ apt_cache_valid_time }}"
2 changes: 1 addition & 1 deletion tasks/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
- name: Upgrading system
apt:
upgrade: "{{ apt_upgrade }}"
update_cache: yes
update_cache: "{{ apt_update | bool }}"
autoremove: "{{ apt_autoremove }}"
when: (apt_upgrade == "safe") or (apt_upgrade == "full") or (apt_upgrade == "dist")