Merge build 39 into master
This commit is contained in:
25
README.md
25
README.md
@@ -7,6 +7,7 @@
|
|||||||
- [Synopsis](#synopsis)
|
- [Synopsis](#synopsis)
|
||||||
- [WARNING](#warning)
|
- [WARNING](#warning)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
|
- [Adding custom configurations](#adding-custom-configurations)
|
||||||
- [Support](#support)
|
- [Support](#support)
|
||||||
- [Parameter Inheritance](#parameter-inheritance)
|
- [Parameter Inheritance](#parameter-inheritance)
|
||||||
- [Module Deployment](#module-deployment)
|
- [Module Deployment](#module-deployment)
|
||||||
@@ -29,7 +30,29 @@
|
|||||||
- manage service
|
- manage service
|
||||||
- (optional) manage firewall
|
- (optional) manage firewall
|
||||||
|
|
||||||
> ToDo: Define for custom drop-in configurations
|
## Adding custom configurations
|
||||||
|
|
||||||
|
Custom configuration files live in `/etc/ssh/sshd_config.d/`. IN order to create a custom config file, add a stanza like this in your control repo:
|
||||||
|
|
||||||
|
```puppet
|
||||||
|
confdroid_ssh::custom::custom_config { '30-my-custom-rule':
|
||||||
|
config_name => '30-custom-rule',
|
||||||
|
config_content => ['PasswordAuthentication no'],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will create a file /etc/ssh/sshd_config.d/30-custom-rule.conf with this content:
|
||||||
|
|
||||||
|
```puppet
|
||||||
|
###############################################################################
|
||||||
|
##### DO NOT EDIT THIS FILE MANUALLY #
|
||||||
|
##### This file is managed by Puppet. Any changes to this file will be #
|
||||||
|
##### overwritten. Update the Puppet define input instead. #
|
||||||
|
###############################################################################
|
||||||
|
PasswordAuthentication no
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the value for config_content **has to be an array**, even if only one key pair is in there. This field is designed to hold multiple values, which create one line in the config file each.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,8 @@
|
|||||||
</li><li>
|
</li><li>
|
||||||
<p><a href="#features">Features</a></p>
|
<p><a href="#features">Features</a></p>
|
||||||
</li><li>
|
</li><li>
|
||||||
|
<p><a href="#adding-custom-configurations">Adding custom configurations</a></p>
|
||||||
|
</li><li>
|
||||||
<p><a href="#support">Support</a></p>
|
<p><a href="#support">Support</a></p>
|
||||||
</li><li>
|
</li><li>
|
||||||
<p><a href="#parameter-inheritance">Parameter Inheritance</a></p>
|
<p><a href="#parameter-inheritance">Parameter Inheritance</a></p>
|
||||||
@@ -104,9 +106,27 @@
|
|||||||
<p>(optional) manage firewall</p>
|
<p>(optional) manage firewall</p>
|
||||||
</li></ul>
|
</li></ul>
|
||||||
|
|
||||||
<blockquote>
|
<h2 id="label-Adding+custom+configurations">Adding custom configurations</h2>
|
||||||
<p>ToDo: Define for custom drop-in configurations</p>
|
|
||||||
</blockquote>
|
<p>Custom configuration files live in <code>/etc/ssh/sshd_config.d/</code>. IN order to create a custom config file, add a stanza like this in your control repo:</p>
|
||||||
|
|
||||||
|
<pre class="code ruby"><code class="ruby">confdroid_ssh::custom::custom_config { '30-my-custom-rule':
|
||||||
|
config_name => '30-custom-rule',
|
||||||
|
config_content => ['PasswordAuthentication no'],
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>This will create a file /etc/ssh/sshd_config.d/30-custom-rule.conf with this content:</p>
|
||||||
|
|
||||||
|
<pre class="code ruby"><code class="ruby"><span class='comment'>###############################################################################
|
||||||
|
</span><span class='comment'>##### DO NOT EDIT THIS FILE MANUALLY #
|
||||||
|
</span><span class='comment'>##### This file is managed by Puppet. Any changes to this file will be #
|
||||||
|
</span><span class='comment'>##### overwritten. Update the Puppet define input instead. #
|
||||||
|
</span><span class='comment'>###############################################################################
|
||||||
|
</span><span class='const'>PasswordAuthentication</span> <span class='id identifier rubyid_no'>no</span>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that the value for config_content <strong>has to be an array</strong>, even if only one key pair is in there. This field is designed to hold multiple values, which create one line in the config file each.</p>
|
||||||
|
|
||||||
<h2 id="label-Support">Support</h2>
|
<h2 id="label-Support">Support</h2>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
|
|||||||
@@ -70,6 +70,8 @@
|
|||||||
</li><li>
|
</li><li>
|
||||||
<p><a href="#features">Features</a></p>
|
<p><a href="#features">Features</a></p>
|
||||||
</li><li>
|
</li><li>
|
||||||
|
<p><a href="#adding-custom-configurations">Adding custom configurations</a></p>
|
||||||
|
</li><li>
|
||||||
<p><a href="#support">Support</a></p>
|
<p><a href="#support">Support</a></p>
|
||||||
</li><li>
|
</li><li>
|
||||||
<p><a href="#parameter-inheritance">Parameter Inheritance</a></p>
|
<p><a href="#parameter-inheritance">Parameter Inheritance</a></p>
|
||||||
@@ -104,9 +106,27 @@
|
|||||||
<p>(optional) manage firewall</p>
|
<p>(optional) manage firewall</p>
|
||||||
</li></ul>
|
</li></ul>
|
||||||
|
|
||||||
<blockquote>
|
<h2 id="label-Adding+custom+configurations">Adding custom configurations</h2>
|
||||||
<p>ToDo: Define for custom drop-in configurations</p>
|
|
||||||
</blockquote>
|
<p>Custom configuration files live in <code>/etc/ssh/sshd_config.d/</code>. IN order to create a custom config file, add a stanza like this in your control repo:</p>
|
||||||
|
|
||||||
|
<pre class="code ruby"><code class="ruby">confdroid_ssh::custom::custom_config { '30-my-custom-rule':
|
||||||
|
config_name => '30-custom-rule',
|
||||||
|
config_content => ['PasswordAuthentication no'],
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>This will create a file /etc/ssh/sshd_config.d/30-custom-rule.conf with this content:</p>
|
||||||
|
|
||||||
|
<pre class="code ruby"><code class="ruby"><span class='comment'>###############################################################################
|
||||||
|
</span><span class='comment'>##### DO NOT EDIT THIS FILE MANUALLY #
|
||||||
|
</span><span class='comment'>##### This file is managed by Puppet. Any changes to this file will be #
|
||||||
|
</span><span class='comment'>##### overwritten. Update the Puppet define input instead. #
|
||||||
|
</span><span class='comment'>###############################################################################
|
||||||
|
</span><span class='const'>PasswordAuthentication</span> <span class='id identifier rubyid_no'>no</span>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>Note that the value for config_content <strong>has to be an array</strong>, even if only one key pair is in there. This field is designed to hold multiple values, which create one line in the config file each.</p>
|
||||||
|
|
||||||
<h2 id="label-Support">Support</h2>
|
<h2 id="label-Support">Support</h2>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<div class="docstring">
|
<div class="docstring">
|
||||||
<div class="discussion">
|
<div class="discussion">
|
||||||
|
|
||||||
<p>confdroid_ssh::custom::custom_config.pp Module name: confdroid_ssh Author: 12ww1160 (12ww1160@confdroid.com)</p>
|
<p>confdroid_ssh::custom::custom_config.pp Module name: confdroid_ssh Author: 12ww1160 (12ww1160@confdroid.com) } this will create a file called /etc/ssh/sshd_config.d/50-test.conf with the content: PasswordAuthentication no and notify the sshd service to reload the configuration</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -84,7 +84,17 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<p class="tag_title">Parameters:</p>
|
|
||||||
|
<div class="examples">
|
||||||
|
<p class="tag_title">Examples:</p>
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="example code"><code>confdroid_ssh::custom::custom_config { '50-test':
|
||||||
|
config_name => '50-test',
|
||||||
|
config_content => ['PasswordAuthentication no'],</code></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p class="tag_title">Parameters:</p>
|
||||||
<ul class="param">
|
<ul class="param">
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
@@ -130,13 +140,6 @@
|
|||||||
<pre class="lines">
|
<pre class="lines">
|
||||||
|
|
||||||
|
|
||||||
10
|
|
||||||
11
|
|
||||||
12
|
|
||||||
13
|
|
||||||
14
|
|
||||||
15
|
|
||||||
16
|
|
||||||
17
|
17
|
||||||
18
|
18
|
||||||
19
|
19
|
||||||
@@ -154,10 +157,17 @@
|
|||||||
31
|
31
|
||||||
32
|
32
|
||||||
33
|
33
|
||||||
34</pre>
|
34
|
||||||
|
35
|
||||||
|
36
|
||||||
|
37
|
||||||
|
38
|
||||||
|
39
|
||||||
|
40
|
||||||
|
41</pre>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/custom/custom_config.pp', line 10</span>
|
<pre class="code"><span class="info file"># File 'manifests/custom/custom_config.pp', line 17</span>
|
||||||
|
|
||||||
define confdroid_ssh::custom::custom_config (
|
define confdroid_ssh::custom::custom_config (
|
||||||
|
|
||||||
@@ -169,11 +179,10 @@ define confdroid_ssh::custom::custom_config (
|
|||||||
$sshd_service = $confdroid_ssh::params::sshd_service
|
$sshd_service = $confdroid_ssh::params::sshd_service
|
||||||
$custom_config_erb = 'confdroid_ssh/custom_config.erb'
|
$custom_config_erb = 'confdroid_ssh/custom_config.erb'
|
||||||
$config_basename = regsubst($config_name, '\\.conf$', '')
|
$config_basename = regsubst($config_name, '\\.conf$', '')
|
||||||
$config_file = "${config_basename}.conf"
|
$config_file = "${config_name}.conf"
|
||||||
|
|
||||||
file { "${sshd_custom_path}/${config_file}":
|
file { "${sshd_custom_path}/${config_file}":
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template($custom_config_erb),
|
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0600',
|
mode => '0600',
|
||||||
@@ -181,6 +190,7 @@ define confdroid_ssh::custom::custom_config (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
|
content => template($custom_config_erb),
|
||||||
notify => Service[$sshd_service],
|
notify => Service[$sshd_service],
|
||||||
}
|
}
|
||||||
}</pre>
|
}</pre>
|
||||||
|
|||||||
@@ -6,6 +6,13 @@
|
|||||||
# (without .conf extension)
|
# (without .conf extension)
|
||||||
# @param [Array[String]] config_content array of configuration lines to
|
# @param [Array[String]] config_content array of configuration lines to
|
||||||
# include in the custom config
|
# include in the custom config
|
||||||
|
# @example
|
||||||
|
# confdroid_ssh::custom::custom_config { '50-test':
|
||||||
|
# config_name => '50-test',
|
||||||
|
# config_content => ['PasswordAuthentication no'],
|
||||||
|
# }
|
||||||
|
# this will create a file called /etc/ssh/sshd_config.d/50-test.conf with the content:
|
||||||
|
# PasswordAuthentication no and notify the sshd service to reload the configuration
|
||||||
##############################################################################
|
##############################################################################
|
||||||
define confdroid_ssh::custom::custom_config (
|
define confdroid_ssh::custom::custom_config (
|
||||||
|
|
||||||
@@ -17,11 +24,10 @@ define confdroid_ssh::custom::custom_config (
|
|||||||
$sshd_service = $confdroid_ssh::params::sshd_service
|
$sshd_service = $confdroid_ssh::params::sshd_service
|
||||||
$custom_config_erb = 'confdroid_ssh/custom_config.erb'
|
$custom_config_erb = 'confdroid_ssh/custom_config.erb'
|
||||||
$config_basename = regsubst($config_name, '\\.conf$', '')
|
$config_basename = regsubst($config_name, '\\.conf$', '')
|
||||||
$config_file = "${config_basename}.conf"
|
$config_file = "${config_name}.conf"
|
||||||
|
|
||||||
file { "${sshd_custom_path}/${config_file}":
|
file { "${sshd_custom_path}/${config_file}":
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => template($custom_config_erb),
|
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0600',
|
mode => '0600',
|
||||||
@@ -29,6 +35,7 @@ define confdroid_ssh::custom::custom_config (
|
|||||||
selrole => object_r,
|
selrole => object_r,
|
||||||
seltype => etc_t,
|
seltype => etc_t,
|
||||||
seluser => system_u,
|
seluser => system_u,
|
||||||
|
content => template($custom_config_erb),
|
||||||
notify => Service[$sshd_service],
|
notify => Service[$sshd_service],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user