Skip to content

add set_noop parameter #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Optionally to install the Puppet agent with a certname other than the fqdn of th
Optionally to install the puppet-agent with a specific environment other than the default environment `production`, specify the custom environment:
`bolt task run bootstrap::linux master=<master's fqdn> environment=<custom environment> --nodes x,y,z --modulepath /path/to/modules`

#### Example: Specify noop

Optionally to install the puppet-agent with noop:
`bolt task run bootstrap::linux master=<master's fqdn> set_noop=true--nodes x,y,z --modulepath /path/to/modules`

#### Example: Specify custom dns alt names

Optionally to install the Puppet agent with custom dns alt names, specify the custom dns alt names:
Expand Down
6 changes: 6 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Data type: `Optional[String]`

The environment in which the node should be bootstrapped

##### `set_noop`

Data type: `Optional[Boolean]`

The noop setting in the [agent] section of puppet.conf

##### `dns_alt_names`

Data type: `Optional[String]`
Expand Down
4 changes: 4 additions & 0 deletions tasks/init.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"description": "The environment in which the node should be bootstrapped",
"type": "Optional[String]"
},
"set_noop": {
"description": "The noop setting in the [agent] section of puppet.conf",
"type": "Optional[Boolean]"
},
"dns_alt_names": {
"description": "The DNS alt names with which the agent certificate should be generated",
"type": "Optional[String]"
Expand Down
4 changes: 4 additions & 0 deletions tasks/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"description": "The environment in which the node should be bootstrapped",
"type": "Optional[String]"
},
"set_noop": {
"description": "The noop setting in the [agent] section of puppet.conf",
"type": "Optional[Boolean]"
},
"dns_alt_names": {
"description": "The DNS alt names with which the agent certificate should be generated",
"type": "Optional[String]"
Expand Down
7 changes: 6 additions & 1 deletion tasks/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ master="$PT_master"
cacert_content="$PT_cacert_content"
certname="$PT_certname"
environment="$PT_environment"
set_noop="$PT_set_noop"
alt_names="$PT_dns_alt_names"
custom_attribute="$PT_custom_attribute"
extension_request="$PT_extension_request"

validate $certname
validate $environment
validate $set_noop
validate $alt_names

if [ -n "${certname?}" ] ; then
Expand All @@ -42,6 +44,9 @@ fi
if [ -n "${environment?}" ] ; then
environment_arg="agent:environment='${environment}' "
fi
if [ -n "${set_noop?}" ] ; then
set_noop_arg="agent:noop=${set_noop} "
fi
if [ -n "${alt_names?}" ] ; then
alt_names_arg="agent:dns_alt_names='${alt_names}' "
fi
Expand All @@ -63,7 +68,7 @@ else
fi

if curl ${curl_arg?} https://${master}:8140/packages/current/install.bash -o /tmp/install.bash; then
if bash /tmp/install.bash ${certname_arg}${environment_arg}${alt_names_arg}${custom_attributes_arg}${extension_requests_arg}; then
if bash /tmp/install.bash ${certname_arg}${environment_arg}${set_noop_arg}${alt_names_arg}${custom_attributes_arg}${extension_requests_arg}; then
echo "Installed"
exit 0
else
Expand Down
4 changes: 4 additions & 0 deletions tasks/windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"description": "The environment in which the node should be bootstrapped",
"type": "Optional[String]"
},
"set_noop": {
"description": "The noop setting in the [agent] section of puppet.conf",
"type": "Optional[Boolean]"
},
"dns_alt_names": {
"description": "The DNS alt names with which the agent certificate should be generated",
"type": "Optional[String]"
Expand Down
7 changes: 7 additions & 0 deletions tasks/windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Param(
[String]
$Environment,

[Parameter(Mandatory = $False)]
[String]
$Set_Noop,

[Parameter(Mandatory = $False)]
[ValidateScript({ $_ -match '\w+=\w+' })]
[String[]]
Expand Down Expand Up @@ -213,6 +217,9 @@ try
if ($PSBoundParameters.ContainsKey('Environment')) {
$options.ExtraConfig += @{ 'agent:environment' = "'$Environment'" }
}
if ($PSBoundParameters.ContainsKey('Set_Noop')) {
$options.ExtraConfig += @{ 'agent:noop' = "$Set_Noop" }
}

$installerOutput = Invoke-SimplifiedInstaller @options
$jsonOutput = ConvertTo-JsonString $installerOutput
Expand Down