common module to be applied to ALL nodes
Module is generic enough to work on any system, though the individual modules that it could potentially include could be very platform specific.
===
Optionally include classes that are common to all systems, such as dnsclient
, ntp
, puppet::agent
, and vim
. By default we do not take any action, so you must enable the classes. This should be done in Hiera such as the following example. Ideally you would do this in your least specific level of hiera (often times labeled as 'common' or 'global') and potentially override at other levels.
--- common::manage_root_password: true common::enable_dnsclient: true common::enable_ntp: true common::enable_puppet_agent: true common::enable_vim: true
Hash of users to ensure with common::mkusers
- Default: undef
Hash of groups to ensure
- Default: undef
- Default: false
- Default: MD5 crypt of
puppet
Boolean to ensure /opt/${lsb_provider_name}
- Default: false
LSB Provider Name as assigned by LANANA - http://www.lanana.org/lsbreg/providers/index.html
- Default:
UNSET
Boolean to include ghoneycutt/dnsclient
- Default: false
Boolean to include ghoneycutt/hosts
- Default: false
Boolean to include ghoneycutt/inittab
- Default: false
Boolean to include ghoneycutt/mailaliases
- Default: false
Boolean to include ghoneycutt/motd
- Default: false
Boolean to include ghoneycutt/network
- Default: false
Boolean to include ghoneycutt/nsswitch
- Default: false
Boolean to include ghoneycutt/ntp
- Default: false
Boolean to include ghoneycutt/pam
- Default: false
Boolean to include ghoneycutt/puppet::agent
- Default: false
Boolean to include ghoneycutt/rsyslog
- Default: false
Boolean to include ghoneycutt/selinux
- Default: false
Boolean to include ghoneycutt/ssh
- Default: false
Boolean to include ghoneycutt/utils
- Default: false
Boolean to include ghoneycutt/vim
- Default: false
Boolean to include ghoneycutt/wget
- Default: false
Boolean to include ghoneycutt/virtual
- Default: false
Boolean to include ghoneycutt/physical
- Default: false
Boolean to include ghoneycutt/debian
- Default: false
Boolean to include ghoneycutt/redhat
- Default: false
Boolean to include ghoneycutt/solaris
- Default: false
Boolean to include ghoneycutt/suse
- Default: false
===
Provide mkdir -p
functionality for a directory.
Used in conjunction with a file resource.
common::mkdir_p { '/some/dir/structure': } file { '/some/dir/structure': ensure => directory, require => Common::Mkdir_p['/some/dir/structure'], }
None.
===
Ensures user/groups
You can specify hash each for users and groups and use Hiera to manage them.
This example uses the YAML backend, though that is not mandatory.
In Hiera's hierarchy add two levels, users
, and groups
such as the following example.
hiera.yaml
--- :backends: - yaml :hierarchy: - fqdn/%{fqdn} - users - groups - %{environment} - common :yaml: :datadir:
users.yaml
--- common::users: gh: uid: "30000" comment: "Garrett Honeycutt" groups: admin
groups.yaml
--- common::groups: admin: gid: "32000"
String - UID of user
- Required
String - GID of user
- Default:
$uid
String - username
String - group name of user
- Default:
$name
String - user's shell
- Default: '/bin/bash'
String - home directory
- Default:
/home/${username}
Present or Absent
- Default: present
Boolean for manage home attribute of user resource
- Default: true
Boolean to optionally create ~/.ssh
directory
- Default: true
String - GECOS field for passed
- Default: 'created via puppet'
Array - additional groups the user should be associated with
- Default: undef
String - password crypt for user
- Default: '!!'
String - mode of home directory
- Default: 0700
String - Anything that the ssh_authorized_key resource can take for the type attribute, such as ssh-dss
or ssh-rsa
.
- Default: 'ssh-dss'
===
Takes one argument, the interface name, and returns it formatted for use with facter.
Example: interface2factname('bond0:0')
would return ipaddress_bond0_0
.
Takes two arguments, a file name which can include the path, and the extension to be removed. Returns the file name without the extension as a string.
Example: strip_file_extension('myapp.war','war')
would return myapp
.