diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece..8d66c08 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,2 @@ --relative +--ignore-lint-parameter_documentation \ No newline at end of file diff --git a/manifests/check.pp b/manifests/check.pp index f652d09..5ae3661 100644 --- a/manifests/check.pp +++ b/manifests/check.pp @@ -13,13 +13,13 @@ # :include:../README.check # define puppi::check ( - $command, - $base_dir = '', - $hostwide = 'no', - $priority = '50', - $project = 'default', - $enable = true ) { - + String $command, + String $base_dir = '', + String $hostwide = 'no', + Variant[String,Integer] $priority = '50', + String $project = 'default', + Boolean $enable = true, +) { require puppi require puppi::params @@ -46,5 +46,4 @@ content => "${real_base_dir}/${command}\n", tag => 'puppi_check', } - } diff --git a/manifests/configure.pp b/manifests/configure.pp index c827fd7..fd95f6c 100644 --- a/manifests/configure.pp +++ b/manifests/configure.pp @@ -14,13 +14,13 @@ # :include:../README.deploy # define puppi::configure ( - $command, - $project, - $arguments = '', - $priority = '50', - $user = 'root', - $enable = true ) { - + String $command, + String $project, + String $arguments = '', + Variant[String,Integer] $priority = '50', + String $user = 'root', + Boolean $enable = true, +) { require puppi require puppi::params @@ -35,6 +35,4 @@ content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", tag => 'puppi_deploy', } - } - diff --git a/manifests/dependencies.pp b/manifests/dependencies.pp index 828b86d..af9cd27 100644 --- a/manifests/dependencies.pp +++ b/manifests/dependencies.pp @@ -8,7 +8,6 @@ # install_dependencies => false # class puppi::dependencies { - require puppi::params if ! defined(Package['curl']) { @@ -34,5 +33,4 @@ if ! defined(Package[$puppi::params::package_mail]) { package { $puppi::params::package_mail : ensure => present } } - } diff --git a/manifests/deploy.pp b/manifests/deploy.pp index b2633cc..9e43f50 100644 --- a/manifests/deploy.pp +++ b/manifests/deploy.pp @@ -14,13 +14,13 @@ # :include:../README.deploy # define puppi::deploy ( - $command, - $project, - $arguments = '', - $priority = '50', - $user = 'root', - $enable = true ) { - + String $command, + String $project, + String $arguments = '', + Variant[String,Integer] $priority = '50', + String $user = 'root', + Boolean $enable = true, +) { require puppi require puppi::params @@ -35,6 +35,4 @@ content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", tag => 'puppi_deploy', } - } - diff --git a/manifests/extras.pp b/manifests/extras.pp index 61ac735..d8d1469 100644 --- a/manifests/extras.pp +++ b/manifests/extras.pp @@ -7,7 +7,6 @@ # extra_class=> 'example42::puppi::extras', # class puppi::extras { - # Default Checks puppi::check { 'NTP_Sync': @@ -52,11 +51,10 @@ hostwide => 'yes' , } - # Info Pages - $network_run = $::os['name'] ? { - 'Solaris' => [ 'ifconfig -a' , 'netstat -nr' , 'cat /etc/resolv.conf' , 'arp -an' , 'netstat -na' ], - default => [ 'ifconfig' , 'route -n' , 'cat /etc/resolv.conf' , 'arp -an' , 'netstat -natup | grep LISTEN' ], + $network_run = $facts['os']['name'] ? { + 'Solaris' => ['ifconfig -a' , 'netstat -nr' , 'cat /etc/resolv.conf' , 'arp -an' , 'netstat -na'], + default => ['ifconfig' , 'route -n' , 'cat /etc/resolv.conf' , 'arp -an' , 'netstat -natup | grep LISTEN'], } puppi::info { 'network': @@ -64,9 +62,9 @@ run => $network_run, } - $users_run = $::os['name'] ? { - 'Solaris' => [ 'who' , 'last' ], - default => [ 'who' , 'last' , 'LANG=C lastlog | grep -v \'Never logged in\'' ], + $users_run = $facts['os']['name'] ? { + 'Solaris' => ['who' , 'last'], + default => ['who' , 'last' , 'LANG=C lastlog | grep -v \'Never logged in\''], } puppi::info { 'users': @@ -74,9 +72,9 @@ run => $users_run, } - $perf_run = $::os['name'] ? { - 'Solaris' => [ 'uptime' , 'vmstat 1 5' ], - default => [ 'uptime' , 'free' , 'vmstat 1 5' ], + $perf_run = $facts['os']['name'] ? { + 'Solaris' => ['uptime' , 'vmstat 1 5'], + default => ['uptime' , 'free' , 'vmstat 1 5'], } puppi::info { 'perf': @@ -84,9 +82,9 @@ run => $perf_run, } - $disks_run = $::os['name'] ? { - 'Solaris' => [ 'df -h' , 'mount' ], - default => [ 'df -h' , 'mount' , 'blkid' , 'fdisk -l' ], + $disks_run = $facts['os']['name'] ? { + 'Solaris' => ['df -h' , 'mount'], + default => ['df -h' , 'mount' , 'blkid' , 'fdisk -l'], } puppi::info { 'disks': @@ -94,9 +92,9 @@ run => $disks_run, } - $hardware_run = $::os['name'] ? { - 'Solaris' => [ 'find /devices/' ], - default => [ 'lspci' , 'cat /proc/cpuinfo' ], + $hardware_run = $facts['os']['name'] ? { + 'Solaris' => ['find /devices/'], + default => ['lspci' , 'cat /proc/cpuinfo'], } puppi::info { 'hardware': @@ -104,12 +102,12 @@ run => $hardware_run, } - $packages_run = $::os['name'] ? { - /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => [ 'yum repolist' , 'rpm -qa' ] , - /(?i:Debian|Ubuntu|Mint)/ => [ 'apt-config dump' , 'apt-cache stats' , 'apt-key list' , 'dpkg -l' ], - /(Solaris)/ => [ 'pkginfo' ], - /(Archlinux)/ => [ 'pacman -Qet' ], - default => [ 'echo' ], + $packages_run = $facts['os']['name'] ? { + /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => ['yum repolist' , 'rpm -qa'], + /(?i:Debian|Ubuntu|Mint)/ => ['apt-config dump' , 'apt-cache stats' , 'apt-key list' , 'dpkg -l'], + /(Solaris)/ => ['pkginfo'], + /(Archlinux)/ => ['pacman -Qet'], + default => ['echo'], } puppi::info { 'packages': @@ -128,8 +126,7 @@ } ### Default Logs - case $::os['family'] { - + case $facts['os']['family'] { 'Debian': { puppi::log { 'system': description => 'General System Messages', @@ -201,8 +198,6 @@ } } - default: { } - + default: {} } - } diff --git a/manifests/helper.pp b/manifests/helper.pp index d87c198..fd43328 100644 --- a/manifests/helper.pp +++ b/manifests/helper.pp @@ -11,9 +11,9 @@ # } # define puppi::helper ( - $template, - $ensure = 'present' ) { - + String $template, + String $ensure = 'present', +) { require puppi require puppi::params @@ -25,5 +25,4 @@ group => $puppi::params::configfile_group, content => template($template), } - } diff --git a/manifests/helpers.pp b/manifests/helpers.pp index b8cd2f4..393c247 100644 --- a/manifests/helpers.pp +++ b/manifests/helpers.pp @@ -7,10 +7,8 @@ # Automatically included by Puppi # class puppi::helpers { - # Standard helper for Example42 modules puppi::helper { 'standard': template => 'puppi/helpers/standard.yml.erb', } - } diff --git a/manifests/info.pp b/manifests/info.pp index 7ae750d..d7116b7 100644 --- a/manifests/info.pp +++ b/manifests/info.pp @@ -18,10 +18,10 @@ # :include:../README.info # define puppi::info ( - $description = '', - $templatefile = 'puppi/info.erb', - $run = '' ) { - + String $description = '', + String $templatefile = 'puppi/info.erb', + String $run = '', +) { require puppi require puppi::params @@ -34,7 +34,7 @@ } file { "${puppi::params::infodir}/${name}": - ensure => present, + ensure => file, mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -42,5 +42,4 @@ content => template($templatefile), tag => 'puppi_info', } - } diff --git a/manifests/info/instance.pp b/manifests/info/instance.pp index 9d9d992..24fed9c 100644 --- a/manifests/info/instance.pp +++ b/manifests/info/instance.pp @@ -3,31 +3,30 @@ # This is a puppi info plugin specific for the tomcat::instance define # define puppi::info::instance ( - $servicename = '', - $processname = '', - $configdir = '', - $bindir = '', - $pidfile = '', - $datadir = '', - $logdir = '', - $httpport = '', - $controlport = '', - $ajpport = '', - $description = '', - $run = '', - $verbose = 'no', - $templatefile = 'puppi/info/instance.erb' ) { - + String $servicename = '', + String $processname = '', + String $configdir = '', + String $bindir = '', + String $pidfile = '', + String $datadir = '', + String $logdir = '', + Variant[String,Integer] $httpport = '', + Variant[String,Integer] $controlport = '', + Variant[String,Integer] $ajpport = '', + String $description = '', + String $run = '', + String $verbose = 'no', + String $templatefile = 'puppi/info/instance.erb', +) { require puppi require puppi::params file { "${puppi::params::infodir}/${name}": - ensure => present, + ensure => file, mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, content => template($templatefile), tag => 'puppi_info', } - } diff --git a/manifests/info/module.pp b/manifests/info/module.pp index df6f3c6..89376b4 100644 --- a/manifests/info/module.pp +++ b/manifests/info/module.pp @@ -26,28 +26,28 @@ # } # define puppi::info::module ( - $packagename = '', - $servicename = '', - $processname = '', - $configfile = '', - $configdir = '', - $initconfigfile = '', - $pidfile = '', - $datadir = '', - $logfile = '', - $logdir = '', - $protocol = '', - $port = '', - $description = '', - $run = '', - $verbose = 'no', - $templatefile = 'puppi/info/module.erb' ) { - + String $packagename = '', + String $servicename = '', + String $processname = '', + String $configfile = '', + String $configdir = '', + String $initconfigfile = '', + String $pidfile = '', + String $datadir = '', + String $logfile = '', + String $logdir = '', + String $protocol = '', + Variant[String,Integer] $port = '', + String $description = '', + String $run = '', + String $verbose = 'no', + String $templatefile = 'puppi/info/module.erb', +) { require puppi require puppi::params file { "${puppi::params::infodir}/${name}": - ensure => present, + ensure => file, mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -55,5 +55,4 @@ content => template($templatefile), tag => 'puppi_info', } - } diff --git a/manifests/info/readme.pp b/manifests/info/readme.pp index 5cf9950..1a72288 100644 --- a/manifests/info/readme.pp +++ b/manifests/info/readme.pp @@ -10,20 +10,20 @@ # } # define puppi::info::readme ( - $description = '', - $readme = '', - $autoreadme = 'no', - $run = '', - $source_module = 'undefined', - $templatefile = 'puppi/info/readme.erb' ) { - + String $description = '', + String $readme = '', + Variant[String,Boolean] $autoreadme = 'no', + String $run = '', + String $source_module = 'undefined', + String $templatefile = 'puppi/info/readme.erb', +) { require puppi require puppi::params $bool_autoreadme = any2bool($autoreadme) file { "${puppi::params::infodir}/${name}": - ensure => present, + ensure => file, mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -38,7 +38,7 @@ } file { "${puppi::params::readmedir}/${name}": - ensure => present, + ensure => file, mode => '0644', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -48,22 +48,21 @@ } if $bool_autoreadme == true { - file { "${puppi::params::readmedir}/${name}-custom": - ensure => present, - mode => '0644', - owner => $puppi::params::configfile_owner, - group => $puppi::params::configfile_group, - require => File['puppi_readmedir'], - source => [ - "puppet:///modules/${source_module}/puppi/info/readme/readme-${::hostname}" , - "puppet:///modules/${source_module}/puppi/info/readme/readme-${::role}" , - "puppet:///modules/${source_module}/puppi/info/readme/readme-default" , - "puppet:///modules/puppi/info/readme/readme-${::hostname}" , - "puppet:///modules/puppi/info/readme/readme-${::role}" , - 'puppet:///modules/puppi/info/readme/readme-default' - ], - tag => 'puppi_info', + file { "${puppi::params::readmedir}/${name}-custom": + ensure => file, + mode => '0644', + owner => $puppi::params::configfile_owner, + group => $puppi::params::configfile_group, + require => File['puppi_readmedir'], + source => [ + "puppet:///modules/${source_module}/puppi/info/readme/readme-${facts['networking']['hostname']}" , + "puppet:///modules/${source_module}/puppi/info/readme/readme-${facts['role']}" , + "puppet:///modules/${source_module}/puppi/info/readme/readme-default" , + "puppet:///modules/puppi/info/readme/readme-${facts['networking']['hostname']}" , + "puppet:///modules/puppi/info/readme/readme-${facts['role']}" , + 'puppet:///modules/puppi/info/readme/readme-default', + ], + tag => 'puppi_info', } } - } diff --git a/manifests/init.pp b/manifests/init.pp index cebceec..8132246 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,14 +34,13 @@ # puppi info, check and log # class puppi ( - $version = params_lookup( 'version' ), - $install_dependencies = params_lookup( 'install_dependencies' ), - $template = params_lookup( 'template' ), - $helpers_class = params_lookup( 'helpers_class' ), - $logs_retention_days = params_lookup( 'logs_retention_days' ), - $extra_class = params_lookup( 'extra_class' ) - ) inherits puppi::params { - + String $version = params_lookup( 'version' ), + Variant[String,Boolean] $install_dependencies = params_lookup( 'install_dependencies' ), + String $template = params_lookup( 'template' ), + String $helpers_class = params_lookup( 'helpers_class' ), + String $logs_retention_days = params_lookup( 'logs_retention_days' ), + String $extra_class = params_lookup( 'extra_class' ), +) inherits puppi::params { $bool_install_dependencies=any2bool($install_dependencies) # Manage Version @@ -73,5 +72,4 @@ if $bool_install_dependencies { include puppi::dependencies } - } diff --git a/manifests/initialize.pp b/manifests/initialize.pp index 0fe66af..9fbd5c7 100644 --- a/manifests/initialize.pp +++ b/manifests/initialize.pp @@ -12,13 +12,13 @@ # } # define puppi::initialize ( - $command, - $project, - $arguments = '', - $priority = '50', - $user = 'root', - $enable = true ) { - + String $command, + String $project, + String $arguments = '', + Variant[String,Integer] $priority = '50', + String $user = 'root', + Boolean $enable = true, +) { require puppi require puppi::params @@ -33,5 +33,4 @@ content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", tag => 'puppi_initialize', } - } diff --git a/manifests/install_packages.pp b/manifests/install_packages.pp index d9c9618..3ce8a94 100644 --- a/manifests/install_packages.pp +++ b/manifests/install_packages.pp @@ -45,14 +45,14 @@ # } # define puppi::install_packages ( - $packages, - $template = 'puppi/install_packages.erb', - $scripts_dir = '/root/puppi_install_packages', - $autorun = true, - $refreshonly = true, - $timeout = '600', - $ensure = 'present' ) { - + String $packages, + String $template = 'puppi/install_packages.erb', + Srring $scripts_dir = '/root/puppi_install_packages', + Boolean $autorun = true, + Boolean $refreshonly = true, + Variant[String,Integer] $timeout = '600', + String $ensure = 'present', +) { if ! defined(File[$scripts_dir]) { file { $scripts_dir: ensure => directory, @@ -79,5 +79,4 @@ timeout => $timeout, } } - } diff --git a/manifests/log.pp b/manifests/log.pp index 8cfe08a..b50feb6 100644 --- a/manifests/log.pp +++ b/manifests/log.pp @@ -12,9 +12,9 @@ # :include:../README.log # define puppi::log ( - $log, - $description = '' ) { - + Variant[String,Array] $log, + String $description = '', +) { require puppi require puppi::params @@ -24,7 +24,7 @@ } file { "${puppi::params::logsdir}/${name}": - ensure => 'present', + ensure => 'file', mode => '0644', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -32,5 +32,4 @@ content => template('puppi/log.erb'), tag => 'puppi_log', } - } diff --git a/manifests/mcollective/client.pp b/manifests/mcollective/client.pp index 24f2f63..3862975 100644 --- a/manifests/mcollective/client.pp +++ b/manifests/mcollective/client.pp @@ -18,19 +18,18 @@ # :include:../README.mcollective # class puppi::mcollective::client { - require puppi::params require puppi::mcollective::server # OLD STYLE mc-puppi command file { '/usr/local/bin/mc-puppi': - ensure => 'present', + ensure => 'file', mode => '0755', owner => 'root', group => 'root', source => 'puppet:///modules/puppi/mcollective/mc-puppi', require => Class['mcollective'], - } + } # mco application TODO # file { "${puppi::params::mcollective}/application/puppi.rb": @@ -42,7 +41,7 @@ # } file { '/usr/bin/puppicheck': - ensure => 'present', + ensure => 'file', mode => '0750', owner => $puppi::params::mcollective_user, group => $puppi::params::mcollective_group, @@ -50,11 +49,10 @@ } file { '/usr/bin/puppideploy': - ensure => 'present', + ensure => 'file', mode => '0750', owner => $puppi::params::mcollective_user, group => $puppi::params::mcollective_group, source => 'puppet:///modules/puppi/mcollective/puppideploy', } - } diff --git a/manifests/mcollective/server.pp b/manifests/mcollective/server.pp index 40def16..ecf5cd7 100644 --- a/manifests/mcollective/server.pp +++ b/manifests/mcollective/server.pp @@ -10,11 +10,10 @@ # :include:../README.mcollective # class puppi::mcollective::server { - require puppi::params file { "${puppi::params::mcollective}/agent/puppi.ddl": - ensure => 'present', + ensure => 'file', mode => '0644', owner => 'root', group => 'root', @@ -23,12 +22,11 @@ } file { "${puppi::params::mcollective}/agent/puppi.rb": - ensure => 'present', + ensure => 'file', mode => '0644', owner => 'root', group => 'root', source => 'puppet:///modules/puppi/mcollective/puppi.rb', require => Class['mcollective'], } - } diff --git a/manifests/netinstall.pp b/manifests/netinstall.pp index 9f101fe..9df9e6b 100644 --- a/manifests/netinstall.pp +++ b/manifests/netinstall.pp @@ -60,23 +60,22 @@ # An optional custom command to run after having extracted the file. # define puppi::netinstall ( - $url, - $destination_dir, - $extracted_dir = '', - $retrieve_command = 'wget', - $retrieve_args = '', - $owner = 'root', - $group = 'root', + String $url, + String $destination_dir, + String $extracted_dir = '', + String $retrieve_command = 'wget', + String $retrieve_args = '', + String $owner = 'root', + String $group = 'root', $timeout = '3600', - $work_dir = '/var/tmp', - $path = '/bin:/sbin:/usr/bin:/usr/sbin', - $extract_command = '', - $preextract_command = '', - $postextract_command = '', - $postextract_cwd = '', - $exec_env = [] - ) { - + String $work_dir = '/var/tmp', + String $path = '/bin:/sbin:/usr/bin:/usr/sbin', + String $extract_command = '', + String $preextract_command = '', + String $postextract_command = '', + String $postextract_cwd = '', + Array $exec_env = [], +) { $source_filename = url_parse($url,'filename') $source_filetype = url_parse($url,'filetype') $source_dirname = url_parse($url,'filedir') @@ -166,4 +165,3 @@ } } } - diff --git a/manifests/one.pp b/manifests/one.pp index 47574bc..b5f803d 100644 --- a/manifests/one.pp +++ b/manifests/one.pp @@ -3,12 +3,11 @@ # Installs Puppi 1.0 # class puppi::one { - require puppi::params # Main configuration file file { 'puppi.conf': - ensure => present, + ensure => file, path => "${puppi::params::basedir}/puppi.conf", mode => '0644', owner => $puppi::params::configfile_owner, @@ -19,7 +18,7 @@ # The Puppi 1.0 command file { 'puppi': - ensure => present, + ensure => file, path => '/usr/sbin/puppi.one', mode => '0750', owner => $puppi::params::configfile_owner, @@ -27,5 +26,4 @@ content => template('puppi/puppi.erb'), require => File['puppi_basedir'], } - } diff --git a/manifests/params.pp b/manifests/params.pp index f719572..35349d0 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,8 +2,7 @@ # # Sets internal variables and defaults for puppi module # -class puppi::params { - +class puppi::params { ## PARAMETERS $version = '1' $install_dependencies = true @@ -12,7 +11,6 @@ $logs_retention_days = '30' $extra_class = 'puppi::extras' - ## INTERNALVARS $basedir = '/etc/puppi' $scriptsdir = '/etc/puppi/scripts' @@ -35,21 +33,21 @@ # External tools # Directory where are placed the checks scripts # By default we use Nagios plugins - $checkpluginsdir = $::os['name'] ? { - /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => $::os['architecture'] ? { - x86_64 => '/usr/lib64/nagios/plugins', + $checkpluginsdir = $facts['os']['name'] ? { + /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => $facts['os']['architecture'] ? { + 'x86_64' => '/usr/lib64/nagios/plugins', default => '/usr/lib/nagios/plugins', }, default => '/usr/lib/nagios/plugins', } - $package_nagiosplugins = $::os['name'] ? { + $package_nagiosplugins = $facts['os']['name'] ? { /(?i:RedHat|CentOS|Scientific|Amazon|Linux|Fedora)/ => 'nagios-plugins-all', /(?i:Debian|Ubuntu|Mint)/ => 'monitoring-plugins', default => 'nagios-plugins', } - $package_mail = $::os['name'] ? { + $package_mail = $facts['os']['name'] ? { /(?i:Debian|Ubuntu|Mint)/ => 'bsd-mailx', default => 'mailx', } @@ -59,31 +57,29 @@ # Mcollective paths # TODO: Add Paths for Puppet Enterprise: # /opt/puppet/libexec/mcollective/mcollective/ - $mcollective = $::os['name'] ? { - debian => '/usr/share/mcollective/plugins/mcollective', - ubuntu => '/usr/share/mcollective/plugins/mcollective', - centos => '/usr/libexec/mcollective/mcollective', - redhat => '/usr/libexec/mcollective/mcollective', + $mcollective = $facts['os']['name'] ? { + 'debian' => '/usr/share/mcollective/plugins/mcollective', + 'ubuntu' => '/usr/share/mcollective/plugins/mcollective', + 'centos' => '/usr/libexec/mcollective/mcollective', + 'redhat' => '/usr/libexec/mcollective/mcollective', default => '/usr/libexec/mcollective/mcollective', } $mcollective_user = 'root' $mcollective_group = 'root' - # Commands used in puppi info templates - $info_package_query = $::os['name'] ? { + $info_package_query = $facts['os']['name'] ? { /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => 'rpm -qi', /(?i:Ubuntu|Debian|Mint)/ => 'dpkg -s', default => 'echo', } - $info_package_list = $::os['name'] ? { + $info_package_list = $facts['os']['name'] ? { /(?i:RedHat|CentOS|Scientific|Amazon|Linux)/ => 'rpm -ql', /(?i:Ubuntu|Debian|Mint)/ => 'dpkg -L', default => 'echo', } - $info_service_check = $::os['name'] ? { + $info_service_check = $facts['os']['name'] ? { default => '/etc/init.d/', } - } diff --git a/manifests/project.pp b/manifests/project.pp index 287ce7c..11fd869 100644 --- a/manifests/project.pp +++ b/manifests/project.pp @@ -5,22 +5,22 @@ # to to build up the commands list # define puppi::project ( - $deploy_root = undef, - $source = undef, - $user = 'root', - $predeploy_customcommand = '', - $postdeploy_customcommand = '', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = 0, - $report_email = '', - $files_prefix = undef, - $source_baseurl = undef, - $document_root = '', - $config_root = undef, - $enable = true ) { - + Optional[String] $deploy_root = undef, + Optional[String] $source = undef, + String $user = 'root', + String $predeploy_customcommand = '', + String $postdeploy_customcommand = '', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[Integer,String] $firewall_dst_port = 0, + String $report_email = '', + Optional[String] $files_prefix = undef, + Optional[String] $source_baseurl = undef, + String $document_root = '', + Optional[String] $config_root = undef, + Boolean $enable = true, +) { require puppi::params $ensure = any2bool($enable) ? { @@ -110,5 +110,4 @@ group => $puppi::params::configfile_group, require => File["${puppi::params::projectsdir}/${name}"]; } - } diff --git a/manifests/project/archive.pp b/manifests/project/archive.pp index 2924362..73f7346 100644 --- a/manifests/project/archive.pp +++ b/manifests/project/archive.pp @@ -103,29 +103,29 @@ # Puppet runs. Default: 'false' # define puppi::project::archive ( - $source, - $deploy_root, - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $clean_deploy = false, - $backup_enable = true, - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + String $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $clean_deploy = false, + Boolean $backup_enable = true, + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -145,7 +145,6 @@ true => 'yes', } - $bool_run_checks = any2bool($run_checks) $bool_clean_deploy = any2bool($clean_deploy) $bool_backup_enable = any2bool($backup_enable) @@ -162,18 +161,18 @@ } ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable , - } + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable , + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -187,23 +186,23 @@ } } - # Here source file is retrieved - puppi::deploy { "${name}-Retrieve_Archive": - priority => '20' , - command => 'get_file.sh' , - arguments => "-s ${source} -t ${real_source_type} -a ${real_always_deploy}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here source file is retrieved + puppi::deploy { "${name}-Retrieve_Archive": + priority => '20' , + command => 'get_file.sh' , + arguments => "-s ${source} -t ${real_source_type} -a ${real_always_deploy}" , + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-PreDeploy_Archive": - priority => '25' , - command => 'predeploy.sh' , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-PreDeploy_Archive": + priority => '25' , + command => 'predeploy.sh' , + user => 'root' , + project => $name , + enable => $enable , + } if ($firewall_src_ip != '') { puppi::deploy { "${name}-Load_Balancer_Block": @@ -249,15 +248,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy": - priority => '40' , - command => 'deploy_files.sh' , - arguments => "-d ${deploy_root} -c ${bool_clean_deploy}", - user => $user , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy": + priority => '40' , + command => 'deploy_files.sh' , + arguments => "-d ${deploy_root} -c ${bool_clean_deploy}", + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -303,7 +302,6 @@ } } - ### ROLLBACK PROCEDURE if ($bool_backup_enable == true) { @@ -411,5 +409,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/builder.pp b/manifests/project/builder.pp index ffa207c..544b3a4 100644 --- a/manifests/project/builder.pp +++ b/manifests/project/builder.pp @@ -127,31 +127,31 @@ # Puppet runs. Default: 'false' # define puppi::project::builder ( - $source, - $source_type, - $deploy_root, - $init_source = '', - $user = 'root', - $magicfix = '', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup = 'full', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $source_type, + String $deploy_root, + String $init_source = '', + String $user = 'root', + String $magicfix = '', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + Variant[String,Boolean] $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup = 'full', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -204,7 +204,6 @@ enable => $enable, } - ### INIT SEQUENCE if ($init_source != '') { puppi::initialize { "${name}-Deploy_Files": @@ -217,7 +216,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -257,7 +255,6 @@ } if ($real_source_type == 'zip') { - puppi::deploy { "${name}-PreDeploy_Zip": priority => '25' , command => 'predeploy.sh' , @@ -364,15 +361,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy": - priority => '40' , - command => 'deploy.sh' , - arguments => $deploy_root , - user => $user , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy": + priority => '40' , + command => 'deploy.sh' , + arguments => $deploy_root , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -429,7 +426,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -550,7 +546,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -568,5 +563,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/dir.pp b/manifests/project/dir.pp index 4514b37..c23bc46 100644 --- a/manifests/project/dir.pp +++ b/manifests/project/dir.pp @@ -102,29 +102,29 @@ # Puppet runs. Default: 'false' # define puppi::project::dir ( - $source, - $deploy_root, - $init_source = '', - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $skip_predeploy = false, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + String $init_source = '', + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $skip_predeploy = false, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -144,20 +144,19 @@ $bool_auto_deploy = any2bool($auto_deploy) ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### INIT SEQUENCE if ($init_source != '') { @@ -171,7 +170,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -206,14 +204,14 @@ } } - puppi::deploy { "${name}-Backup_existing_Files": - priority => '30' , - command => 'archive.sh' , - arguments => "-b ${deploy_root} -o '${backup_rsync_options}' -n ${backup_retention}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Backup_existing_Files": + priority => '30' , + command => 'archive.sh' , + arguments => "-b ${deploy_root} -o '${backup_rsync_options}' -n ${backup_retention}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($disable_services != '') { puppi::deploy { "${name}-Disable_extra_services": @@ -327,7 +325,6 @@ } } - ### ROLLBACK SEQUENCE if ($firewall_src_ip != '') { @@ -374,14 +371,14 @@ } } - puppi::rollback { "${name}-Recover_Files_To_Deploy": - priority => '40' , - command => 'archive.sh' , - arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , - user => $user , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Recover_Files_To_Deploy": + priority => '40' , + command => 'archive.sh' , + arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::rollback { "${name}-Run_Custom_PostDeploy_Script": @@ -438,7 +435,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -456,5 +452,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/files.pp b/manifests/project/files.pp index 37c1005..52b017f 100644 --- a/manifests/project/files.pp +++ b/manifests/project/files.pp @@ -117,31 +117,31 @@ # Puppet runs. Default: 'false' # define puppi::project::files ( - $source, - $source_baseurl, - $deploy_root, - $init_source = '', - $files_prefix = '', - $prefix = '', - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $source_baseurl, + String $deploy_root, + String $init_source = '', + String $files_prefix = '', + String $prefix = '', + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -160,22 +160,21 @@ $bool_auto_deploy = any2bool($auto_deploy) ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable , - files_prefix => $files_prefix, - source_baseurl => $source_baseurl, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable , + files_prefix => $files_prefix, + source_baseurl => $source_baseurl, + } ### INIT SEQUENCE if ($init_source != '') { @@ -189,7 +188,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -202,46 +200,46 @@ } } - puppi::deploy { "${name}-Retrieve_File_List": - priority => '20' , - command => 'get_file.sh' , - arguments => "-s ${source} -t list" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Retrieve_File_List": + priority => '20' , + command => 'get_file.sh' , + arguments => "-s ${source} -t list" , + user => 'root' , + project => $name , + enable => $enable , + } - $args_prefix = $prefix ? { - '' => '', - default => "-m ${prefix}", - } + $args_prefix = $prefix ? { + '' => '', + default => "-m ${prefix}", + } - puppi::deploy { "${name}-Extract_File_Metadata": - priority => '22' , - command => 'get_metadata.sh' , - arguments => $args_prefix, - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Extract_File_Metadata": + priority => '22' , + command => 'get_metadata.sh' , + arguments => $args_prefix, + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-Clean_File_List": - priority => '24' , - command => 'clean_filelist.sh' , - arguments => $files_prefix , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Clean_File_List": + priority => '24' , + command => 'clean_filelist.sh' , + arguments => $files_prefix , + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-Retrieve_Files": - priority => '25' , - command => 'get_filesfromlist.sh' , - arguments => $source_baseurl , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Retrieve_Files": + priority => '25' , + command => 'get_filesfromlist.sh' , + arguments => $source_baseurl , + user => 'root' , + project => $name , + enable => $enable , + } if ($firewall_src_ip != '') { puppi::deploy { "${name}-Load_Balancer_Block": @@ -254,14 +252,14 @@ } } - puppi::deploy { "${name}-Backup_existing_Files": - priority => '30' , - command => 'archive.sh' , - arguments => "-b ${deploy_root} -o '${backup_rsync_options}' -n ${backup_retention}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Backup_existing_Files": + priority => '30' , + command => 'archive.sh' , + arguments => "-b ${deploy_root} -o '${backup_rsync_options}' -n ${backup_retention}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($disable_services != '') { puppi::deploy { "${name}-Disable_extra_services": @@ -297,14 +295,14 @@ } # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy": - priority => '40' , - command => 'deploy.sh' , - arguments => $deploy_root , - user => $user , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Deploy": + priority => '40' , + command => 'deploy.sh' , + arguments => $deploy_root , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -361,7 +359,6 @@ } } - ### ROLLBACK SEQUENCE if ($firewall_src_ip != '') { @@ -408,14 +405,14 @@ } } - puppi::rollback { "${name}-Recover_Files_To_Deploy": - priority => '40' , - command => 'archive.sh' , - arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , - user => $user , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Recover_Files_To_Deploy": + priority => '40' , + command => 'archive.sh' , + arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::rollback { "${name}-Run_Custom_PostDeploy_Script": @@ -472,7 +469,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -490,5 +486,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/git.pp b/manifests/project/git.pp old mode 100644 new mode 100755 index 041a3f9..17bb66b --- a/manifests/project/git.pp +++ b/manifests/project/git.pp @@ -126,33 +126,33 @@ # Puppet runs. Default: 'false' # define puppi::project::git ( - $source, - $deploy_root, - $install_git = true, - $git_subdir = 'undefined', - $tag = 'undefined', - $branch = 'master', - $commit = 'undefined', - $keep_gitdata = true, - $verbose = true, - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + Boolean $install_git = true, + String $git_subdir = 'undefined', + String $tag = 'undefined', + String $branch = 'master', + String $commit = 'undefined', + Boolean $keep_gitdata = true, + Boolean $verbose = true, + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -179,19 +179,18 @@ } ### CREATE PROJECT - puppi::project { $name: - enable => $enable , - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - } - + puppi::project { $name: + enable => $enable , + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -249,15 +248,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy_Files": - priority => '40' , - command => 'git.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy_Files": + priority => '40' , + command => 'git.sh' , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${git_subdir} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_gitdata}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -303,7 +302,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -405,7 +403,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -423,5 +420,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/hg.pp b/manifests/project/hg.pp index d296024..7eac5af 100644 --- a/manifests/project/hg.pp +++ b/manifests/project/hg.pp @@ -121,32 +121,32 @@ # Puppet runs. Default: 'false' # define puppi::project::hg ( - $source, - $deploy_root, - $install_hg = true, - $tag = 'undefined', - $branch = 'default', - $commit = 'undefined', - $keep_hgdata = true, - $verbose = true, - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + Boolean $install_hg = true, + String $tag = 'undefined', + String $branch = 'default', + String $commit = 'undefined', + Boolean $keep_hgdata = true, + Boolean$verbose = true, + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -173,19 +173,18 @@ } ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable , - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable , + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -243,15 +242,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy_Files": - priority => '40' , - command => 'hg.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy_Files": + priority => '40' , + command => 'hg.sh' , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_hgdata}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -297,7 +296,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -399,7 +397,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -417,5 +414,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/maven.pp b/manifests/project/maven.pp index 9dbe6ee..24a8a43 100644 --- a/manifests/project/maven.pp +++ b/manifests/project/maven.pp @@ -175,48 +175,48 @@ # Puppet runs. Default: 'false' # define puppi::project::maven ( - $source, - $http_user = '', - $http_password = '', - $artifact_type = 'release', - $deploy_root = '', - $user = 'root', - $war_suffix = 'suffixnotset', - $zip_root = '', - $zip_user = '', - $zip_suffix = 'suffixnotset', - $jar_root = '', - $jar_user = '', - $jar_suffix = 'suffixnotset', - $document_root = '', - $document_user = '', - $document_suffix = 'suffixnotset', - $document_init_source = '', - $config_root = '', - $config_user = '', - $config_suffix = 'suffixnotset', - $config_init_source = '', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $report_mongo = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $check_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $http_user = '', + String $http_password = '', + String $artifact_type = 'release', + String $deploy_root = '', + String $user = 'root', + String $war_suffix = 'suffixnotset', + String $zip_root = '', + String $zip_user = '', + String $zip_suffix = 'suffixnotset', + String $jar_root = '', + String $jar_user = '', + String $jar_suffix = 'suffixnotset', + String $document_root = '', + String $document_user = '', + String $document_suffix = 'suffixnotset', + String $document_init_source = '', + String $config_root = '', + String $config_user = '', + String $config_suffix = 'suffixnotset', + String $config_init_source = '', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $report_mongo = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $check_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -260,24 +260,22 @@ $bool_check_deploy = any2bool($check_deploy) $bool_auto_deploy = any2bool($auto_deploy) - ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - document_root => $document_root, - config_root => $config_root, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + document_root => $document_root, + config_root => $config_root, + } ### INIT SEQUENCE if ($document_init_source != '') { @@ -396,7 +394,7 @@ puppi::deploy { "${name}-Get_Maven_Files_ZIP": priority => '25' , command => 'get_maven_files.sh' , - arguments => $real_arguments, + arguments => $real_arguments, user => 'root' , project => $name , enable => $enable , @@ -636,7 +634,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -793,7 +790,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -822,5 +818,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/mysql.pp b/manifests/project/mysql.pp index 8a3c493..9ad8853 100644 --- a/manifests/project/mysql.pp +++ b/manifests/project/mysql.pp @@ -100,30 +100,30 @@ # Puppet runs. Default: 'false' # define puppi::project::mysql ( - $source, - $mysql_database, - $mysql_user = 'root', - $mysql_host = 'localhost', - $mysql_password = '', - $init_source = '', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup = true, - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $mysql_database, + String $mysql_user = 'root', + String $mysql_host = 'localhost', + String $mysql_password = '', + String $init_source = '', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $backup = true, + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -156,19 +156,18 @@ $source_filename = url_parse($source,'filename') ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### INIT SEQUENCE if ($init_source != '') { @@ -190,7 +189,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -203,14 +201,14 @@ } } - puppi::deploy { "${name}-Retrieve_SQLFile": - priority => '20' , - command => 'get_file.sh' , - arguments => "-s ${source} -t ${real_source_type} -a ${real_always_deploy}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Retrieve_SQLFile": + priority => '20' , + command => 'get_file.sh' , + arguments => "-s ${source} -t ${real_source_type} -a ${real_always_deploy}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($firewall_src_ip != '') { puppi::deploy { "${name}-Load_Balancer_Block": @@ -256,15 +254,15 @@ } } - # Here is done the db change - puppi::deploy { "${name}-Run_SQL": - priority => '40' , - command => 'database.sh' , - arguments => "-t mysql -a run -u ${mysql_user} -p '${mysql_password}' -d ${mysql_database} -h ${mysql_host}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here is done the db change + puppi::deploy { "${name}-Run_SQL": + priority => '40' , + command => 'database.sh' , + arguments => "-t mysql -a run -u ${mysql_user} -p '${mysql_password}' -d ${mysql_database} -h ${mysql_host}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -310,7 +308,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -412,7 +409,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -430,5 +426,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/service.pp b/manifests/project/service.pp index 5131d1b..f9ed05a 100644 --- a/manifests/project/service.pp +++ b/manifests/project/service.pp @@ -76,23 +76,23 @@ # Puppet runs. Default: 'false' # define puppi::project::service ( - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $run_checks = true, - $auto_deploy = false, - $enable = true ) { - + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $run_checks = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -111,18 +111,17 @@ $bool_auto_deploy = any2bool($auto_deploy) ### CREATE PROJECT - puppi::project { $name: - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -180,7 +179,6 @@ } } - if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": priority => $postdeploy_priority , @@ -236,7 +234,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -338,7 +335,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -356,5 +352,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/svn.pp b/manifests/project/svn.pp index 726796b..e275cd7 100644 --- a/manifests/project/svn.pp +++ b/manifests/project/svn.pp @@ -140,37 +140,37 @@ # Puppet runs. Default: 'false' # define puppi::project::svn ( - $source, - $deploy_root, - $install_svn = true, - $svn_user = 'undefined', - $svn_password = 'undefined', - $svn_subdir = 'undefined', - $svn_export = false, - $tag = 'undefined', - $branch = 'master', - $commit = 'undefined', - $keep_svndata = true, - $verbose = true, - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_enable = true, - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + Boolean $install_svn = true, + String $svn_user = 'undefined', + String $svn_password = 'undefined', + String $svn_subdir = 'undefined', + Boolean $svn_export = false, + String $tag = 'undefined', + String $branch = 'master', + String $commit = 'undefined', + Boolean $keep_svndata = true, + Boolean $verbose = true, + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $backup_enable = true, + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -199,19 +199,18 @@ } ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -269,15 +268,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy_Files": - priority => '40' , - command => 'svn.sh' , - arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${svn_subdir} -su ${svn_user} -sp ${svn_password} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata} -e ${bool_svn_export}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy_Files": + priority => '40' , + command => 'svn.sh' , + arguments => "-a deploy -s ${source} -d ${deploy_root} -u ${user} -gs ${svn_subdir} -su ${svn_user} -sp ${svn_password} -t ${tag} -b ${branch} -c ${commit} -v ${bool_verbose} -k ${bool_keep_svndata} -e ${bool_svn_export}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -323,11 +322,10 @@ } } - ### ROLLBACK PROCEDURE if ($bool_backup_enable == true) { - if ($firewall_src_ip != '') { + if ($firewall_src_ip != '') { puppi::rollback { "${name}-Load_Balancer_Block": priority => '25' , command => 'firewall.sh' , diff --git a/manifests/project/tar.pp b/manifests/project/tar.pp index 8fa0a57..1144cc5 100644 --- a/manifests/project/tar.pp +++ b/manifests/project/tar.pp @@ -113,32 +113,32 @@ # Puppet runs. Default: 'false' # define puppi::project::tar ( - $source, - $deploy_root, - $init_source = '', - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $clean_deploy = false, - $backup_enable = true, - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $auto_deploy = false, - $verify_ssl = true, - $enable = true ) { - + String $source, + String $deploy_root, + String $init_source = '', + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $clean_deploy = false, + Boolean $backup_enable = true, + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $auto_deploy = false, + Boolean $verify_ssl = true, + Boolean $enable = true, +) { require puppi require puppi::params @@ -170,26 +170,24 @@ if ($verify_ssl) { $ssl_arg = '' - }else{ + }else { $ssl_arg = '-k' } - ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### INIT SEQUENCE if ($init_source != '') { @@ -203,7 +201,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -216,24 +213,24 @@ } } - # Here source file is retrieved - puppi::deploy { "${name}-Retrieve_TarBall": - priority => '20' , - command => 'get_file.sh' , - arguments => "${ssl_arg} -s '${source}' -t tarball -a ${real_always_deploy}" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here source file is retrieved + puppi::deploy { "${name}-Retrieve_TarBall": + priority => '20' , + command => 'get_file.sh' , + arguments => "${ssl_arg} -s '${source}' -t tarball -a ${real_always_deploy}" , + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-PreDeploy_TarBall": - priority => '25' , - command => 'predeploy_tar.sh' , - arguments => 'downloadedfile' , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-PreDeploy_TarBall": + priority => '25' , + command => 'predeploy_tar.sh' , + arguments => 'downloadedfile' , + user => 'root' , + project => $name , + enable => $enable , + } if ($firewall_src_ip != '') { puppi::deploy { "${name}-Load_Balancer_Block": @@ -290,15 +287,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy": - priority => '40' , - command => 'deploy_files.sh' , - arguments => "-d ${deploy_root} -c ${bool_clean_deploy}", - user => $user , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy": + priority => '40' , + command => 'deploy_files.sh' , + arguments => "-d ${deploy_root} -c ${bool_clean_deploy}", + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -355,7 +352,6 @@ } } - ### ROLLBACK PROCEDURE if ($bool_backup_enable == true) { @@ -403,14 +399,14 @@ } } - puppi::rollback { "${name}-Recover_Files_To_Deploy": - priority => '40' , - command => 'archive.sh' , - arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , - user => $user , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Recover_Files_To_Deploy": + priority => '40' , + command => 'archive.sh' , + arguments => "-r ${deploy_root} -o '${backup_rsync_options}'" , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::rollback { "${name}-Run_Custom_PostDeploy_Script": @@ -485,5 +481,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/war.pp b/manifests/project/war.pp index 8b7517b..0d5d109 100644 --- a/manifests/project/war.pp +++ b/manifests/project/war.pp @@ -115,32 +115,32 @@ # Puppet runs. Default: 'false' # define puppi::project::war ( - $source, - $deploy_root, - $init_source = '', - $user = 'root', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $clean_deploy = false, - $backup_enable = true, - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $check_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $deploy_root, + String $init_source = '', + String $user = 'root', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $clean_deploy = false, + Boolean $backup_enable = true, + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $check_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -175,22 +175,20 @@ $war_file = url_parse($source,'filename') - ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### INIT SEQUENCE if ($init_source != '') { @@ -204,7 +202,6 @@ } } - ### DEPLOY SEQUENCE if ($bool_run_checks == true) { puppi::deploy { "${name}-Run_PRE-Checks": @@ -217,15 +214,15 @@ } } - # Here source file is retrieved - puppi::deploy { "${name}-Retrieve_WAR": - priority => '20' , - command => 'get_file.sh' , - arguments => "-s '${source}' -a '${real_always_deploy}'" , - user => 'root' , - project => $name , - enable => $enable , - } + # Here source file is retrieved + puppi::deploy { "${name}-Retrieve_WAR": + priority => '20' , + command => 'get_file.sh' , + arguments => "-s '${source}' -a '${real_always_deploy}'" , + user => 'root' , + project => $name , + enable => $enable , + } if ($firewall_src_ip != '') { puppi::deploy { "${name}-Load_Balancer_Block": @@ -247,7 +244,7 @@ project => $name , enable => $enable , } -} + } if ($bool_check_deploy == true) { puppi::deploy { "${name}-Check_undeploy": @@ -293,15 +290,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy_WAR": - priority => '40' , - command => 'deploy_files.sh' , - arguments => "-d '${deploy_root}' -c '${bool_clean_deploy}'", - user => $user , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy_WAR": + priority => '40' , + command => 'deploy_files.sh' , + arguments => "-d '${deploy_root}' -c '${bool_clean_deploy}'", + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -369,11 +366,9 @@ } } - ### ROLLBACK PROCEDURE if ($bool_backup_enable == true) { - if ($firewall_src_ip != '') { puppi::rollback { "${name}-Load_Balancer_Block": priority => '25' , @@ -385,14 +380,14 @@ } } - puppi::rollback { "${name}-Remove_existing_WAR": - priority => '30' , - command => 'delete.sh' , - arguments => "'${deploy_root}/${war_file}'" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Remove_existing_WAR": + priority => '30' , + command => 'delete.sh' , + arguments => "'${deploy_root}/${war_file}'" , + user => 'root' , + project => $name , + enable => $enable , + } if ($bool_check_deploy == true) { puppi::rollback { "${name}-Check_undeploy": @@ -438,14 +433,14 @@ } } - puppi::rollback { "${name}-Recover_Files_To_Deploy": - priority => '40' , - command => 'archive.sh' , - arguments => "-r '${deploy_root}' -t war -o '${backup_rsync_options}'" , - user => $user , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Recover_Files_To_Deploy": + priority => '40' , + command => 'archive.sh' , + arguments => "-r '${deploy_root}' -t war -o '${backup_rsync_options}'" , + user => $user , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::rollback { "${name}-Run_Custom_PostDeploy_Script": @@ -531,5 +526,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/y4maven.pp b/manifests/project/y4maven.pp index 403514d..0117eb5 100644 --- a/manifests/project/y4maven.pp +++ b/manifests/project/y4maven.pp @@ -164,45 +164,45 @@ # Puppet runs. Default: 'false' # define puppi::project::y4maven ( - $source, - $http_user = '', - $http_password = '', - $artifact_type = 'release', - $deploy_root = '', - $user = 'root', - $war_suffix = 'suffixnotset', - $zip_suffix = 'suffixnotset', - $jar_root = '', - $jar_user = '', - $jar_suffix = 'suffixnotset', - $document_root = '', - $document_user = '', - $document_suffix = 'suffixnotset', - $document_init_source = '', - $config_root = '', - $config_user = '', - $config_suffix = 'suffixnotset', - $config_init_source = '', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $init_script = '', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $backup_rsync_options = '--exclude .snapshot', - $backup_retention = '5', - $run_checks = true, - $always_deploy = true, - $check_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $source, + String $http_user = '', + String $http_password = '', + String $artifact_type = 'release', + String $deploy_root = '', + String $user = 'root', + String $war_suffix = 'suffixnotset', + String $zip_suffix = 'suffixnotset', + String $jar_root = '', + String $jar_user = '', + String $jar_suffix = 'suffixnotset', + String $document_root = '', + String $document_user = '', + String $document_suffix = 'suffixnotset', + String $document_init_source = '', + String $config_root = '', + String $config_user = '', + String $config_suffix = 'suffixnotset', + String $config_init_source = '', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $init_script = '', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + String $backup_rsync_options = '--exclude .snapshot', + Variant[String,Integer] $backup_retention = '5', + Boolean $run_checks = true, + Boolean $always_deploy = true, + Boolean $check_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -241,22 +241,20 @@ $bool_check_deploy = any2bool($check_deploy) $bool_auto_deploy = any2bool($auto_deploy) - ### CREATE PROJECT - puppi::project { $name: - source => $source, - deploy_root => $deploy_root, - user => $user, - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - init_script => $init_script, - disable_services => $disable_services, - report_email => $report_email, - enable => $enable, - document_root => $document_root, - config_root => $config_root, - } - + puppi::project { $name: + source => $source, + deploy_root => $deploy_root, + user => $user, + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + init_script => $init_script, + disable_services => $disable_services, + report_email => $report_email, + enable => $enable, + document_root => $document_root, + config_root => $config_root, + } ### INIT SEQUENCE if ($document_init_source != '') { @@ -293,29 +291,29 @@ } } - # First: hybrisServer-Platform - $platform_metadata_arguments = $http_password ? { - '' => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}" , - default => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}" - } + # First: hybrisServer-Platform + $platform_metadata_arguments = $http_password ? { + '' => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}" , + default => "-s ${source}/hybrisServer-Platform/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}" + } - puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-Platform_File": - priority => '20' , - command => 'get_file.sh' , - arguments => $platform_metadata_arguments, - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-Platform_File": + priority => '20' , + command => 'get_file.sh' , + arguments => $platform_metadata_arguments, + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-Extract_Maven_Metadata_hybrisServer-Platform": - priority => '21' , - command => 'get_metadata.sh' , - arguments => "-m ${document_suffix} -mc ${config_suffix} -mj ${jar_suffix} -mw ${war_suffix} -mz ${zip_suffix} -at ${artifact_type}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Extract_Maven_Metadata_hybrisServer-Platform": + priority => '21' , + command => 'get_metadata.sh' , + arguments => "-m ${document_suffix} -mc ${config_suffix} -mj ${jar_suffix} -mw ${war_suffix} -mz ${zip_suffix} -at ${artifact_type}" , + user => 'root' , + project => $name , + enable => $enable , + } # Files retrieval $platform_zipfile_arguments = $http_password ? { @@ -334,29 +332,29 @@ } } - # Second: hybrisServer-AllExtensions - $extensions_metadata_arguments = $http_password ? { - '' => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}", - default => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}", - } + # Second: hybrisServer-AllExtensions + $extensions_metadata_arguments = $http_password ? { + '' => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy}", + default => "-s ${source}/hybrisServer-AllExtensions/maven-metadata.xml -t maven-metadata -a ${real_always_deploy} -u ${http_user} -p ${http_password}", + } - puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-AllExtensions_File": - priority => '23' , - command => 'get_file.sh' , - arguments => $extensions_metadata_arguments, - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Get_Maven_Metadata_hybrisServer-AllExtensions_File": + priority => '23' , + command => 'get_file.sh' , + arguments => $extensions_metadata_arguments, + user => 'root' , + project => $name , + enable => $enable , + } - puppi::deploy { "${name}-Extract_Maven_Metadata_hybrisServer-AllExtensions": - priority => '24' , - command => 'get_metadata.sh' , - arguments => "-m ${document_suffix} -mc ${config_suffix} -mj ${jar_suffix} -mw ${war_suffix} -mz ${zip_suffix} -at ${artifact_type}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::deploy { "${name}-Extract_Maven_Metadata_hybrisServer-AllExtensions": + priority => '24' , + command => 'get_metadata.sh' , + arguments => "-m ${document_suffix} -mc ${config_suffix} -mj ${jar_suffix} -mw ${war_suffix} -mz ${zip_suffix} -at ${artifact_type}" , + user => 'root' , + project => $name , + enable => $enable , + } # Files retrieval if ($deploy_root != '') { @@ -375,7 +373,6 @@ } } - if ($config_root != '') { # Third: config-tarball (optional, right now not supported) $config_metadata_arguments = $http_password ? { @@ -587,7 +584,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -711,7 +707,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -729,5 +724,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/project/yum.pp b/manifests/project/yum.pp index cf48623..8ff155d 100644 --- a/manifests/project/yum.pp +++ b/manifests/project/yum.pp @@ -85,26 +85,26 @@ # Puppet runs. Default: 'false' # define puppi::project::yum ( - $rpm, - $rpm_version = 'latest', - $install_root = '/', - $predeploy_customcommand = '', - $predeploy_user = '', - $predeploy_priority = '39', - $postdeploy_customcommand = '', - $postdeploy_user = '', - $postdeploy_priority = '41', - $disable_services = '', - $firewall_src_ip = '', - $firewall_dst_port = '0', - $firewall_delay = '1', - $report_email = '', - $run_checks = true, - $checks_required = false, - $always_deploy = true, - $auto_deploy = false, - $enable = true ) { - + String $rpm, + String $rpm_version = 'latest', + String $install_root = '/', + String $predeploy_customcommand = '', + String $predeploy_user = '', + Variant[String,Integer] $predeploy_priority = '39', + String $postdeploy_customcommand = '', + String $postdeploy_user = '', + Variant[String,Integer] $postdeploy_priority = '41', + String $disable_services = '', + String $firewall_src_ip = '', + Variant[String,Integer] $firewall_dst_port = '0', + Variant[String,Integer] $firewall_delay = '1', + String $report_email = '', + Boolean $run_checks = true, + Boolean $checks_required = false, + Boolean $always_deploy = true, + Boolean $auto_deploy = false, + Boolean $enable = true, +) { require puppi require puppi::params @@ -133,15 +133,15 @@ $bool_auto_deploy = any2bool($auto_deploy) ### CREATE PROJECT - puppi::project { $name: - predeploy_customcommand => $predeploy_customcommand, - postdeploy_customcommand => $postdeploy_customcommand, - disable_services => $disable_services, - firewall_src_ip => $firewall_src_ip, - firewall_dst_port => $firewall_dst_port, - report_email => $report_email, - enable => $enable, - } + puppi::project { $name: + predeploy_customcommand => $predeploy_customcommand, + postdeploy_customcommand => $postdeploy_customcommand, + disable_services => $disable_services, + firewall_src_ip => $firewall_src_ip, + firewall_dst_port => $firewall_dst_port, + report_email => $report_email, + enable => $enable, + } ### DEPLOY SEQUENCE if ($bool_run_checks == true) { @@ -188,15 +188,15 @@ } } - # Here is done the deploy on $deploy_root - puppi::deploy { "${name}-Deploy": - priority => '40' , - command => 'yum.sh' , - arguments => "-a deploy -n ${rpm} -r ${install_root} -v ${rpm_version}" , - user => root , - project => $name , - enable => $enable , - } + # Here is done the deploy on $deploy_root + puppi::deploy { "${name}-Deploy": + priority => '40' , + command => 'yum.sh' , + arguments => "-a deploy -n ${rpm} -r ${install_root} -v ${rpm_version}" , + user => root , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::deploy { "${name}-Run_Custom_PostDeploy_Script": @@ -242,7 +242,6 @@ } } - ### ROLLBACK PROCEDURE if ($firewall_src_ip != '') { @@ -278,14 +277,14 @@ } } - puppi::rollback { "${name}-Rollback": - priority => '40' , - command => 'yum.sh' , - arguments => "-a rollback -n ${rpm} -r ${install_root} -v ${rpm_version}" , - user => 'root' , - project => $name , - enable => $enable , - } + puppi::rollback { "${name}-Rollback": + priority => '40' , + command => 'yum.sh' , + arguments => "-a rollback -n ${rpm} -r ${install_root} -v ${rpm_version}" , + user => 'root' , + project => $name , + enable => $enable , + } if ($postdeploy_customcommand != '') { puppi::rollback { "${name}-Run_Custom_PostDeploy_Script": @@ -331,7 +330,6 @@ } } - ### REPORTING if ($report_email != '') { @@ -349,5 +347,4 @@ if ($bool_auto_deploy == true) { puppi::run { $name: } } - } diff --git a/manifests/report.pp b/manifests/report.pp index 4f8651e..31d86c3 100644 --- a/manifests/report.pp +++ b/manifests/report.pp @@ -12,13 +12,13 @@ # } # define puppi::report ( - $project, - $command, - $arguments = '', - $priority = '50', - $user = 'root', - $enable = true ) { - + String $project, + String $command, + String $arguments = '', + Variant[String,Integer] $priority = '50', + String $user = 'root', + Boolean $enable = true, +) { require puppi::params # Autoinclude the puppi class @@ -34,5 +34,4 @@ content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", tag => 'puppi_report', } - } diff --git a/manifests/rollback.pp b/manifests/rollback.pp index b09692d..15ad6e4 100644 --- a/manifests/rollback.pp +++ b/manifests/rollback.pp @@ -12,13 +12,13 @@ # } # define puppi::rollback ( - $project, - $command, - $arguments = '', - $priority = '50', - $user = 'root', - $enable = true ) { - + String $project, + String $command, + String $arguments = '', + Variant[String,Integer] $priority = '50', + String $user = 'root', + Boolean $enable = true, +) { require puppi require puppi::params @@ -32,5 +32,4 @@ content => "su - ${user} -c \"export project=${project} && ${puppi::params::scriptsdir}/${command} ${arguments}\"\n", tag => 'puppi_rollback', } - } diff --git a/manifests/run.pp b/manifests/run.pp index 01556d6..ebc03a5 100644 --- a/manifests/run.pp +++ b/manifests/run.pp @@ -15,9 +15,9 @@ # puppi::run { "myapp": } # define puppi::run ( - $project = '', - $timeout = 300) { - + String $project = '', + Integer $timeout = 300, +) { require puppi exec { "Run_Puppi_${name}": @@ -27,5 +27,4 @@ timeout => $timeout, # require => File[ tag == 'puppi_deploy' ], } - } diff --git a/manifests/runscript.pp b/manifests/runscript.pp index 01aa36c..ee20ad8 100644 --- a/manifests/runscript.pp +++ b/manifests/runscript.pp @@ -98,23 +98,23 @@ # } # define puppi::runscript ( - $source = undef, - $content = undef, - $destination_path = '', - $parameters = '', - $autorun = true, - $refreshonly = true, - $creates = undef, - $onlyif = undef, - $unless = undef, - $basedir = '/usr/local/sbin', - $cron = '', - $cron_user = 'root', - $owner = 'root', - $group = 'root', - $mode = '0755', - $ensure = 'present' ) { - + Optional[String] $source = undef, + Optional[String] $content = undef, + String $destination_path = '', + String $parameters = '', + Boolean $autorun = true, + Boolean $refreshonly = true, + Optional[String] $creates = undef, + Optional[String] $onlyif = undef, + Optional[String] $unless = undef, + String $asedir = '/usr/local/sbin', + String $cron = '', + String $cron_user = 'root', + String $owner = 'root', + String $group = 'root', + String $mode = '0755', + String $ensure = 'present', +) { $real_command = $destination_path ? { '' => "${basedir}/${name}", default => $destination_path, diff --git a/manifests/skel.pp b/manifests/skel.pp index 840ed86..23c162a 100644 --- a/manifests/skel.pp +++ b/manifests/skel.pp @@ -4,7 +4,6 @@ # Creates the base Puppi dirs # class puppi::skel { - require puppi::params file { 'puppi_basedir': @@ -143,7 +142,7 @@ # MailPuppiCheck script file { '/usr/bin/mailpuppicheck': - ensure => 'present', + ensure => 'file', mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -152,7 +151,7 @@ # Puppi common scripts file { 'puppi.scripts': - ensure => present, + ensure => file, path => "${puppi::params::scriptsdir}/", mode => '0755', owner => $puppi::params::configfile_owner, diff --git a/manifests/todo.pp b/manifests/todo.pp index 6fff380..f6c7440 100644 --- a/manifests/todo.pp +++ b/manifests/todo.pp @@ -28,11 +28,11 @@ # } # define puppi::todo ( - $description = '', - $notes = '', - $check_command = '', - $run = '' ) { - + String $description = '', + String $notes = '', + String $check_command = '', + String $run = '', +) { require puppi require puppi::params @@ -45,7 +45,7 @@ } file { "${puppi::params::tododir}/${name}": - ensure => present, + ensure => file, mode => '0750', owner => $puppi::params::configfile_owner, group => $puppi::params::configfile_group, @@ -53,5 +53,4 @@ content => template('puppi/todo.erb'), tag => 'puppi_todo', } - } diff --git a/manifests/two.pp b/manifests/two.pp index 1bbe5fc..8954f6a 100644 --- a/manifests/two.pp +++ b/manifests/two.pp @@ -3,11 +3,9 @@ # Installs Puppi NextGen # class puppi::two { - # The Puppi command package { 'puppi': ensure => present, provider => 'gem', } - } diff --git a/manifests/ze.pp b/manifests/ze.pp index 5f62e1d..3d89e1f 100644 --- a/manifests/ze.pp +++ b/manifests/ze.pp @@ -15,11 +15,11 @@ # } # define puppi::ze ( - $variables, - $helper = 'standard', - $filter = '.*content.*|.*password.*', - $ensure = 'present' ) { - + Hash $variables, + String $helper = 'standard', + String $filter = '.*content.*|.*password.*', + String $ensure = 'present', +) { require puppi require puppi::params @@ -31,5 +31,4 @@ group => $puppi::params::configfile_group, content => inline_template("---\n<%= Hash[@variables].reject{ |k,v| k.to_s =~ /(${filter})/ }.keys.sort.map{|k| Array({k => @variables[k]}.to_yaml)[1..-1].join}.join(\"\n\") %>\n"), } - }