Skip to content

Commit

Permalink
Make use of other keyring
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Dec 10, 2024
1 parent ee35130 commit c2908a6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dest: "{{ r_scripts_install_path }}/{{ item.dest }}"
owner: "{{ r_scripts_install_owner }}"
group: "{{ r_scripts_install_group }}"
mode: 0755
mode: '0755'
with_items:
- src: R-list-installed-packages.j2
dest: R-list-installed-packages
Expand Down
25 changes: 18 additions & 7 deletions tasks/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@
tags:
- r-repository-install-dependencies

- name: repository | add public key
- name: repository | (keyrings) directory | create
ansible.builtin.file:
path: "{{ r_keyring_dst | dirname }}"
state: directory
owner: root
group: root
mode: '0755'
tags:
- r-repository-keyrings-directory-create

- name: repository | (keyring) file | download
ansible.builtin.apt_key:
id: E298A3A825C0D65DFD57CBB651716619E084DAB9
id: "{{ r_keyring_id }}"
keyserver: "{{ apt_key_keyserver | default('keyserver.ubuntu.com') }}"
keyring: "{{ r_keyring_dst }}"
state: present
tags:
- r-repository-public-key
- r-repository-keyring-file-download

- name: repository | add cran-r
- name: repository | add
ansible.builtin.apt_repository:
repo: "{{ item.type }} {{ item.url }}"
state: present
state: "{{ item.state | default('present') }}"
update_cache: true
mode: 0644
with_items: "{{ r_repository }}"
mode: '0644'
with_items: "{{ r_repositories }}"
tags:
- r-repository-add
3 changes: 2 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# test file
---
- hosts: localhost
- name: converge
hosts: localhost
connection: local
become: true
roles:
Expand Down
3 changes: 2 additions & 1 deletion tests/vagrant.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# test file
---
- hosts: all
- name: converge
hosts: all
remote_user: vagrant
become: true
roles:
Expand Down
10 changes: 7 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# vars file
---
r_repository_suffix: "{{ '-cran' + r_version if r_version is version('35', '>=') else '' }}"
r_repository:
r_keyring_id: E298A3A825C0D65DFD57CBB651716619E084DAB9
r_keyring_dst: /usr/share/keyrings/insync.gpg
r_repositories:
- type: "deb [signed-by={{ r_keyring_dst }}]"
url: "{{ r_cran_mirror }}/bin/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }}{{ r_repository_suffix }}/"
- type: deb
url: "{{ r_cran_mirror }}/bin/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }}{{ r_repository_suffix }}/"
state: absent
r_repository_suffix: "{{ '-cran' + r_version if r_version is version('35', '>=') else '' }}"

r_dependencies_pre:
- software-properties-common
- dirmngr
- gpg-agent
- apt-transport-https

r_dependencies:
Expand Down

0 comments on commit c2908a6

Please sign in to comment.