Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
IPHC-Puppet
yum
Commits
8b52ebe5
Commit
8b52ebe5
authored
Jan 14, 2019
by
Emmanuel Medernach
Browse files
Decoupage du module yum en yum + iphc_packages
parent
94d3462c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
45 deletions
+13
-45
README.md
README.md
+4
-0
manifests/config.pp
manifests/config.pp
+6
-27
manifests/init.pp
manifests/init.pp
+3
-18
No files found.
README.md
View file @
8b52ebe5
## Yum repository management
Configure:
-
yum-cron
-
yum.conf
### Example
File hiera.yaml:
...
...
manifests/config.pp
View file @
8b52ebe5
class
yum::config
{
file
{
$yum::reposdir
:
ensure
=>
directory
,
owner
=>
"root"
,
mode
=>
"0755"
,
}
file
{
"/etc/yum.conf"
:
owner
=>
'root'
,
group
=>
'root'
,
mode
=>
'0644'
,
content
=>
template
(
'yum/yum.conf.erb'
),
}
if
(
is_array
(
$yum::repositories
[
$yum::profile
]))
{
$listofrepos
=
array2hash
(
$yum::repositories
[
$yum::profile
],
$yum::description
)
$newlistofrepos
=
$listofrepos
.
map
|
$key
,
$value
|
{
if
(
has_key
(
$value
,
'descr'
))
{
{
$key
=>
$value
}
}
else
{
{
$key
=>
$value
+
{
'descr'
=>
'Missing descr field in yum::description entry'
}
}
}
}
$newlistofrepos
.
each
|
$repos
|
{
create_resources
(
yumrepo
,
$repos
)
}
}
$yum::groups
.
each
|
$group
|
{
if
(
has_key
(
$yum::grouplist
,
$group
))
{
if
(
$yum::grouplist
[
$group
]
!=
undef
)
{
ensure_packages
([
$yum::grouplist
[
$group
]])
}
}
else
{
notify
{
"Warning: yum group
${group}
is absent from yum::grouplist !"
:}
}
}
if
$yum::autoupdate
{
package
{
"yum-cron"
:
...
...
manifests/init.pp
View file @
8b52ebe5
class
yum
(
$reposdir
,
# Repository directory
$autoupdate
,
$distroversionpackage
,
# distroverpkg variable from yum.conf
$reposdir
=
'/etc/yum.repos.d'
,
# Repository directory
$description
,
# List of all available repositories
$repositories
,
# List of repositories to be installed
$packages
,
# List of packages to install
$profile
,
# Profile type (set of repositories to install)
$autoupdate
=
false
,
$groups
,
# List of package group names
$grouplist
,
# List of package groups
$exclude
=
''
,
)
{
package
{
$packages
:
ensure
=>
'installed'
,
}
file
{
$reposdir
:
ensure
=>
directory
,
owner
=>
"root"
,
mode
=>
"0755"
,
}
include
yum::config
}
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