Skip to content

Commit

Permalink
Merge pull request #3 from Phil-Friderici/refactors
Browse files Browse the repository at this point in the history
Collection of refactors
  • Loading branch information
Phil-Friderici authored Nov 9, 2023
2 parents 48fce29 + f1803d4 commit 3384f8d
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 141 deletions.
4 changes: 1 addition & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fixtures:
ref: 'v1.7.0'
stdlib:
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '5.0.0'
ref: 'v8.6.0'
cron:
repo: 'https://github.com/puppetlabs/puppetlabs-cron_core.git'
ref: '1.0.0'
Expand All @@ -15,5 +15,3 @@ fixtures:
selinux:
repo: 'https://github.com/puppetlabs/puppetlabs-selinux_core.git'
ref: '1.0.1'
symlinks:
types: "#{source_dir}"
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ as shown below.

You can add any of the supported options for the types in this module. Please
see the Puppet Labs
[Type Reference](http://docs.puppetlabs.com/references/stable/type.html) for
[Type Reference](https://www.puppet.com/docs/puppet/8/type.html) for
more information.

[![Build Status](https://api.travis-ci.org/ghoneycutt/puppet-module-types.png?branch=master)](https://travis-ci.org/ghoneycutt/puppet-module-types)

===

# Compatibility
Expand Down
36 changes: 18 additions & 18 deletions manifests/exec.pp
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
# @summary Define for exec types
# For a full description of the exec type check: https://www.puppet.com/docs/puppet/7/types/exec.html
# For a full description of the exec type check: https://www.puppet.com/docs/puppet/latest/types/exec.html
#
# @param command
# Value passed to command attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-command for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-command for more information.
#
# @param creates
# Value passed to creates attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-creates for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-creates for more information.
#
# @param cwd
# Value passed to cwd attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-cwd for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-cwd for more information.
#
# @param environment
# Value passed to environment attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-environment for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-environment for more information.
#
# @param group
# Value passed to group attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-group for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-group for more information.
#
# @param logoutput
# Value passed to logoutput attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-logoutput for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-logoutput for more information.
#
# @param onlyif
# Value passed to onlyif attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-onlyif for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-onlyif for more information.
#
# @param path
# Value passed to path attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-path for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-path for more information.
#
# @param provider
# Value passed to provider attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-provider for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-provider for more information.
#
# @param refresh
# Value passed to refresh attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-refresh for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-refresh for more information.
#
# @param refreshonly
# Value passed to refreshonly attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-refreshonly for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-refreshonly for more information.
#
# @param returns
# Value passed to returns attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-returns for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-returns for more information.
#
# @param timeout
# Value passed to timeout attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-timeout for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-timeout for more information.
#
# @param tries
# Value passed to tries attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-tries for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-tries for more information.
#
# @param try_sleep
# Value passed to try_sleep attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-try_sleep for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-try_sleep for more information.
#
# @param unless
# Value passed to unless attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-unless for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-unless for more information.
#
# @param user
# Value passed to user attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/exec.html#exec-attribute-user for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/exec.html#exec-attribute-user for more information.
#
define types::exec (
String[1] $command,
Expand Down
98 changes: 49 additions & 49 deletions manifests/file.pp
Original file line number Diff line number Diff line change
@@ -1,127 +1,127 @@
# @summary Define for file types
# For a full description of the exec type check: https://www.puppet.com/docs/puppet/7/types/file.html
# For a full description of the exec type check: https://www.puppet.com/docs/puppet/latest/types/file.html
#
# @param ensure
# Value passed to ensure attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-ensure for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-ensure for more information.
#
# @param owner
# Value passed to owner attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-owner for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-owner for more information.
#
# @param group
# Value passed to group attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-group for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-group for more information.
#
# @param mode
# Value passed to mode attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-mode for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-mode for more information.
#
# @param backup
# Value passed to backup attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-backup for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-backup for more information.
#
# @param checksum
# Value passed to checksum attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-checksum for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-checksum for more information.
#
# @param content
# Value passed to content attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-content for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-content for more information.
#
# @param force
# Value passed to force attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-force for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-force for more information.
#
# @param ignore
# Value passed to ignore attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-ignore for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-ignore for more information.
#
# @param links
# Value passed to links attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-links for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-links for more information.
#
# @param provider
# Value passed to provider attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-provider for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-provider for more information.
#
# @param purge
# Value passed to purge attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-purge for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-purge for more information.
#
# @param recurse
# Value passed to recurse attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-recurse for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-recurse for more information.
#
# @param recurselimit
# Value passed to recurselimit attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-recurselimit for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-recurselimit for more information.
#
# @param replace
# Value passed to replace attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-replace for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-replace for more information.
#
# @param selinux_ignore_defaults
# Value passed to selinux_ignore_defaults attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-selinux_ignore_defaults for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-selinux_ignore_defaults for more information.
#
# @param selrange
# Value passed to selrange attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-selrange for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-selrange for more information.
#
# @param selrole
# Value passed to selrole attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-selrole for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-selrole for more information.
#
# @param seltype
# Value passed to seltype attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-seltype for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-seltype for more information.
#
# @param seluser
# Value passed to seluser attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-seluser for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-seluser for more information.
#
# @param show_diff
# Value passed to show_diff attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-show_diff for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-show_diff for more information.
#
# @param source
# Value passed to source attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-source for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-source for more information.
#
# @param sourceselect
# Value passed to sourceselect attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-sourceselect for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-sourceselect for more information.
#
# @param target
# Value passed to target attribute. Unused if empty.
# Check https://www.puppet.com/docs/puppet/7/types/file.html#file-attribute-target for more information.
# Check https://www.puppet.com/docs/puppet/latest/types/file.html#file-attribute-target for more information.
#
define types::file (
Enum['present', 'absent', 'file', 'directory', 'link'] $ensure = 'present',
String[1] $owner = 'root',
String[1] $group = 'root',
Stdlib::Filemode $mode = '0644',
Optional[String[1]] $backup = undef,
Optional[String[1]] $checksum = undef,
Optional[String[1]] $content = undef,
Optional[String[1]] $force = undef,
Optional[Variant[String[1], Array[String[1]]]] $ignore = undef,
Optional[String[1]] $links = undef,
Optional[String[1]] $provider = undef,
Optional[Variant[Boolean, Enum['yes', 'no']]] $purge = undef,
Optional[Variant[Boolean, Enum['remote']]] $recurse = undef,
Optional[Integer] $recurselimit = undef,
Optional[Variant[Boolean, Enum['yes', 'no']]] $replace = undef,
Optional[Boolean] $selinux_ignore_defaults = undef,
Optional[String[1]] $selrange = undef,
Optional[String[1]] $selrole = undef,
Optional[String[1]] $seltype = undef,
Optional[String[1]] $seluser = undef,
Optional[Variant[Boolean, Enum['yes', 'no']]] $show_diff = undef,
Optional[String[1]] $source = undef,
Optional[String[1]] $sourceselect = undef,
Optional[String[1]] $target = undef,
Stdlib::Ensure::File $ensure = 'present',
String[1] $owner = 'root',
String[1] $group = 'root',
Stdlib::Filemode $mode = '0644',
Optional[String[1]] $backup = undef,
Optional[String[1]] $checksum = undef,
Optional[String[1]] $content = undef,
Optional[String[1]] $force = undef,
Optional[Variant[String[1], Array[String[1]]]] $ignore = undef,
Optional[String[1]] $links = undef,
Optional[String[1]] $provider = undef,
Optional[Variant[Boolean, Stdlib::Yes_no]] $purge = undef,
Optional[Variant[Boolean, Enum['remote']]] $recurse = undef,
Optional[Integer] $recurselimit = undef,
Optional[Variant[Boolean, Stdlib::Yes_no]] $replace = undef,
Optional[Boolean] $selinux_ignore_defaults = undef,
Optional[String[1]] $selrange = undef,
Optional[String[1]] $selrole = undef,
Optional[String[1]] $seltype = undef,
Optional[String[1]] $seluser = undef,
Optional[Variant[Boolean, Stdlib::Yes_no]] $show_diff = undef,
Optional[Stdlib::Filesource] $source = undef,
Optional[String[1]] $sourceselect = undef,
Optional[String[1]] $target = undef,
) {
assert_type(Stdlib::Absolutepath, $name)

Expand Down
21 changes: 13 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@
# @param services
# Hash of resource type `service`.
#
# @param ensure_packages
# Array of packages to install with `ensure_packages`.
#
class types (
Hash $crons = {},
Hash $execs = {},
Hash $file_lines = {},
Hash $files = {},
Hash $mounts = {},
Hash $packages = {},
Hash $selbooleans = {},
Hash $services = {},
Hash $crons = {},
Hash $execs = {},
Hash $file_lines = {},
Hash $files = {},
Hash $mounts = {},
Hash $packages = {},
Hash $selbooleans = {},
Hash $services = {},
Array $ensure_packages = [],
) {
create_resources('types::cron',$crons)
create_resources('types::exec',$execs)
Expand All @@ -46,4 +50,5 @@
create_resources('types::package',$packages)
create_resources('types::selboolean',$selbooleans)
create_resources('types::service',$services)
ensure_packages($ensure_packages)
}
1 change: 0 additions & 1 deletion manifests/mount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
) {
if $ensure != 'absent' {
# ensure target exists
include common
common::mkdir_p { $name: }
}

Expand Down
Loading

0 comments on commit 3384f8d

Please sign in to comment.