===
Puppet module to manage default types through hashes in Hiera with the create_resources() function. This module adds validation and helper functions, such as ensuring directories. Without specifying any hashes, this module will take no action.
To use, simply include ::types
and start specifying hashes of types in Hiera
as shown below.
You can add any of the supported options for the types in this module. Please see the Puppet Labs Type Reference for more information.
===
This module supports Puppet v3 >= 3.2.0 (with and without the future parser) and Puppet v4 with Ruby versions 1.8.7, 1.9.3, 2.0.0, 2.1.0 and 2.3.1. Please see .travis.yml for the full matrix.
===
This module depends on puppetlabs/stdlib and ghoneycutt/common.
===
Hash of resource type cron
.
- Default: undef
Hash of resource type exec
.
- Default: undef
Hash of resource type file_line
.
- Default: undef
Hash of resource type file
.
- Default: undef
Hash of resource type mount
.
- Default: undef
Hash of resource type package
.
- Default: undef
Hash of resource type selboolean
.
- Default: undef
Hash of resource type service
.
- Default: undef
===
No helper resources are implemented. Simply passes attributes to a cron resource.
The command to execute in the cron job.
- Required
State of cron resource. Valid values are 'present' and 'absent'.
- Default: 'present'
No helper resources are implemented. Simply passes attributes to a exec resource.
The command to execute.
- Required
A file to look for before running the command. The command will only run if the file doesn’t exist. Needs to be an absolute path.
- Default: undef
The directory from which to run the command. Needs to be an absolute path.
- Default: undef
Backend to use for the exec resource. Usually not needed to set. Possible values are 'posix', 'shell', and 'windows'.
- Default: undef
Optional parameters. See type exec reference for more information.
environment
, group
, logoutput
, onlyif
, path
, refresh
, refreshonly
, returns
, timeout
,tries
, try_sleep
, unless
, and user
No helper resources are implemented. Simply passes attributes to a file_line resource.
Whether the file should exist, and if so what kind of file it should be. Possible values are 'present', 'absent', 'file', 'directory', and 'link'.
- Required
The user to whom the file should belong.
- Required
A regex expressed as a string to replace existing lines.
- Default: undef
No helper resources are implemented. Simply passes attributes to a file resource. The path attribute is not used, so the title must be the fully qualified path.
Whether the file should exist, and if so what kind of file it should be. Possible values are 'present', 'absent', 'file', 'directory', and 'link'.
- Default: 'present'
The user to whom the file should belong.
- Default: 'root'
Which group should own the file.
- Default: 'root'
Four digit mode.
- Default: '0644'
Besides ensuring the mount resource, will also ensure that the directory for the mount exists.
If options
parameter is passed and it is set to 'defaults' on osfamily
Solaris, it will use '-' as the mount option instead of 'defaults', as
'defaults' is not supported on Solaris.
- Required
Mount type.
- Required
State of mount.
- Default: mounted
Boolean to mount at boot.
- Default: true
blockdevice
, dump
, options
, pass
, provider
, remounts
, target
What state the package should be in.
- Default: present
adminfile
, allow_virtual
, allowcdrom
, configfiles
, install_options
, package_settings
, provider
, responsefile
, source
, uninstall_options
No helper resources are implemented. Simply passes attributes to a service resource.
Whether a service should be running.
Valid values are 'stopped', 'false', 'running' and 'true'.
- Default: 'running'
Whether a service should be enabled to start at boot. Valid values are 'true', 'false', 'manual'.
- Default: 'true'
Optional parameters. See type reference for more information.
binary
, control
, hasrestart
, hasstatus
, manifest
, path
, pattern
, provider
, restart
, start
, status
, stop
===
types::crons: 'clean puppet filebucket': command: '/usr/bin/find /var/lib/puppet/clientbucket/ -type f -mtime +30 -exec /bin/rm -fr {} \;' hour: 0 minute: 0 'purge old puppet dashboard reports': command: '/usr/bin/rake -f /usr/share/puppet-dashboard/Rakefile RAILS_ENV=production reports:prune upto=30 unit=day >> /var/log/puppet/dashboard_maintenance.log' hour: 0 minute: 30
types::execs: 'run script1 as user with an environment variable set and returns 242': command: '/opt/script1.sh' user: 'user' environment: 'interactive=false' returns: '242' 'run script2 when no log file is present yet': command: '/opt/script2.sh' creates: '/opt/script.log'
types::file_lines: 'roots_path': path: '/root/.bash_profile' line: 'PATH=$PATH:/usr/pgsql-9.4/bin/:$HOME/bin' match: '^export PATH'
types::files: '/tmp/foo': ensure: 'file' '/tmp/dir': ensure: 'directory' '/tmp/link': ensure: 'link' target: '/tmp/foo'
types::mounts: /mnt: device: /dev/dvd fstype: iso9660 atboot: no remounts: true /srv/nfs/home: device: nfsserver:/export/home fstype: nfs options: rw,rsize=8192,wsize=8192
types::packages: package1: ensure: present package2: ensure: absent package3: ensure: latest
types::selboolean: nfs_export_all_ro: value: on persistent: true nfs_export_all_rw: value: on
types::services: iptables: ensure: 'false' enable: 'false' ip6tables: ensure: 'false' enable: 'false' tailored_firewalls: ensure: 'true' enable: 'true'