Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
puppet-puppet-deleted-2844
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is pending deletion, and will be deleted on
2025-07-24
. Repository and other project resources are read-only.
Show more breadcrumbs
drebs
puppet-puppet-deleted-2844
Commits
c89523ca
Unverified
Commit
c89523ca
authored
Apr 16, 2020
by
Ewoud Kohl van Wijngaarden
Browse files
Options
Downloads
Patches
Plain Diff
Move custom facts to their own file
This is makes it compatible with modulesync
parent
23ad9eab
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/spec_helper.rb
+0
-27
0 additions, 27 deletions
spec/spec_helper.rb
spec/support/facts.rb
+27
-0
27 additions, 0 deletions
spec/support/facts.rb
with
27 additions
and
27 deletions
spec/spec_helper.rb
+
0
−
27
View file @
c89523ca
...
@@ -3,33 +3,6 @@
...
@@ -3,33 +3,6 @@
require
'voxpupuli/test/spec_helper'
require
'voxpupuli/test/spec_helper'
# Rough conversion of grepping in the puppet source:
# grep defaultfor lib/puppet/provider/service/*.rb
add_custom_fact
:service_provider
,
->
(
os
,
facts
)
do
case
facts
[
:osfamily
].
downcase
when
'archlinux'
'systemd'
when
'darwin'
'launchd'
when
'debian'
'systemd'
when
'freebsd'
'freebsd'
when
'gentoo'
'openrc'
when
'openbsd'
'openbsd'
when
'redhat'
facts
[
:operatingsystemrelease
].
to_i
>=
7
?
'systemd'
:
'redhat'
when
'suse'
facts
[
:operatingsystemmajrelease
].
to_i
>=
12
?
'systemd'
:
'redhat'
when
'windows'
'windows'
else
'init'
end
end
def
get_content
(
subject
,
title
)
def
get_content
(
subject
,
title
)
is_expected
.
to
contain_file
(
title
)
is_expected
.
to
contain_file
(
title
)
content
=
subject
.
resource
(
'file'
,
title
).
send
(
:parameters
)[
:content
]
content
=
subject
.
resource
(
'file'
,
title
).
send
(
:parameters
)[
:content
]
...
...
This diff is collapsed.
Click to expand it.
spec/support/facts.rb
0 → 100644
+
27
−
0
View file @
c89523ca
# This fact is provided by puppetlabs-stdlib and uses the actual provider for
# service. A rough conversion of grepping in the puppet source:
# grep defaultfor lib/puppet/provider/service/*.rb
add_custom_fact
:service_provider
,
->
(
os
,
facts
)
do
case
facts
[
:osfamily
].
downcase
when
'archlinux'
'systemd'
when
'darwin'
'launchd'
when
'debian'
'systemd'
when
'freebsd'
'freebsd'
when
'gentoo'
'openrc'
when
'openbsd'
'openbsd'
when
'redhat'
facts
[
:operatingsystemrelease
].
to_i
>=
7
?
'systemd'
:
'redhat'
when
'suse'
facts
[
:operatingsystemmajrelease
].
to_i
>=
12
?
'systemd'
:
'redhat'
when
'windows'
'windows'
else
'init'
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment