roles/common: Adjust cron-apt stuff
- Don't run the static files as templates - Use a separate playbook for related tasks - Use a template for security.sources.list Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
parent
c535cce6a5
commit
fc586a2297
2
roles/common/files/etc/cron-apt/3-download
Normal file
2
roles/common/files/etc/cron-apt/3-download
Normal file
@ -0,0 +1,2 @@
|
||||
autoclean -y
|
||||
upgrade -y -o APT::Get::Show-Upgraded=true
|
5
roles/common/files/etc/cron-apt/config
Normal file
5
roles/common/files/etc/cron-apt/config
Normal file
@ -0,0 +1,5 @@
|
||||
# Configuration for cron-apt. For further information about the possible
|
||||
# configuration settings see the README file.
|
||||
|
||||
MAILON="never"
|
||||
OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/security.sources.list -o Dir::Etc::SourceParts=\"/dev/null\""
|
12
roles/common/tasks/cron-apt.yml
Normal file
12
roles/common/tasks/cron-apt.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
- name: Configure cron-apt (config)
|
||||
copy: src={{ item.src }} dest={{ item.dest }} mode={{ item.mode }} owner={{ item.owner }} group={{ item.group }}
|
||||
with_items:
|
||||
- { src: 'etc/cron-apt/config', dest: '/etc/cron-apt/config', mode: '0644', owner: 'root', group: 'root' }
|
||||
- { src: 'etc/cron-apt/3-download', dest: '/etc/cron-apt/action.d/3-download', mode: '0644', owner: 'root', group: 'root' }
|
||||
|
||||
- name: Configure cron-apt (security)
|
||||
template: src=security.sources.list.j2 dest=/etc/apt/security.sources.list mode=0644 owner=root group=root
|
||||
|
||||
# vim: set ts=2 sw=2:
|
@ -42,13 +42,7 @@
|
||||
- command-not-found-data
|
||||
- python3-commandnotfound
|
||||
|
||||
- name: Configure cron-apt (config)
|
||||
copy: src=cron-apt/config dest=/etc/cron-apt/config mode=0644 owner=root group=root
|
||||
|
||||
- name: Configure cron-apt (config)
|
||||
copy: src=cron-apt/3-download dest=/etc/cron-apt/action.d/3-download mode=0644 owner=root group=root
|
||||
|
||||
- name: Configure cron-apt (security)
|
||||
copy: src=cron-apt/security.sources.list dest=/etc/apt/security.sources.list mode=0644 owner=root group=root
|
||||
- include: cron-apt.yml
|
||||
tags: cron-apt
|
||||
|
||||
# vim: set sw=2 ts=2:
|
||||
|
5
roles/common/templates/security.sources.list.j2
Normal file
5
roles/common/templates/security.sources.list.j2
Normal file
@ -0,0 +1,5 @@
|
||||
{% if ansible_distribution == 'Ubuntu' %}
|
||||
deb http://security.ubuntu.com/ubuntu {{ ansible_distribution_release }}-security main universe
|
||||
{% elif ansible_distribution == 'Debian' %}
|
||||
deb http://security.debian.org/ {{ ansible_distribution_release }}/updates main
|
||||
{% endif %}
|
Loading…
Reference in New Issue
Block a user