Last active
September 26, 2017 17:46
-
-
Save KellerFuchs/6bcca085f232c155f687ecae413831eb to your computer and use it in GitHub Desktop.
Installing apt repos and keys and packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- eval: (ansible) -*- | |
- apt_repository: | |
filename: "{{ item }}" | |
repo: "{{ packages[item].repo | mandatory }}" | |
update_cache: no | |
notify: apt update | |
- apt_key: | |
keyring: "{{ item }}.gpg" | |
id: "{{ packages[item].key.id | mandatory }}" | |
url: "{{ packages[item].key.url }}" | |
when: packages[item].key.url is defined | |
notify: apt update | |
- apt_key: | |
keyring: "{{ item }}.gpg" | |
id: "{{ packages[item].key.id | mandatory }}" | |
keyserver: "{{ packages[item].key.keyserver | default('keys.gnupg.net') }}" | |
when: packages[item].key.url is not defined | |
notify: apt update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- eval: (ansible) -*- | |
- hosts: localhost | |
become: True | |
tasks: | |
- include_vars: | |
name: packages | |
dir: . | |
files_matching: "packages_.*\.yml" | |
- include: apt.yml | |
with_items: "{{ packages.keys() }}" | |
# Force the 'apt update' handler to run now (if necessary at all) | |
- meta: flush_handlers | |
- apt: | |
name: "{{ item }}" | |
state: latest | |
with_items: "{{ packages.keys() | map('extract', packages, 'packages') | sum(start=[]) }}" | |
handlers: | |
- name: apt update | |
apt: update_cache=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cura: | |
repo: deb http://download.alephobjects.com/ao/aodeb {{ ansible_distribution_release }} main | |
key: | |
id: 0xDABF50135F6F1293ED0F60270EB44AD9A71B242A | |
url: http://download.alephobjects.com/ao/aodeb/aokey.pub | |
packages: [ cura ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment