Skip to content

Commit d7f76f7

Browse files
xshadowt2d
authored andcommitted
Add systemli.apt_prefrences role for tor project key management
1 parent 9c11c8d commit d7f76f7

File tree

6 files changed

+13
-794
lines changed

6 files changed

+13
-794
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
python-version: '3.x'
3030

3131
- name: Install test dependencies.
32-
run: pip3 install ansible-lint molecule[docker] molecule-goss yamllint
32+
run: pip3 install ansible-lint==4.3.7 molecule[docker] molecule-goss yamllint
3333

3434
- name: Run Molecule tests.
3535
run: molecule test -s docker

files/torproject.asc

-771
This file was deleted.

meta/main.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ galaxy_info:
2222
- web
2323
notifications:
2424
webhooks: https://galaxy.ansible.com/api/v1/notifications/
25-
dependencies: []
25+
26+
dependencies:
27+
- role: systemli.apt_repositories
28+
vars:
29+
apt_repositories:
30+
- preset: torproject

molecule/default/requirements.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
- src: systemli.apt_repositories

molecule/docker/molecule.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
role-file: molecule/default/requirements.yml
6+
force: false
47
driver:
58
name: docker
69
platforms:

tasks/main.yml

-21
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@
44
pkg: gnupg
55
update_cache: True
66

7-
- name: Ensure apt_preferences include file for deb.torproject.org is present
8-
copy:
9-
src: apt/preferences.d/deb.torproject.org.pref
10-
dest: /etc/apt/preferences.d/deb.torproject.org.pref
11-
mode: 0644
12-
owner: root
13-
group: root
14-
15-
# required to allow installation of packages from torproject repo
16-
- name: ensure the repository key is present
17-
apt_key:
18-
data: "{{ lookup('file', 'torproject.asc') }}"
19-
state: "{{ onion_tor_apt_state }}"
20-
id: "{{ onion_tor_apt_key_id }}"
21-
22-
- name: ensure the required repository is present
23-
apt_repository:
24-
repo: "deb {{ 'https' if ansible_distribution == 'Debian' and ansible_distribution_major_version|int >= 10 else 'http' }}\
25-
://deb.torproject.org/torproject.org {{ ansible_distribution_release }} main"
26-
mode: 0600
27-
287
- name: ensure tor is installed
298
apt:
309
pkg: tor

0 commit comments

Comments
 (0)