Skip to content

Commit

Permalink
Merge pull request #7 from voxpupuli/data
Browse files Browse the repository at this point in the history
Replace params class with Hiera data for default values
  • Loading branch information
treydock committed Dec 5, 2023
2 parents ddd7314 + d441e76 commit 8a95774
Show file tree
Hide file tree
Showing 12 changed files with 388 additions and 321 deletions.
95 changes: 43 additions & 52 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
### Classes

* [`nsswitch`](#nsswitch): Manages the system nsswitch.conf configuration
* [`nsswitch::params`](#nsswitch--params): nsswitch::params class
Provides default values for the nsswitch module according to the
operatingsystem being used.

## Classes

Expand Down Expand Up @@ -43,9 +40,6 @@ The following parameters are available in the `nsswitch` class:
* [`automount`](#-nsswitch--automount)
* [`bootparams`](#-nsswitch--bootparams)
* [`ethers`](#-nsswitch--ethers)
* [`file_group`](#-nsswitch--file_group)
* [`file_owner`](#-nsswitch--file_owner)
* [`file_perms`](#-nsswitch--file_perms)
* [`group`](#-nsswitch--group)
* [`gshadow`](#-nsswitch--gshadow)
* [`hosts`](#-nsswitch--hosts)
Expand All @@ -61,22 +55,25 @@ The following parameters are available in the `nsswitch` class:
* [`shells`](#-nsswitch--shells)
* [`sudoers`](#-nsswitch--sudoers)
* [`file_path`](#-nsswitch--file_path)
* [`file_group`](#-nsswitch--file_group)
* [`file_owner`](#-nsswitch--file_owner)
* [`file_perms`](#-nsswitch--file_perms)

##### <a name="-nsswitch--aliases"></a>`aliases`

Data type: `Optional[Variant[String, Array]]`

Mail aliases, used by getaliasent() and related functions.

Default value: `$nsswitch::params::aliases_default`
Default value: `undef`

##### <a name="-nsswitch--automount"></a>`automount`

Data type: `Optional[Variant[String, Array]]`

Which conventions to use for automounting of homes.

Default value: `$nsswitch::params::automount_default`
Default value: `undef`

##### <a name="-nsswitch--bootparams"></a>`bootparams`

Expand All @@ -85,71 +82,47 @@ Data type: `Optional[Variant[String, Array]]`
Where bootparams shall be supplied from (e.g. for diskless clients at boot
time using rpc.bootparamd).

Default value: `$nsswitch::params::bootparams_default`
Default value: `undef`

##### <a name="-nsswitch--ethers"></a>`ethers`

Data type: `Optional[Variant[String, Array]]`

Ethernet numbers.

Default value: `$nsswitch::params::ethers_default`

##### <a name="-nsswitch--file_group"></a>`file_group`

Data type: `Optional[Variant[String]]`

Group of the nsswitch.conf file

Default value: `$nsswitch::params::file_group`

##### <a name="-nsswitch--file_owner"></a>`file_owner`

Data type: `Variant[String]`

Owner of the nsswitch.conf file

Default value: `'root'`

##### <a name="-nsswitch--file_perms"></a>`file_perms`

Data type: `Variant[String]`

Permissions for the nsswitch.conf file

Default value: `'0644'`
Default value: `undef`

##### <a name="-nsswitch--group"></a>`group`

Data type: `Optional[Variant[String, Array]]`

Groups of users, used by getgrent() and related functions.

Default value: `$nsswitch::params::group_default`
Default value: `undef`

##### <a name="-nsswitch--gshadow"></a>`gshadow`

Data type: `Optional[Variant[String, Array]]`

Shadow groups, used by getspnam() and related functions.

Default value: `$nsswitch::params::gshadow_default`
Default value: `undef`

##### <a name="-nsswitch--hosts"></a>`hosts`

Data type: `Optional[Variant[String, Array]]`

Host names and numbers, used by gethostbyname() and related functions.

Default value: `$nsswitch::params::hosts_default`
Default value: `undef`

##### <a name="-nsswitch--netgroup"></a>`netgroup`

Data type: `Optional[Variant[String, Array]]`

Network-wide list of hosts and users, used for access rules.

Default value: `$nsswitch::params::netgroup_default`
Default value: `undef`

##### <a name="-nsswitch--netmasks"></a>`netmasks`

Expand All @@ -158,39 +131,39 @@ Data type: `Optional[Variant[String, Array]]`
Netmasks specify how much of the address to reserve for sub-dividing
networks into subnetworks.

Default value: `$nsswitch::params::netmasks_default`
Default value: `undef`

##### <a name="-nsswitch--networks"></a>`networks`

Data type: `Optional[Variant[String, Array]]`

Network names and numbers, used by getnetent() and related functions.

Default value: `$nsswitch::params::networks_default`
Default value: `undef`

##### <a name="-nsswitch--passwd"></a>`passwd`

Data type: `Optional[Variant[String, Array]]`

User passwords, used by getpwent() and related functions.

Default value: `$nsswitch::params::passwd_default`
Default value: `undef`

##### <a name="-nsswitch--protocols"></a>`protocols`

Data type: `Optional[Variant[String, Array]]`

Network protocols, used by getprotoent() and related functions.

Default value: `$nsswitch::params::protocols_default`
Default value: `undef`

##### <a name="-nsswitch--publickey"></a>`publickey`

Data type: `Optional[Variant[String, Array]]`

Public and secret keys for Secure_RPC used by NFS and NIS+.

Default value: `$nsswitch::params::publickey_default`
Default value: `undef`

##### <a name="-nsswitch--rpc"></a>`rpc`

Expand All @@ -199,39 +172,39 @@ Data type: `Optional[Variant[String, Array]]`
Remote procedure call names and numbers, used by getrpcbyname() and related
functions.

Default value: `$nsswitch::params::rpc_default`
Default value: `undef`

##### <a name="-nsswitch--services"></a>`services`

Data type: `Optional[Variant[String, Array]]`

Network services, used by getservent() and related functions.

Default value: `$nsswitch::params::services_default`
Default value: `undef`

##### <a name="-nsswitch--shadow"></a>`shadow`

Data type: `Optional[Variant[String, Array]]`

Shadow user passwords, used by getspnam() and related functions.

Default value: `$nsswitch::params::shadow_default`
Default value: `undef`

##### <a name="-nsswitch--shells"></a>`shells`

Data type: `Optional[Variant[String, Array]]`

Valid user shells, used by getusershell() and related functions.

Default value: `$nsswitch::params::shells_default`
Default value: `undef`

##### <a name="-nsswitch--sudoers"></a>`sudoers`

Data type: `Optional[Variant[String, Array]]`

Sudoers policy module users.

Default value: `$nsswitch::params::sudoers_default`
Default value: `undef`

##### <a name="-nsswitch--file_path"></a>`file_path`

Expand All @@ -241,9 +214,27 @@ The path to `nsswitch.conf` on the system.

Default value: `'/etc/nsswitch.conf'`

### <a name="nsswitch--params"></a>`nsswitch::params`
##### <a name="-nsswitch--file_group"></a>`file_group`

Data type: `String[1]`

Group of the nsswitch.conf file

Default value: `'root'`

##### <a name="-nsswitch--file_owner"></a>`file_owner`

Data type: `String[1]`

Owner of the nsswitch.conf file

Default value: `'root'`

nsswitch::params class
Provides default values for the nsswitch module according to the
operatingsystem being used.
##### <a name="-nsswitch--file_perms"></a>`file_perms`

Data type: `Stdlib::Filemode`

Permissions for the nsswitch.conf file

Default value: `'0644'`

30 changes: 30 additions & 0 deletions data/Archlinux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
nsswitch::passwd:
- files
- mymachines
- systemd
nsswitch::shadow:
- files
nsswitch::group:
- files
- mymachines
- systemd
nsswitch::services:
- files
nsswitch::netgroup:
- files
nsswitch::ethers:
- files
nsswitch::hosts:
- files
- mymachines
- myhostname
- resolve [!UNAVAIL=return]
- dns
nsswitch::networks:
- files
nsswitch::protocols:
- files
nsswitch::publickey:
- files
nsswitch::rpc:
- files
27 changes: 27 additions & 0 deletions data/Debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
nsswitch::ethers:
- db
- files
nsswitch::group:
- compat
nsswitch::gshadow:
- files
nsswitch::hosts:
- files
- dns
nsswitch::netgroup:
- nis
nsswitch::networks:
- files
nsswitch::passwd:
- compat
nsswitch::protocols:
- db
- files
nsswitch::rpc:
- db
- files
nsswitch::services:
- db
- files
nsswitch::shadow:
- compat
18 changes: 18 additions & 0 deletions data/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
nsswitch::group:
- compat
nsswitch::hosts:
- files
- dns
nsswitch::networks:
- files
nsswitch::passwd:
- compat
nsswitch::protocols:
- files
nsswitch::rpc:
- files
nsswitch::services:
- compat
nsswitch::shells:
- files
nsswitch::file_group: wheel
34 changes: 34 additions & 0 deletions data/Gentoo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
nsswitch::aliases:
- files
nsswitch::automount:
- files
nsswitch::bootparams:
- files
nsswitch::ethers:
- db
- files
nsswitch::group:
- compat
nsswitch::hosts:
- files
- dns
nsswitch::netgroup:
- files
nsswitch::netmasks:
- files
nsswitch::networks:
- files
- dns
nsswitch::passwd:
- compat
nsswitch::protocols:
- db
- files
nsswitch::rpc:
- db
- files
nsswitch::services:
- db
- files
nsswitch::shadow:
- compat
38 changes: 38 additions & 0 deletions data/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
nsswitch::passwd:
- files
- sss
nsswitch::shadow:
- files
- sss
nsswitch::group:
- files
- sss
nsswitch::automount:
- files
nsswitch::services:
- files
- sss
nsswitch::netgroup:
- files
- sss
nsswitch::aliases:
- files
- nisplus
nsswitch::bootparams:
- nisplus [NOTFOUND=return]
- files
nsswitch::ethers:
- files
nsswitch::hosts:
- files
- dns
nsswitch::netmasks:
- files
nsswitch::networks:
- files
nsswitch::protocols:
- files
nsswitch::publickey:
- nisplus
nsswitch::rpc_default:
- files

0 comments on commit 8a95774

Please sign in to comment.