Skip to content

Commit 604e1d6

Browse files
committed
add debian support
* seems apt_key has no fingerprints * add gpg-agent for ubuntu * update apt cache * reload autofs service * run config
1 parent 47ee4a9 commit 604e1d6

File tree

6 files changed

+103
-33
lines changed

6 files changed

+103
-33
lines changed

Diff for: meta/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ galaxy_info:
5151
versions:
5252
- 6
5353
- 7
54+
- 8
55+
- name: Ubuntu
56+
versions:
57+
- bionic
5458

5559
galaxy_tags: []
5660
# List tags for your role here, one per line. A tag is a keyword that describes

Diff for: tasks/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
owner: "root"
99
group: "root"
1010
mode: "0644"
11+
register: cvmfs_config_file
1112

1213
- name: Set autofs timeout
1314
ansible.builtin.lineinfile:
@@ -27,3 +28,8 @@
2728
state: "{% if not cvmfs_auto_setup %}mounted{% elif cvmfs_force_unmount %}absent{% endif %}"
2829
when: (not cvmfs_auto_setup) or (cvmfs_force_unmount)
2930
loop: "{{ cvmfs_repositories }}"
31+
32+
# cvmfs-auto-setup package not available for Debian so we have to run it manually...
33+
- name: Configure AutoFS
34+
command: cvmfs_config setup
35+
when: cvmfs_config_file.changed and ansible_os_family == 'Debian'

Diff for: tasks/debian.yml

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,64 @@
1-
2-
---
3-
41
# The CERNVM GPG key is the trust anchor for the secure installation of the CVMFS client.
52
#
63
# The Compute Canada CVMFS GPG key is the trust anchor for the secure distribution of the Compute Canada software stack (and other content), as follows:
74
# - the Compute Canada CVMFS GPG key verifies the authenticity of the computecanada-release RPM
8-
# - the computecanada-release RPM configures a yum repository which distributes the cvmfs-config-computecanada RPM
9-
# - the cvmfs-config-computecanada RPM contains the public CVMFS key for the cvmfs-config.computecanada.ca CVMFS configuration repository
5+
# - the computecanada-release configures an apt repository which distributes the cvmfs-config-computecanada deb
6+
# - the cvmfs-config-computecanada deb contains the public CVMFS key for the cvmfs-config.computecanada.ca CVMFS configuration repository
107
# - the CVMFS configuration repository contains the public CVMFS keys for all other Compute Canada CVMFS repositories
118
# - the other CVMFS repositories contain all Compute Canada software (and other content)
129

10+
- name: Install gpg agent
11+
apt:
12+
name: ['gpg-agent']
13+
1314
- name: Install CernVM GPG key
1415
apt_key:
15-
key: https://cvmrepo.web.cern.ch/cvmrepo/apt/cernvm.gpg
16+
url: https://cvmrepo.web.cern.ch/cvmrepo/apt/cernvm.gpg
1617
state: present
1718
validate_certs: yes
18-
fingerprint: "70B9 8904 8820 8E31 5ED4 5208 230D 389D 8AE4 5CE7"
1919

2020
# Also available at https://git.computecanada.ca/cc-cvmfs-public/cvmfs-config/raw/master/RPM-GPG-KEY-CC-CVMFS-1
2121
- name: Install Compute Canada CVMFS GPG key
2222
apt_key:
23-
key: https://package.computecanada.ca/yum/cc-cvmfs-public/RPM-GPG-KEY-CC-CVMFS-1
23+
url: https://package.computecanada.ca/yum/cc-cvmfs-public/RPM-GPG-KEY-CC-CVMFS-1
2424
state: present
2525
validate_certs: yes
26-
fingerprint: "C0C4 0F04 70A3 6AF2 7CC4 4D5A 3B9F C55A CF21 4CFC"
2726
when: '"cvmfs-config-computecanada" in cvmfs_configuration'
2827

29-
# Target hosts will need internet access anyway to install the actual packages via yum, so we might as well
30-
# install the yum config from the internet as well - if a version is not already installed.
31-
# There is no benefit to abstracting this with the yum_repository module, and doing so would break idempotence
32-
# because these packages update themselves via their own yum repositories.
28+
# Target hosts will need internet access anyway to install the actual packages via apt, so we might as well
29+
# install the apt config from the internet as well - if a version is not already installed.
30+
# There is no benefit to abstracting this with the apt_repository module, and doing so would break idempotence
31+
# because these packages update themselves via their own apt repositories.
3332

3433
- name: Install CernVM apt repository
35-
yum:
36-
name: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
34+
apt:
35+
deb: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
3736
state: present
38-
validate_certs: yes
3937
when: ansible_facts.packages['cvmfs-release'] is not defined
4038

41-
- name: Install Compute Canada apt repository
42-
yum:
43-
name: https://package.computecanada.ca/yum/cc-cvmfs-public/prod/RPM/computecanada-release-latest.noarch.rpm
44-
state: present
45-
validate_certs: yes
39+
# Todo: repository configuration for apt missing
40+
# - name: Install Compute Canada apt repository
41+
# apt:
42+
# name: https://package.computecanada.ca/yum/cc-cvmfs-public/prod/other/computecanada-release-latest.noarch.rpm
43+
# state: present
44+
# validate_certs: yes
45+
# when:
46+
# - '"cvmfs-config-computecanada" in cvmfs_configuration'
47+
# - ansible_facts.packages['computecanada-release'] is not defined
48+
49+
# This task can be removed once the Compute Canada apt repository is configured
50+
- name: Workaround - install compute canada config package directly from URL
51+
apt:
52+
deb: "https://package.computecanada.ca/yum/cc-cvmfs-public/prod/other/cvmfs-config-computecanada-latest.all.deb"
53+
update_cache: true
4654
when:
47-
- '"cvmfs-config-computecanada" in cvmfs_configuration'
48-
- ansible_facts.packages['computecanada-release'] is not defined
55+
- '"cvmfs-config-computecanada" in cvmfs_configuration'
4956

5057
- name: Install other prerequisite packages
51-
yum:
52-
name: [ 'lvm2' ]
58+
apt:
59+
name: ['lvm2']
5360
when: cvmfs_client_configure_storage | bool
5461

55-
5662
- name: Install CVMFS client and configuration packages
57-
yum:
58-
name: "['cvmfs'] + {{ cvmfs_auto_setup_package }} + {{ cvmfs_configuration }}"
59-
vars:
60-
cvmfs_auto_setup_package: "{{ ['cvmfs-auto-setup'] if cvmfs_auto_setup|bool else [] }}"
61-
63+
apt:
64+
name: "['cvmfs'] + {{ cvmfs_configuration }}"

Diff for: tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
check_mode: no
66
tags:
77
- yum
8+
- apt
89

910
- { import_tasks: users.yml, tags: ['cvmfs', 'users'] }
1011
- { import_tasks: storage.yml, tags: ['cvmfs', 'storage'], when: cvmfs_client_configure_storage | bool }
1112
- { import_tasks: redhat.yml, tags: ['cvmfs', 'packages','keys','yum'], when: ansible_os_family == 'RedHat' }
1213
- { import_tasks: debian.yml, tags: ['cvmfs', 'packages','keys','apt'], when: ansible_os_family == 'Debian' }
1314
- { import_tasks: config.yml, tags: ['cvmfs', 'config'] }
1415
- { import_tasks: test.yml, tags: ['cvmfs', 'test'] }
15-

Diff for: tasks/redhat.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
3+
# The CERNVM GPG key is the trust anchor for the secure installation of the CVMFS client.
4+
#
5+
# The Compute Canada CVMFS GPG key is the trust anchor for the secure distribution of the Compute Canada software stack (and other content), as follows:
6+
# - the Compute Canada CVMFS GPG key verifies the authenticity of the computecanada-release RPM
7+
# - the computecanada-release RPM configures a yum repository which distributes the cvmfs-config-computecanada RPM
8+
# - the cvmfs-config-computecanada RPM contains the public CVMFS key for the cvmfs-config.computecanada.ca CVMFS configuration repository
9+
# - the CVMFS configuration repository contains the public CVMFS keys for all other Compute Canada CVMFS repositories
10+
# - the other CVMFS repositories contain all Compute Canada software (and other content)
11+
12+
- name: Install CernVM GPG key
13+
rpm_key:
14+
key: https://cvmrepo.web.cern.ch/cvmrepo/yum/RPM-GPG-KEY-CernVM
15+
state: present
16+
validate_certs: yes
17+
fingerprint: "70B9 8904 8820 8E31 5ED4 5208 230D 389D 8AE4 5CE7"
18+
19+
# Also available at https://git.computecanada.ca/cc-cvmfs-public/cvmfs-config/raw/master/RPM-GPG-KEY-CC-CVMFS-1
20+
- name: Install Compute Canada CVMFS GPG key
21+
rpm_key:
22+
key: https://package.computecanada.ca/yum/cc-cvmfs-public/RPM-GPG-KEY-CC-CVMFS-1
23+
state: present
24+
validate_certs: yes
25+
fingerprint: "C0C4 0F04 70A3 6AF2 7CC4 4D5A 3B9F C55A CF21 4CFC"
26+
when: '"cvmfs-config-computecanada" in cvmfs_configuration'
27+
28+
# Target hosts will need internet access anyway to install the actual packages via yum, so we might as well
29+
# install the yum config from the internet as well - if a version is not already installed.
30+
# There is no benefit to abstracting this with the yum_repository module, and doing so would break idempotence
31+
# because these packages update themselves via their own yum repositories.
32+
33+
- name: Install CernVM yum repository
34+
yum:
35+
name: https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest.noarch.rpm
36+
state: present
37+
validate_certs: yes
38+
when: ansible_facts.packages['cvmfs-release'] is not defined
39+
40+
- name: Install Compute Canada yum repository
41+
yum:
42+
name: https://package.computecanada.ca/yum/cc-cvmfs-public/prod/RPM/computecanada-release-latest.noarch.rpm
43+
state: present
44+
validate_certs: yes
45+
when:
46+
- '"cvmfs-config-computecanada" in cvmfs_configuration'
47+
- ansible_facts.packages['computecanada-release'] is not defined
48+
49+
- name: Install other prerequisite packages
50+
yum:
51+
name: [ 'lvm2' ]
52+
when: cvmfs_client_configure_storage | bool
53+
54+
- name: Install CVMFS client and configuration packages
55+
yum:
56+
name: "['cvmfs'] + {{ cvmfs_auto_setup_package }} + {{ cvmfs_configuration }}"
57+
vars:
58+
cvmfs_auto_setup_package: "{{ ['cvmfs-auto-setup'] if cvmfs_auto_setup|bool else [] }}"

Diff for: tasks/test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
command: /usr/bin/cvmfs_config probe
88
changed_when: false
99
check_mode: no
10-

0 commit comments

Comments
 (0)