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
87101640
Commit
87101640
authored
May 12, 2021
by
James T. Lee
Browse files
zfs: Decouple main and kmod packages
Closes
#32
parent
c567b92c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
25 deletions
+44
-25
manifests/base.pp
manifests/base.pp
+9
-10
manifests/base/kernel.pp
manifests/base/kernel.pp
+6
-2
manifests/base/portage.pp
manifests/base/portage.pp
+8
-0
manifests/base/zfs.pp
manifests/base/zfs.pp
+7
-1
manifests/lib/package.pp
manifests/lib/package.pp
+14
-2
manifests/tool/buildah.pp
manifests/tool/buildah.pp
+0
-10
No files found.
manifests/base.pp
View file @
87101640
...
@@ -27,6 +27,7 @@ class nest::base {
...
@@ -27,6 +27,7 @@ class nest::base {
contain
'::nest::base::sudo'
contain
'::nest::base::sudo'
contain
'::nest::base::systemd'
contain
'::nest::base::systemd'
contain
'::nest::base::timesyncd'
contain
'::nest::base::timesyncd'
contain
'::nest::base::zfs'
if
$facts
[
'build'
]
in
[
undef
,
'stage2'
,
'stage3'
,
'kernel'
]
{
if
$facts
[
'build'
]
in
[
undef
,
'stage2'
,
'stage3'
,
'kernel'
]
{
contain
'::nest::base::dracut'
contain
'::nest::base::dracut'
...
@@ -34,7 +35,6 @@ class nest::base {
...
@@ -34,7 +35,6 @@ class nest::base {
contain
'::nest::base::fstab'
contain
'::nest::base::fstab'
contain
'::nest::base::kernel'
contain
'::nest::base::kernel'
contain
'::nest::base::plymouth'
contain
'::nest::base::plymouth'
contain
'::nest::base::zfs'
# Rebuild initramfs and reconfigure bootloader after kernel changes
# Rebuild initramfs and reconfigure bootloader after kernel changes
Class
[
'::nest::base::kernel'
]
Class
[
'::nest::base::kernel'
]
...
@@ -46,23 +46,22 @@ class nest::base {
...
@@ -46,23 +46,22 @@ class nest::base {
->
Class
[
'::nest::base::firmware'
]
->
Class
[
'::nest::base::firmware'
]
~>
Class
[
'::nest::base::dracut'
]
~>
Class
[
'::nest::base::dracut'
]
# Rebuild initramfs after ZFS changes
# Dracut liveimg depends on dhcp, pulled in by network class
Class
[
'::nest::base::kernel'
]
Class
[
'::nest::base::network'
]
->
Class
[
'::nest::base::zfs'
]
->
Class
[
'::nest::base::dracut'
]
# Rebuild initramfs after plymouth changes
Class
[
'::nest::base::plymouth'
]
~>
Class
[
'::nest::base::dracut'
]
~>
Class
[
'::nest::base::dracut'
]
# Dracut depends on systemd/console setup
# Dracut depends on systemd/console setup
Class
[
'::nest::base::systemd'
]
Class
[
'::nest::base::systemd'
]
~>
Class
[
'::nest::base::dracut'
]
~>
Class
[
'::nest::base::dracut'
]
# Rebuild initramfs after
plymouth
changes
# Rebuild initramfs after
ZFS
changes
Class
[
'::nest::base::
plymouth
'
]
Class
[
'::nest::base::
zfs
'
]
~>
Class
[
'::nest::base::dracut'
]
~>
Class
[
'::nest::base::dracut'
]
# Dracut liveimg depends on dhcp, pulled in by network class
Class
[
'::nest::base::network'
]
->
Class
[
'::nest::base::dracut'
]
# Bootloaders are host-specific
# Bootloaders are host-specific
if
$facts
[
'build'
]
in
[
undef
,
'stage3'
,
'kernel'
]
{
if
$facts
[
'build'
]
in
[
undef
,
'stage3'
,
'kernel'
]
{
contain
'::nest::base::bootloader'
contain
'::nest::base::bootloader'
...
...
manifests/base/kernel.pp
View file @
87101640
...
@@ -64,11 +64,15 @@ class nest::base::kernel {
...
@@ -64,11 +64,15 @@ class nest::base::kernel {
}
}
~>
~>
exec
{
'module-rebuild'
:
exec
{
'module-rebuild'
:
command
=>
"/usr/bin/emerge --oneshot --usepkg n --jobs
${::nest::concurrency}
--load-average
${::nest::base::portage::loadlimit}
zfs-kmod"
,
command
=>
"/usr/bin/emerge --buildpkg n --usepkg n @module-rebuild"
,
environment
=>
'FEATURES=-buildpkg'
,
timeout
=>
0
,
timeout
=>
0
,
refreshonly
=>
true
,
refreshonly
=>
true
,
}
}
->
nest::lib::package
{
'sys-fs/zfs-kmod'
:
ensure
=>
installed
,
binpkg
=>
false
,
}
Exec
[
'kernel-defconfig'
]
Exec
[
'kernel-defconfig'
]
->
Nest
::
Lib
::
Kconfig
<|
config
==
'/usr/src/linux/.config'
|>
->
Nest
::
Lib
::
Kconfig
<|
config
==
'/usr/src/linux/.config'
|>
...
...
manifests/base/portage.pp
View file @
87101640
...
@@ -130,6 +130,14 @@ class nest::base::portage {
...
@@ -130,6 +130,14 @@ class nest::base::portage {
#
#
# Package environments and properties
# Package environments and properties
#
#
file
{
'/etc/portage/env/no-buildpkg.conf'
:
mode
=>
'0644'
,
owner
=>
'root'
,
group
=>
'root'
,
content
=>
"FEATURES=
\"
-buildpkg
\"\n
"
,
}
# xvid incorrectly passes `-mcpu` as `-mtune` which doesn't accept `+crypto`
# xvid incorrectly passes `-mcpu` as `-mtune` which doesn't accept `+crypto`
$cflags_no_crypto
=
regsubst
(
$facts
[
'portage_cflags'
],
'\+crypto'
,
''
)
$cflags_no_crypto
=
regsubst
(
$facts
[
'portage_cflags'
],
'\+crypto'
,
''
)
if
$cflags_no_crypto
!=
$facts
[
'portage_cflags'
]
{
if
$cflags_no_crypto
!=
$facts
[
'portage_cflags'
]
{
...
...
manifests/base/zfs.pp
View file @
87101640
class
nest::base::zfs
{
class
nest::base::zfs
{
package
{
'sys-fs/zfs'
:
nest::lib::
package
{
'sys-fs/zfs'
:
ensure
=>
installed
,
ensure
=>
installed
,
use
=>
'kernel-builtin'
}
if
defined
(
Class
[
'nest::base::kernel'
])
{
}
}
$zfs_mount_override
=
@
(
EOF
)
$zfs_mount_override
=
@
(
EOF
)
...
@@ -26,6 +30,8 @@ class nest::base::zfs {
...
@@ -26,6 +30,8 @@ class nest::base::zfs {
;
;
}
}
nest::lib::systemd_reload
{
'zfs'
:
}
unless
$facts
[
'is_container'
]
or
$facts
[
'running_live'
]
{
unless
$facts
[
'is_container'
]
or
$facts
[
'running_live'
]
{
exec
{
'zgenhostid'
:
exec
{
'zgenhostid'
:
command
=>
'/sbin/zgenhostid `hostid`'
,
command
=>
'/sbin/zgenhostid `hostid`'
,
...
...
manifests/lib/package.pp
View file @
87101640
define
nest::lib::package
(
define
nest::lib::package
(
Boolean
$binpkg
=
true
,
String
$ensure
=
'installed'
,
String
$ensure
=
'installed'
,
String
$package
=
$name
,
String
$package
=
$name
,
Optional
[
Nest
::
UseFlags
]
$use
=
undef
,
Optional
[
Nest
::
UseFlags
]
$use
=
undef
,
Boolean
$world
=
true
,
Boolean
$world
=
true
,
)
{
)
{
unless
$binpkg
{
package_env
{
$name
:
name
=>
$package
,
env
=>
'no-buildpkg.conf'
,
before
=>
Package
[
$name
],
}
$install_options
=
[{
'--usepkg'
=>
'n'
}]
}
$use_ensure
=
$use
?
{
$use_ensure
=
$use
?
{
undef
=>
'absent'
,
undef
=>
'absent'
,
default
=>
'present'
,
default
=>
'present'
,
...
@@ -16,8 +27,9 @@ define nest::lib::package (
...
@@ -16,8 +27,9 @@ define nest::lib::package (
}
}
package
{
$name
:
package
{
$name
:
ensure
=>
$ensure
,
ensure
=>
$ensure
,
name
=>
$package
,
install_options
=>
$install_options
,
name
=>
$package
,
}
}
if
$world
{
if
$world
{
...
...
manifests/tool/buildah.pp
View file @
87101640
class
nest::tool::buildah
{
class
nest::tool::buildah
{
nest::lib::package_use
{
'sys-fs/zfs'
:
use
=>
'kernel-builtin'
,
}
# Can be used as a storage backend when /dev/zfs
# and CAP_SYS_ADMIN are added to the container
package
{
'sys-fs/zfs'
:
ensure
=>
installed
,
}
package_accept_keywords
{
'app-emulation/skopeo'
:
package_accept_keywords
{
'app-emulation/skopeo'
:
version
=>
'=1.1.1'
,
version
=>
'=1.1.1'
,
}
}
...
...
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