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:
Alan Orth 2015-08-22 23:39:22 +03:00
parent c535cce6a5
commit fc586a2297
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
5 changed files with 26 additions and 8 deletions

View File

@ -0,0 +1,2 @@
autoclean -y
upgrade -y -o APT::Get::Show-Upgraded=true

View 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\""

View 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:

View File

@ -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:

View 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 %}