Initial version

This commit is contained in:
Knut Ahlers 2018-04-17 17:06:16 +02:00
commit a5fa2bf52d
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 49 additions and 0 deletions

8
defaults/main.yml Normal file
View file

@ -0,0 +1,8 @@
---
apt_keys: []
apt_packages: []
apt_refresh_interval: 86400
apt_repos: []
...

41
tasks/main.yml Normal file
View file

@ -0,0 +1,41 @@
---
- name: Install APT keys
apt_key:
data: '{{ item.data | default(omit) }}'
file: '{{ item.file | default(omit) }}'
id: '{{ item.id | default(omit) }}'
keyserver: '{{ item.keyserver | default(omit) }}'
state: '{{ item.state | default("present") }}'
url: '{{ item.url | default(omit) }}'
with_items: '{{ apt_keys }}'
register: apt_keys_task
- name: Add APT repositories
apt_repository:
codename: '{{ item.codename | default(omit) }}'
repo: '{{ item.repo }}'
state: '{{ item.state | default("present") }}'
update_cache: "no"
with_items: '{{ apt_repos }}'
register: apt_repos_task
- name: Update cache
apt:
update_cache: yes
when: apt_keys_task.changed or apt_repos_task.changed
- name: Install APT packages
apt:
cache_valid_time: '{{ apt_refresh_interval }}'
deb: '{{ item.deb | default(omit) }}'
default_release: '{{ item.default_release | default(omit) }}'
force: '{{ item.force | default("no") }}'
install_recommends: '{{ item.install_recommends | default(omit) }}'
name: '{{ item.name }}'
purge: '{{ item.purge | default("no") }}'
state: '{{ item.state | default("present") }}'
upgrade: '{{ item.upgrade | default(omit) }}'
with_items: '{{ apt_packages }}'
...