Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHEF
cookbooks
debmirror
Commits
da3c7c74
Commit
da3c7c74
authored
Jun 17, 2021
by
Christopher Huhn
🥚
Browse files
Fix complaints from rubocop
parent
9b7b05cb
Changes
3
Show whitespace changes
Inline
Side-by-side
attributes/default.rb
View file @
da3c7c74
...
...
@@ -2,7 +2,8 @@
default_unless
[
'debmirror'
][
'base_dir'
]
=
'/srv/debmirror'
# keyring where debmirror looks for repository keys
default_unless
[
'debmirror'
][
'keyring'
]
=
node
[
'debmirror'
][
'base_dir'
]
+
"/.gnupg/trustedkeys.gpg"
default_unless
[
'debmirror'
][
'keyring'
]
=
node
[
'debmirror'
][
'base_dir'
]
+
'/.gnupg/trustedkeys.gpg'
# the user that runs the scripts:
default_unless
[
'debmirror'
][
'mirrors'
]
=
{}
...
...
recipes/default.rb
View file @
da3c7c74
resources/repository.rb
View file @
da3c7c74
...
...
@@ -23,24 +23,29 @@
property
:arch
,
Array
,
default:
[
'amd64'
]
property
:components
,
Array
,
default:
%w[main]
property
:deb_src
,
[
true
,
false
],
default:
false
property
:distribution
,
Array
,
default:
[
node
[
'lsb'
][
'codename'
]
]
property
:distribution
,
Array
,
default:
[
node
[
'lsb'
][
'codename'
]]
property
:user
,
String
,
default:
node
[
'debmirror'
][
'user'
]
property
:key
,
[
String
,
nil
]
property
:keyring
,
[
String
,
nil
],
default:
node
[
'debmirror'
][
'keyring'
]
property
:server
,
String
,
default:
'deb.debian.org'
property
:proto
,
String
,
default:
'http'
property
:path
,
String
,
default:
"/"
property
:path
,
String
,
default:
'/'
property
:mirror_dir
,
[
String
,
nil
]
property
:options
,
Array
,
default:
[]
property
:script_dir
,
String
,
default:
node
[
'debmirror'
][
'script_dir'
]
property
:rsync_extra
,
[
Array
,
String
,
nil
],
# turn strings into an array, default to ['trace']
coerce:
proc
{
|
x
|
x
.
is_a?
(
String
)
?
Array
[
x
]
:
x
.
nil?
?
%w[trace]
:
x
}
coerce:
proc
{
|
x
|
if
x
.
is_a?
(
String
)
Array
[
x
]
else
x
.
nil?
?
%w[trace]
:
x
end
}
default_action
:add
action
:add
do
# TODO: use ruby-gpgme for key management
if
new_resource
.
key
...
...
@@ -61,7 +66,7 @@ action :add do
" --import <<-EOD
\n
#{
new_resource
.
key
}
\n
EOD"
user
user
# without $HOME gpg tries to create /root/.gnupg :(
environment
(
'HOME'
=>
home
)
environment
(
'HOME'
=>
home
)
# not_if { `gpg --no-default-keyring --keyring #{keyring} --with-colons --fingerprint`match %r{^fpr:+#{fingerpring}:$} }
end
end
...
...
@@ -96,7 +101,7 @@ end
action
:remove
do
file
"
#{
script_dir
}
/
#{
name
}
.sh"
do
action
:
remov
e
action
:
delet
e
end
# TODO: Remove key from keyring?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment