diff --git a/README.md b/README.md index 0abae00..7f754d6 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ ## Features - install required binaries -- manage required files and directories including selinux context +- manage required files and directories including selinux context - manage service - (optional) manage firewall diff --git a/doc/_index.html b/doc/_index.html index f5b0f9a..9f20f6d 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -122,6 +122,30 @@ +

Defined Type Listing A-Z

+ + + + + + +
+ + + + +
+ diff --git a/doc/puppet_class_list.html b/doc/puppet_class_list.html index 5557e96..a8531c9 100644 --- a/doc/puppet_class_list.html +++ b/doc/puppet_class_list.html @@ -28,6 +28,10 @@ Puppet Classes + + Defined Types + + diff --git a/doc/puppet_defined_type_list.html b/doc/puppet_defined_type_list.html new file mode 100644 index 0000000..26dd691 --- /dev/null +++ b/doc/puppet_defined_type_list.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + Defined Type List + + + +
+
+

Defined Type List

+ + + +
+ + +
+ + diff --git a/doc/puppet_defined_types/confdroid_ssh_3A_3Acustom_3A_3Acustom_config.html b/doc/puppet_defined_types/confdroid_ssh_3A_3Acustom_3A_3Acustom_config.html new file mode 100644 index 0000000..2affcb7 --- /dev/null +++ b/doc/puppet_defined_types/confdroid_ssh_3A_3Acustom_3A_3Acustom_config.html @@ -0,0 +1,199 @@ + + + + + + + Defined Type: confdroid_ssh::custom::custom_config + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Defined Type: confdroid_ssh::custom::custom_config

+
+
+
Defined in:
+
+ manifests/custom/custom_config.pp +
+
+
+ +

Summary

+ Class manages custom configurations for SSH + +

Overview

+
+
+ +

confdroid_ssh::custom::custom_config.pp Module name: confdroid_ssh Author: 12ww1160 (12ww1160@confdroid.com)

+ +
+
+ + + +
+

Parameters:

+
    + +
  • + + config_name + + + (String) + + + + — +
    +

    name of the custom configuration file (without .conf extension)

    +
    + +
  • + +
  • + + config_content + + + (Array[String]) + + + + — +
    +

    array of configuration lines to include in the custom config

    +
    + +
  • + +
+ + + +
+ + + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'manifests/custom/custom_config.pp', line 10
+
+define confdroid_ssh::custom::custom_config (
+
+  String $config_name,
+  Array[String] $config_content,
+
+) {
+  $sshd_custom_path  = $confdroid_ssh::params::sshd_custom_path
+  $sshd_service      = $confdroid_ssh::params::sshd_service
+  $custom_config_erb = 'confdroid_ssh/custom_config.erb'
+  $config_basename   = regsubst($config_name, '\\.conf$', '')
+  $config_file       = "${config_basename}.conf"
+
+  file { "${sshd_custom_path}/${config_file}":
+    ensure   => file,
+    content  => template($custom_config_erb),
+    owner    => 'root',
+    group    => 'root',
+    mode     => '0600',
+    selrange => s0,
+    selrole  => object_r,
+    seltype  => etc_t,
+    seluser  => system_u,
+    notify   => Service[$sshd_service],
+  }
+}
+
+
+
+ + + +
+ + \ No newline at end of file diff --git a/manifests/custom/custom_config.pp b/manifests/custom/custom_config.pp new file mode 100644 index 0000000..db514a8 --- /dev/null +++ b/manifests/custom/custom_config.pp @@ -0,0 +1,34 @@ +## confdroid_ssh::custom::custom_config.pp +# Module name: confdroid_ssh +# Author: 12ww1160 (12ww1160@confdroid.com) +# @summary Class manages custom configurations for SSH +# @param [String] config_name name of the custom configuration file +# (without .conf extension) +# @param [Array[String]] config_content array of configuration lines to +# include in the custom config +############################################################################## +define confdroid_ssh::custom::custom_config ( + + String $config_name, + Array[String] $config_content, + +) { + $sshd_custom_path = $confdroid_ssh::params::sshd_custom_path + $sshd_service = $confdroid_ssh::params::sshd_service + $custom_config_erb = 'confdroid_ssh/custom_config.erb' + $config_basename = regsubst($config_name, '\\.conf$', '') + $config_file = "${config_basename}.conf" + + file { "${sshd_custom_path}/${config_file}": + ensure => file, + content => template($custom_config_erb), + owner => 'root', + group => 'root', + mode => '0600', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + notify => Service[$sshd_service], + } +} diff --git a/templates/custom_config.erb b/templates/custom_config.erb new file mode 100644 index 0000000..c7f8960 --- /dev/null +++ b/templates/custom_config.erb @@ -0,0 +1,8 @@ +############################################################################### +##### 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. # +############################################################################### +<% @config_content.each do |config_line| -%> +<%= config_line %> +<% end -%> \ No newline at end of file