File tree 5 files changed +56
-0
lines changed
integration/repositories/controls
5 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 13
13
'preferences' : {},
14
14
'remove_preferences' : false ,
15
15
'clean_preferences_d' : false ,
16
+ 'keyrings_dir' : '/etc/apt/keyrings' ,
17
+ 'clean_keyrings_d' : false ,
16
18
'remove_apt_conf' : false ,
17
19
'clean_apt_conf_d' : false ,
18
20
'apt_conf_d' : {},
52
54
'preferences' : {},
53
55
'remove_preferences' : false ,
54
56
'clean_preferences_d' : false ,
57
+ 'keyrings_dir' : '/etc/apt/keyrings' ,
58
+ 'clean_keyrings_d' : false ,
55
59
'remove_apt_conf' : false ,
56
60
'clean_apt_conf_d' : false ,
57
61
'apt_conf_d' : {},
Original file line number Diff line number Diff line change 4
4
{% set clean_sources_list_d = apt.get(' clean_sources_list_d' , apt_map.clean_sources_list_d) % }
5
5
{% set sources_list_dir = apt.get(' sources_list_dir' , apt_map.sources_list_dir) % }
6
6
{% set repositories = apt.get(' repositories' , apt_map.repositories) % }
7
+ {% set keyrings_dir = apt.get(' keyrings_dir' , apt_map.keyrings_dir) % }
8
+ {% set clean_keyrings_d = apt.get(' clean_keyrings_d' , apt_map.clean_keyrings_d) % }
7
9
{% set default_url = apt.get(' default_url' , apt_map.default_url) % }
8
10
{% set keyring_package = apt.get(' keyring_package' , apt_map.default_keyring_package) % }
9
11
30
32
- group: root
31
33
- clean: {{ clean_sources_list_d }}
32
34
35
+ {{ keyrings_dir }}:
36
+ file .directory:
37
+ - mode: ' 0755'
38
+ - user: root
39
+ - group: root
40
+ - clean: {{ clean_keyrings_d }}
41
+
33
42
{% for repo, args in repositories.items() % }
34
43
35
44
{% set r_opts = ' ' % }
69
78
the latter will be used. # }
70
79
{% if args.key_url is defined % }
71
80
- key_url: {{ args.key_url }}
81
+ {% if ' signed-by=' in r_opts| lower and args.aptkey is not defined % }
82
+ - aptkey: false
83
+ {% endif % }
72
84
{% elif args.key_text is defined % }
73
85
- key_text: {{ args.key_text }}
74
86
{% elif args.keyid is defined % }
78
90
- clean_file: true
79
91
- refresh: False
80
92
- refresh_db: False
93
+ {% if args.aptkey is defined % }
94
+ - aptkey: {{ args.aptkey }}
95
+ {% endif % }
81
96
- onchanges_in:
82
97
- module: apt.refresh_db
83
98
Original file line number Diff line number Diff line change 14
14
remove_preferences : true
15
15
clean_preferences_d : true
16
16
17
+ keyrings_dir : ' /etc/apt/keyrings'
18
+ clean_keyrings_d : true
19
+
17
20
apt_conf_d :
18
21
30release :
19
22
' APT::Default-Release ' : stable
@@ -126,6 +129,13 @@ apt:
126
129
opts :
127
130
trusted : ' yes'
128
131
another : whatever
132
+ saltstack :
133
+ distro : stable
134
+ url : https://packages.broadcom.com/artifactory/saltproject-deb
135
+ comps : [main]
136
+ type : [binary]
137
+ key_url : https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public # yamllint disable-line rule:line-length
138
+ opts : " signed-by=/etc/apt/keyrings/salt-archive-keyring.pgp"
129
139
130
140
preferences :
131
141
00-rspamd :
Original file line number Diff line number Diff line change 64
64
describe file ( '/etc/apt/sources.list.d/raspbian-binary.list' ) do
65
65
it { should_not exist }
66
66
end
67
+
68
+ describe file ( '/etc/apt/sources.list.d/saltstack.list' ) do
69
+ it { should exist }
70
+ it { should be_owned_by 'root' }
71
+ it { should be_grouped_into 'root' }
72
+ its ( 'mode' ) { should cmp '0644' }
73
+ its ( :content ) do
74
+ should match (
75
+ %r{deb \[ \s ?signed-by=/etc/apt/keyrings/salt-archive-keyring.pgp\s ?\] https://packages.broadcom.com/artifactory/saltproject-deb stable main}
76
+ )
77
+ end
78
+ end
79
+
80
+ describe file ( '/etc/apt/keyrings/salt-archive-keyring.pgp' ) do
81
+ it { should exist }
82
+ it { should be_owned_by 'root' }
83
+ it { should be_grouped_into 'root' }
84
+ its ( 'mode' ) { should cmp '0644' }
85
+ end
67
86
end
Original file line number Diff line number Diff line change 27
27
url : http://archive.raspbian.org/raspbian
28
28
type : [source]
29
29
key_url : https://archive.raspbian.org/raspbian.public.key
30
+ saltstack :
31
+ filename : saltstack.list
32
+ distro : stable
33
+ url : https://packages.broadcom.com/artifactory/saltproject-deb
34
+ comps : [main]
35
+ type : [binary]
36
+ key_url : https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public # yamllint disable-line rule:line-length
37
+ opts : " signed-by=/etc/apt/keyrings/salt-archive-keyring.pgp"
You can’t perform that action at this time.
0 commit comments