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
Nest
Puppet
Commits
5e04f6cf
Commit
5e04f6cf
authored
Jun 12, 2021
by
James T. Lee
Browse files
PDK: Fix rubocop violations
parent
9a686706
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
22 additions
and
21 deletions
+22
-21
.fixtures.yml
.fixtures.yml
+1
-0
.rubocop.yml
.rubocop.yml
+1
-0
.sync.yml
.sync.yml
+6
-8
lib/facter/gentoo_news_count.rb
lib/facter/gentoo_news_count.rb
+1
-1
lib/facter/is_container.rb
lib/facter/is_container.rb
+1
-1
lib/facter/machine_id.rb
lib/facter/machine_id.rb
+1
-1
lib/facter/podman_version.rb
lib/facter/podman_version.rb
+2
-2
lib/facter/profile.rb
lib/facter/profile.rb
+5
-5
lib/facter/rpool.rb
lib/facter/rpool.rb
+3
-2
lib/facter/running_live.rb
lib/facter/running_live.rb
+1
-1
No files found.
.fixtures.yml
View file @
5e04f6cf
---
fixtures
:
fixtures
:
forge_modules
:
forge_modules
:
stdlib
:
'
puppetlabs/stdlib'
stdlib
:
'
puppetlabs/stdlib'
...
...
.rubocop.yml
View file @
5e04f6cf
...
@@ -18,6 +18,7 @@ AllCops:
...
@@ -18,6 +18,7 @@ AllCops:
-
"
**/Puppetfile"
-
"
**/Puppetfile"
-
"
**/Vagrantfile"
-
"
**/Vagrantfile"
-
"
**/Guardfile"
-
"
**/Guardfile"
-
lib/puppet/provider/package/cygwin.rb
Layout/LineLength
:
Layout/LineLength
:
Description
:
People have wide screens, use them.
Description
:
People have wide screens, use them.
Max
:
200
Max
:
200
...
...
.sync.yml
View file @
5e04f6cf
# This file can be used to customize the files managed by PDK.
---
#
.rubocop.yml
:
# See https://github.com/puppetlabs/pdk-templates/blob/main/README.md
default_configs
:
# for more information.
AllCops
:
#
Exclude
:
# See https://github.com/puppetlabs/pdk-templates/blob/main/config_defaults.yml
-
'
lib/puppet/provider/package/cygwin.rb'
# for the default values.
---
{}
lib/facter/gentoo_news_count.rb
View file @
5e04f6cf
Facter
.
add
(
'gentoo_news_count'
)
do
Facter
.
add
(
'gentoo_news_count'
)
do
confine
:
osfamily
=>
'Gentoo'
confine
osfamily
:
'Gentoo'
setcode
do
setcode
do
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/eselect news count'
).
to_i
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/eselect news count'
).
to_i
end
end
...
...
lib/facter/is_container.rb
View file @
5e04f6cf
Facter
.
add
(
'is_container'
)
do
Facter
.
add
(
'is_container'
)
do
confine
:
kernel
=>
'Linux'
confine
kernel
:
'Linux'
setcode
do
setcode
do
Facter
.
value
(
:virtual
)
==
'lxc'
or
File
.
exist?
'/run/.containerenv'
Facter
.
value
(
:virtual
)
==
'lxc'
or
File
.
exist?
'/run/.containerenv'
end
end
...
...
lib/facter/machine_id.rb
View file @
5e04f6cf
Facter
.
add
(
'machine_id'
)
do
Facter
.
add
(
'machine_id'
)
do
confine
:
kernel
=>
'Linux'
confine
kernel
:
'Linux'
setcode
do
setcode
do
if
File
.
exist?
(
'/etc/machine-id'
)
if
File
.
exist?
(
'/etc/machine-id'
)
File
.
readlines
(
'/etc/machine-id'
).
map
(
&
:chomp
).
first
File
.
readlines
(
'/etc/machine-id'
).
map
(
&
:chomp
).
first
...
...
lib/facter/podman_version.rb
View file @
5e04f6cf
Facter
.
add
(
'podman_version'
)
do
Facter
.
add
(
'podman_version'
)
do
confine
:
kernel
=>
'Linux'
confine
kernel
:
'Linux'
setcode
do
setcode
do
if
File
.
exist?
(
'/usr/bin/podman'
)
if
File
.
exist?
(
'/usr/bin/podman'
)
$1
if
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/podman --version'
)
=~
/
podman version (\S+)
/
Regexp
.
last_match
(
1
)
if
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/podman --version'
)
=~
%{
podman version (\S+)
}
end
end
end
end
end
end
lib/facter/profile.rb
View file @
5e04f6cf
Facter
.
add
(
'profile'
)
do
Facter
.
add
(
'profile'
)
do
confine
:
osfamily
=>
'Gentoo'
confine
osfamily
:
'Gentoo'
setcode
do
setcode
do
profile
=
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/eselect --brief profile show'
)
profile
=
Facter
::
Core
::
Execution
.
execute
(
'/usr/bin/eselect --brief profile show'
)
case
profile
case
profile
when
%r{nest:(
\S
+)/(
\S
+)/(
\S
+)}
when
%r{nest:(
\S
+)/(
\S
+)/(
\S
+)}
{
:
cpu
=>
$1
,
:
platform
=>
$2
,
:
role
=>
$3
}
{
cpu
:
Regexp
.
last_match
(
1
)
,
platform
:
Regexp
.
last_match
(
2
)
,
role
:
Regexp
.
last_match
(
3
)
}
when
%r{nest:(
\S
+)/(
\S
+)}
when
%r{nest:(
\S
+)/(
\S
+)}
{
:
cpu
=>
$1
,
:
platform
=>
$1
,
:
role
=>
$2
}
{
cpu
:
Regexp
.
last_match
(
1
)
,
platform
:
Regexp
.
last_match
(
1
)
,
role
:
Regexp
.
last_match
(
2
)
}
end
end
end
end
end
end
Facter
.
add
(
'profile'
)
do
Facter
.
add
(
'profile'
)
do
confine
:
osfamily
=>
'windows'
confine
osfamily
:
'windows'
setcode
do
setcode
do
{
:
role
=>
'workstation'
}
{
role
:
'workstation'
}
end
end
end
end
lib/facter/rpool.rb
View file @
5e04f6cf
Facter
.
add
(
'rpool'
)
do
Facter
.
add
(
'rpool'
)
do
confine
:
kernel
=>
'Linux'
confine
kernel
:
'Linux'
setcode
do
setcode
do
hostname
=
Facter
.
value
(
'hostname'
)
hostname
=
Facter
.
value
(
'hostname'
)
if
File
.
exist?
(
'/sbin/zfs'
)
if
File
.
exist?
(
'/sbin/zfs'
)
require
'English'
[
"
#{
hostname
}
/crypt"
,
hostname
].
each
do
|
name
|
[
"
#{
hostname
}
/crypt"
,
hostname
].
each
do
|
name
|
Facter
::
Core
::
Execution
.
execute
(
"/sbin/zfs list
#{
name
}
"
)
Facter
::
Core
::
Execution
.
execute
(
"/sbin/zfs list
#{
name
}
"
)
break
name
if
$
?
==
0
break
name
if
$
CHILD_STATUS
==
0
end
end
else
else
hostname
hostname
...
...
lib/facter/running_live.rb
View file @
5e04f6cf
Facter
.
add
(
'running_live'
)
do
Facter
.
add
(
'running_live'
)
do
confine
:
kernel
=>
'Linux'
confine
kernel
:
'Linux'
setcode
do
setcode
do
Facter
.
value
(
:mountpoints
)[
'/'
][
'device'
]
==
'LiveOS_rootfs'
Facter
.
value
(
:mountpoints
)[
'/'
][
'device'
]
==
'LiveOS_rootfs'
end
end
...
...
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