Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
suitpuppet
su_apache
Commits
2b3bd9ba
Commit
2b3bd9ba
authored
Sep 08, 2020
by
Adam Lewenberg
Browse files
fix syntax error
parent
2c343dac
Changes
2
Hide whitespace changes
Inline
Side-by-side
manifests/module.pp
View file @
2b3bd9ba
# Enable an Apache module.
# Enable an Apache module. Meant to be used with the
# puppetlabs/apache module.
#
# This uses the a2enmod tool provided by Debian to enable a module with its
# configuration. Example:
...
...
@@ -7,13 +8,12 @@
#
# This infrastructure, and therefore this define, is only available on Debian.
define
su_apache::module
(
$ensure
)
{
define
su_apache::module
(
Enum
[
'present'
,
'absent'
]
$ensure
=
undef
,
)
{
if
(
$::operatingsystem
!=
'debian'
)
and
(
$::operatingsystem
!=
'ubuntu'
)
{
fail
(
"Unsupported su_apache::module operating system
${::operatingsystem}
"
)
}
if
!
(
$ensure
in
[
'present'
,
'absent'
])
{
fail
(
"ensure must be present or absent, not
$ensure
"
)
}
# Set various local variables to keep the exec readable.
$modsdir
=
'/etc/apache2/mods-enabled'
...
...
@@ -31,8 +31,8 @@ define su_apache::module($ensure) {
exec
{
$cmd
:
command
=>
$cmd
,
path
=>
'/usr/sbin:/usr/bin'
,
require
=>
Package
[
'apache'
],
require
=>
Class
[
'apache'
],
unless
=>
"[
$condition
]"
,
notify
=>
Exec
[
'apache
reload
'
];
notify
=>
Class
[
'apache
::service
'
];
}
}
manifests/site.pp
View file @
2b3bd9ba
# Install an Apache site configuration and enable it.
# Install an Apache site configuration and enable it. Meant to be used with the
# puppetlabs/apache module.
#
# This is used for virtual hosts and enables the site with the Apache a2ensite
# tool. Examples:
...
...
@@ -13,9 +14,9 @@
# This infrastructure, and therefore this define, is only available on Debian.
define
su_apache::site
(
Enum
[
'present'
,
'absent'
]
$ensure
=
undef
,
Optional
[
String
]
$source
=
undef
,
Optional
[
String
]
$content
=
undef
,
Enum
[
'present'
,
'absent'
]
$ensure
=
undef
,
Optional
[
String
]
$source
=
undef
,
Optional
[
String
]
$content
=
undef
,
)
{
if
(
$::operatingsystem
!=
'debian'
)
and
(
$::operatingsystem
!=
'ubuntu'
)
{
fail
(
"Unsupported apache::site operating system
${::operatingsystem}
"
)
...
...
@@ -40,7 +41,7 @@ define su_apache::site(
ensure
=>
$ensure
,
source
=>
$source
,
content
=>
$content
,
notify
=>
Class
[
'
su_
apache::service'
],
notify
=>
Class
[
'apache::service'
],
}
# Enable or disable the site, based on the ensure parameter.
...
...
@@ -49,16 +50,16 @@ define su_apache::site(
command
=>
"a2ensite
${site_id}
"
,
path
=>
'/usr/bin:/usr/sbin'
,
creates
=>
"/etc/apache2/sites-enabled/
${site_id}
"
,
require
=>
[
Class
[
'
su_
apache'
],
File
[
$realname
]
],
notify
=>
Class
[
'
su_
apache::service'
],
require
=>
[
Class
[
'apache'
],
File
[
$realname
]
],
notify
=>
Class
[
'apache::service'
],
}
}
elsif
(
$ensure
==
'absent'
)
{
exec
{
"a2dissite
${site_id}
"
:
command
=>
"a2dissite
${site_id}
"
,
unless
=>
"[ ! -e '/etc/apache2/sites-enabled/
${site_id}
' ]"
,
path
=>
'/usr/bin:/usr/sbin'
,
require
=>
Class
[
'
su_
apache'
],
notify
=>
Class
[
'
su_
apache::service'
],
require
=>
Class
[
'apache'
],
notify
=>
Class
[
'apache::service'
],
}
}
}
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