Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lonlone Lee
base
Commits
c16f492c
Commit
c16f492c
authored
Nov 06, 2015
by
Adam Lewenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
puppetclient: add certname option
parent
7df83c33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
NEWS
NEWS
+3
-0
manifests/puppetclient/config.pp
manifests/puppetclient/config.pp
+9
-3
templates/puppetclient/puppet.conf.template.erb
templates/puppetclient/puppet.conf.template.erb
+12
-6
No files found.
NEWS
View file @
c16f492c
...
...
@@ -4,6 +4,9 @@ release/004.056 (2015-11-05)
[
duo
]
New
class
to
load
Duo
code
and
wallet
object
.
(
adamhl
)
[
ssh
]
Add
pam_duo
option
to
enable
Duo
for
ssh
regular
logins
(
adamhl
)
[
puppetclient
]
Add
an
option
to
override
the
certname
in
the
[
agent
]
section
.
release
/
004.055
(
2015
-
10
-
08
)
[
dns
]
Rewrite
base
::
dns
::
cache
so
that
it
uses
dnsmasq
on
jessie
...
...
manifests/puppetclient/config.pp
View file @
c16f492c
...
...
@@ -4,6 +4,11 @@
# replace: set to false if you don't want Puppet to overwrite an existing
# /etc/puppet/puppet.conf.
#
#
# certname: if you need to override the certname in the [agent] section
# puppet.conf file, set it here. For example, on an AWS machine the
# certname will be different than the AWS public IP hostname.
#
# Helper define to generate Puppet configuration files.
define
base::puppetclient::config
(
$ensure
,
...
...
@@ -17,7 +22,8 @@ define base::puppetclient::config(
$replace
=
true
,
$defaultfile
=
'/etc/default/puppet'
,
$is_master
=
false
,
$diff_args
=
'-u'
$diff_args
=
'-u'
,
$certname
=
''
)
{
$ssldir
=
$::osfamily
?
{
...
...
@@ -63,7 +69,7 @@ define base::puppetclient::config(
# 2. Convert the template file into /etc/puppet/puppet.conf.
exec
{
'generate-conf puppet.conf'
:
command
=>
"generate-conf --template
$
template_file
--config
$db_config
--newfile
$puppet_config
"
,
"generate-conf --template
$
{template_file}
--config
${db_config}
--newfile
${puppet_config}
"
,
refreshonly
=>
true
,
subscribe
=>
[
...
...
@@ -90,7 +96,7 @@ define base::puppetclient::config(
}
}
absent
:
{
file
{
$name
:
ensure
=>
absent
}
}
default
:
{
crit
"Invalid ensure value:
$
ensure
"
}
default
:
{
crit
"Invalid ensure value:
$
{ensure}
"
}
}
file
{
$defaultfile
:
...
...
templates/puppetclient/puppet.conf.template.erb
View file @
c16f492c
...
...
@@ -10,14 +10,15 @@
# Puppet 3.
use_directory_environments
=
puppet3
# For the master section
if
(
hostname
=~
/^jimhenson-dev$/
)
then
certname
=
'jimhenson-dev.stanford.edu'
certname
_master
=
'jimhenson-dev.stanford.edu'
elsif
(
hostname
=~
/^jimhenson\d$/
)
then
certname
=
'jimhenson.stanford.edu'
certname
_master
=
'jimhenson.stanford.edu'
elsif
(
hostname
=~
/^puppetservice1-dev$/
)
then
certname
=
'puppetservice1-dev.stanford.edu'
certname
_master
=
'puppetservice1-dev.stanford.edu'
elsif
(
hostname
=~
/^puppetservice\d$/
)
then
certname
=
'puppetservice.stanford.edu'
certname
_master
=
'puppetservice.stanford.edu'
end
# Figure out what Puppetmaster to use
...
...
@@ -63,6 +64,11 @@ server = <%= pserver %>
ca_server =
<%=
pca_server
%>
ca_port = 8141
<%
if
(
@certname
!=
''
)
then
-%>
# We override the certname
certname =
<%=
@certname
%>
<%
end
-%>
# The Puppet environment to use.
environment =
<%=
environment
%>
...
...
@@ -126,8 +132,8 @@ show_diff = true
environmentpath = /srv/puppet
<%
end
-%>
# Use
<%=
certname
%>
for the certificate name
certname =
<%=
certname
%>
# Use
<%=
certname
_master
%>
for the certificate name
certname =
<%=
certname
_master
%>
# We do not want to behave as a CA
ca = false
...
...
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