apt/tasks/main.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

2018-04-17 15:06:16 +00:00
---
- 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 }}'
...