Skip to content

Commit

Permalink
feat: add options to apt_keys and apt_repositories
Browse files Browse the repository at this point in the history
closes #22
  • Loading branch information
franklinkim committed Nov 1, 2018
2 parents 1af836f + e78fa86 commit f2ce4e0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,22 @@ Here is a list of all the default variables for this role, which are also availa
# - root
# - foo@dev.null
# apt_keys:
# - keyserver: keyserver.ubuntu.com
# id: 36A1D7869245C8950F966E92D8576A8BA88D21E9
# - id: 473041FA
# file: /tmp/apt.gpg
# data: "{{ lookup('file', 'apt.asc') }}"
# keyring: /etc/apt/trusted.gpg.d/debian.gpg
# keyserver: keyserver.ubuntu.com
# url: https://ftp-master.debian.org/keys/archive-key-6.0.asc
# validate_certs: yes
# state: present
# apt_repositories:
# codename: trusty
# filename: google-chrome
# mode: 0644
# repo: 'ppa:nginx/stable'
# state: present
# update_cache: yes
# sets the amount of time the cache is valid
apt_cache_valid_time: 3600
Expand Down
18 changes: 16 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@
# - root
# - foo@dev.null
# apt_keys:
# - keyserver: keyserver.ubuntu.com
# id: 36A1D7869245C8950F966E92D8576A8BA88D21E9
# - id: 473041FA
# file: /tmp/apt.gpg
# data: "{{ lookup('file', 'apt.asc') }}"
# keyring: /etc/apt/trusted.gpg.d/debian.gpg
# keyserver: keyserver.ubuntu.com
# url: https://ftp-master.debian.org/keys/archive-key-6.0.asc
# validate_certs: yes
# state: present
# apt_repositories:
# codename: trusty
# filename: google-chrome
# mode: 0644
# repo: 'ppa:nginx/stable'
# state: present
# update_cache: yes


# sets the amount of time the cache is valid
apt_cache_valid_time: 3600
Expand Down
2 changes: 1 addition & 1 deletion tasks/keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
keyserver: "{{ item.keyserver | default(omit) }}"
url: "{{ item.url | default(omit) }}"
validate_certs: "{{ item.validate_certs | default(omit) }}"
state: present
state: "{{ item.state | default('present') }}"
with_items: "{{ apt_keys }}"
8 changes: 6 additions & 2 deletions tasks/repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- name: Adding apt repository
apt_repository:
repo: "{{ item }}"
update_cache: yes
codename: "{{ item.codename | default(omit) }}"
filename: "{{ item.filename | default(omit) }}"
mode: "{{ item.mode | default(omit) }}"
repo: "{{ item.repo | default(omit) }}"
state: "{{ item.state | default(omit) }}"
update_cache: "{{ item.update_cache | default('yes') }}"
with_items: "{{ apt_repositories }}"

0 comments on commit f2ce4e0

Please sign in to comment.