mirror of
https://github.com/luzifer-ansible/apt.git
synced 2024-12-23 09:11:16 +00:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
|
---
|
||
|
|
||
|
- 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 }}'
|
||
|
|
||
|
...
|