Hello World!
\n\n", - } - EOS - apply_manifest(pp, :catch_failures => true) - end - - describe service(service_name) do - it { should be_enabled } - it { should be_running } - end - - describe file("#{mod_dir}/pagespeed.conf") do - it { should contain "AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html" } - it { should contain "ModPagespeedEnableFilters remove_comments" } - it { should contain "ModPagespeedDisableFilters extend_cache" } - it { should contain "ModPagespeedForbidFilters rewrite_javascript" } - end - - it 'should answer to pagespeed.example.com and include-Puppet modules on this server: - - -- Apache - -- MySQL -- -Local sysadmins can also append to the file by just editing /etc/motd.local -their changes will be incorporated into the puppet managed motd. - -```puppet -class motd { - $motd = '/etc/motd' - - concat { $motd: - owner => 'root', - group => 'root', - mode => '0644' - } - - concat::fragment{ 'motd_header': - target => $motd, - content => "\nPuppet modules on this server:\n\n", - order => '01' - } - - # local users on the machine can append to motd by just creating - # /etc/motd.local - concat::fragment{ 'motd_local': - target => $motd, - source => '/etc/motd.local', - order => '15' - } -} - -# used by other modules to register themselves in the motd -define motd::register($content="", $order=10) { - if $content == "" { - $body = $name - } else { - $body = $content - } - - concat::fragment{ "motd_fragment_$name": - target => '/etc/motd', - order => $order, - content => " -- $body\n" - } -} -``` - -To use this you'd then do something like: - -```puppet -class apache { - include apache::install, apache::config, apache::service - - motd::register{ 'Apache': } -} -``` - -##Reference - -###Classes - -####Public classes - -####Private classes -* `concat::setup`: Sets up the concat script/directories. - -###Parameters - -###Defines - -####concat - -#####`ensure` -Controls if the combined file is present or absent. - -######Example -- ensure => present -- ensure => absent - -#####`path` -Controls the destination of the file to create. - -######Example -- path => '/tmp/filename' - -#####`owner` -Set the owner of the combined file. - -######Example -- owner => 'root' - -#####`group` -Set the group of the combined file. - -######Example -- group => 'root' - -#####`mode` -Set the mode of the combined file. - -######Example -- mode => '0644' - -#####`warn` -Determine if a warning message should be added at the top of the file to let -users know it was autogenerated by Puppet. - -######Example -- warn => true -- warn => false - -#####`warn_message` -Set the contents of the warning message. - -######Example -- warn_message => 'This file is autogenerated!' - -#####`force` -Determine if empty files are allowed when no fragments were added. - -######Example -- force => true -- force => false - -#####`backup` -Controls the filebucket behavior used for the file. - -######Example -- backup => 'puppet' - -#####`replace` -Controls if Puppet should replace the destination file if it already exists. - -######Example -- replace => true -- replace => false - -#####`order` -Controls the way in which the shell script chooses to sort the files. It's -rare you'll need to adjust this. - -######Allowed Values -- order => 'alpha' -- order => 'numeric' - -#####`ensure_newline` -Ensure there's a newline at the end of the fragments. - -######Example -- ensure_newline => true -- ensure_newline => false - -####concat::fragment - -#####`target` -Choose the destination file of the fragment. - -######Example -- target => '/tmp/testfile' - -#####`content` -Create the content of the fragment. - -######Example -- content => 'test file contents' - -#####`source` -Find the sources within Puppet of the fragment. - -######Example -- source => 'puppet:///modules/test/testfile' -- source => ['puppet:///modules/test/1', 'puppet:///modules/test/2'] - -#####`order` -Order the fragments. - -######Example -- order => '01' - -#####`ensure` -Control the file of fragment created. - -######Example -- ensure => 'present' -- ensure => 'absent' -- ensure => 'file' -- ensure => 'directory' - -#####`mode` -Set the mode of the fragment. - -######Example -- mode => '0644' - -#####`owner` -Set the owner of the fragment. - -######Example -- owner => 'root' - -#####`group` -Set the group of the fragment. - -######Example -- group => 'root' - -#####`backup` -Control the filebucket behavior for the fragment. - -######Example -- backup => 'puppet' - -### API _deprecations_ - -#### Since version `1.0.0` - -##### `concat{}` `warn` parameter - -```puppet -concat { '/tmp/file': - ensure => present, - warn => 'true', # generates stringified boolean value warning -} -``` - -Using stringified Boolean values as the `warn` parameter to `concat` is -deprecated, generates a catalog compile time warning, and will be silently -treated as the concatenated file header/warning message in a future release. - -The following strings are considered a stringified Boolean value: - - * `'true'` - * `'yes'` - * `'on'` - * `'false'` - * `'no'` - * `'off'` - -Please migrate to using the Puppet DSL's native [Boolean data -type](http://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#booleans). - -##### `concat{}` `gnu` parameter - -```puppet -concat { '/tmp/file': - ensure => present, - gnu => $foo, # generates deprecation warning -} -``` - -The `gnu` parameter to `concat` is deprecated, generates a catalog compile time -warning, and has no effect. This parameter will be removed in a future -release. - -Note that this parameter was silently ignored in the `1.0.0` release. - -##### `concat::fragment{}` `ensure` parameter - -```puppet -concat::fragment { 'cpuinfo': - ensure => '/proc/cpuinfo', # generates deprecation warning - target => '/tmp/file', -} -``` - -Passing a value other than `'present'` or `'absent'` as the `ensure` parameter -to `concat::fragment` is deprecated and generates a catalog compile time -warning. The warning will become a catalog compilation failure in a future -release. - -This type emulates the Puppet core `file` type's disfavored [`ensure` -semantics](http://docs.puppetlabs.com/references/latest/type.html#file-attribute-ensure) -of treating a file path as a directive to create a symlink. This feature is -problematic in several ways. It copies an API semantic of another type that is -both frowned upon and not generally well known. It's behavior may be -surprising in that the target concatenated file will not be a symlink nor is -there any common file system that has a concept of a section of a plain file -being symbolically linked to another file. Additionally, the behavior is -generally inconsistent with most Puppet types in that a missing source file -will be silently ignored. - -If you want to use the content of a file as a fragment please use the `source` -parameter. - -##### `concat::fragment{}` `mode/owner/group` parameters - -```puppet -concat::fragment { 'foo': - target => '/tmp/file', - content => 'foo', - mode => $mode, # generates deprecation warning - owner => $owner, # generates deprecation warning - group => $group, # generates deprecation warning -} -``` - -The `mode` parameter to `concat::fragment` is deprecated, generates a catalog compile time warning, and has no effect. - -The `owner` parameter to `concat::fragment` is deprecated, generates a catalog -compile time warning, and has no effect. - -The `group` parameter to `concat::fragment` is deprecated, generates a catalog -compile time warning, and has no effect. - -These parameters had no user visible effect in version `1.0.0` and will be -removed in a future release. - -##### `concat::fragment{}` `backup` parameter - -```puppet -concat::fragment { 'foo': - target => '/tmp/file', - content => 'foo', - backup => 'bar', # generates deprecation warning -} -``` - -The `backup` parameter to `concat::fragment` is deprecated, generates a catalog -compile time warning, and has no effect. It will be removed in a future -release. - -In the `1.0.0` release this parameter controlled file bucketing of the file -fragment. Bucketting the fragment(s) is redundant with bucketting the final -concatenated file and this feature has been removed. - -##### `class { 'concat::setup': }` - -```puppet -include concat::setup # generates deprecation warning - -class { 'concat::setup: } # generates deprecation warning -``` - -The `concat::setup` class is deprecated as a public API of this module and -should no longer be directly included in the manifest. This class may be -removed in a future release. - -##### Parameter validation - -While not an API depreciation, users should be aware that all public parameters -in this module are now validated for at least variable type. This may cause -validation errors in a manifest that was previously silently misbehaving. - -##Limitations - -This module has been tested on: - -* RedHat Enterprise Linux (and Centos) 5/6 -* Debian 6/7 -* Ubuntu 12.04 - -Testing on other platforms has been light and cannot be guaranteed. - -#Development - -Puppet Labs modules on the Puppet Forge are open projects, and community -contributions are essential for keeping them great. We can’t access the -huge number of platforms and myriad of hardware, software, and deployment -configurations that Puppet is intended to serve. - -We want to keep it as easy as possible to contribute changes so that our -modules work in your environment. There are a few guidelines that we need -contributors to follow so that we can have a chance of keeping on top of things. - -You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) - -###Contributors - -The list of contributors can be found at: - -https://github.com/puppetlabs/puppetlabs-concat/graphs/contributors diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/Rakefile deleted file mode 100644 index 23aea87de25..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/Rakefile +++ /dev/null @@ -1,5 +0,0 @@ -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' - -PuppetLint.configuration.send('disable_80chars') -PuppetLint.configuration.send('disable_quoted_booleans') diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.rb deleted file mode 100755 index 73fd7f9b2d4..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.rb +++ /dev/null @@ -1,137 +0,0 @@ -# Script to concat files to a config file. -# -# Given a directory like this: -# /path/to/conf.d -# |-- fragments -# | |-- 00_named.conf -# | |-- 10_domain.net -# | `-- zz_footer -# -# The script supports a test option that will build the concat file to a temp location and -# use /usr/bin/cmp to verify if it should be run or not. This would result in the concat happening -# twice on each run but gives you the option to have an unless option in your execs to inhibit rebuilds. -# -# Without the test option and the unless combo your services that depend on the final file would end up -# restarting on each run, or in other manifest models some changes might get missed. -# -# OPTIONS: -# -o The file to create from the sources -# -d The directory where the fragments are kept -# -t Test to find out if a build is needed, basically concats the files to a temp -# location and compare with what's in the final location, return codes are designed -# for use with unless on an exec resource -# -w Add a shell style comment at the top of the created file to warn users that it -# is generated by puppet -# -f Enables the creation of empty output files when no fragments are found -# -n Sort the output numerically rather than the default alpha sort -# -# the command: -# -# concatfragments.rb -o /path/to/conffile.cfg -d /path/to/conf.d -# -# creates /path/to/conf.d/fragments.concat and copies the resulting -# file to /path/to/conffile.cfg. The files will be sorted alphabetically -# pass the -n switch to sort numerically. -# -# The script does error checking on the various dirs and files to make -# sure things don't fail. -require 'optparse' -require 'fileutils' - -settings = { - :outfile => "", - :workdir => "", - :test => false, - :force => false, - :warn => "", - :sortarg => "" -} - -OptionParser.new do |opts| - opts.banner = "Usage: #{$0} [options]" - opts.separator "Specific options:" - - opts.on("-o", "--outfile OUTFILE", String, "The file to create from the sources") do |o| - settings[:outfile] = o - end - - opts.on("-d", "--workdir WORKDIR", String, "The directory where the fragments are kept") do |d| - settings[:workdir] = d - end - - opts.on("-t", "--test", "Test to find out if a build is needed") do - settings[:test] = true - end - - opts.separator "Other options:" - opts.on("-w", "--warn WARNMSG", String, - "Add a shell style comment at the top of the created file to warn users that it is generated by puppet") do |w| - settings[:warn] = w - end - - opts.on("-f", "--force", "Enables the creation of empty output files when no fragments are found") do - settings[:force] = true - end - - opts.on("-n", "--sort", "Sort the output numerically rather than the default alpha sort") do - settings[:sortarg] = "-n" - end -end.parse! - -# do we have -o? -raise 'Please specify an output file with -o' unless !settings[:outfile].empty? - -# do we have -d? -raise 'Please specify fragments directory with -d' unless !settings[:workdir].empty? - -# can we write to -o? -if File.file?(settings[:outfile]) - if !File.writable?(settings[:outfile]) - raise "Cannot write to #{settings[:outfile]}" - end -else - if !File.writable?(File.dirname(settings[:outfile])) - raise "Cannot write to dirname #{File.dirname(settings[:outfile])} to create #{settings[:outfile]}" - end -end - -# do we have a fragments subdir inside the work dir? -if !File.directory?(File.join(settings[:workdir], "fragments")) && !File.executable?(File.join(settings[:workdir], "fragments")) - raise "Cannot access the fragments directory" -end - -# are there actually any fragments? -if (Dir.entries(File.join(settings[:workdir], "fragments")) - %w{ . .. }).empty? - if !settings[:force] - raise "The fragments directory is empty, cowardly refusing to make empty config files" - end -end - -Dir.chdir(settings[:workdir]) - -if settings[:warn].empty? - File.open("fragments.concat", 'w') {|f| f.write("") } -else - File.open("fragments.concat", 'w') {|f| f.write("#{settings[:warn]}\n") } -end - -# find all the files in the fragments directory, sort them numerically and concat to fragments.concat in the working dir -open('fragments.concat', 'a') do |f| - Dir.entries("fragments").sort.each{ |entry| - if File.file?(File.join("fragments", entry)) - f << File.read(File.join("fragments", entry)) - end - } -end - -if !settings[:test] - # This is a real run, copy the file to outfile - FileUtils.cp 'fragments.concat', settings[:outfile] -else - # Just compare the result to outfile to help the exec decide - if FileUtils.cmp 'fragments.concat', settings[:outfile] - exit 0 - else - exit 1 - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.sh b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.sh deleted file mode 100755 index 7e6b0f5c565..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/files/concatfragments.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh - -# Script to concat files to a config file. -# -# Given a directory like this: -# /path/to/conf.d -# |-- fragments -# | |-- 00_named.conf -# | |-- 10_domain.net -# | `-- zz_footer -# -# The script supports a test option that will build the concat file to a temp location and -# use /usr/bin/cmp to verify if it should be run or not. This would result in the concat happening -# twice on each run but gives you the option to have an unless option in your execs to inhibit rebuilds. -# -# Without the test option and the unless combo your services that depend on the final file would end up -# restarting on each run, or in other manifest models some changes might get missed. -# -# OPTIONS: -# -o The file to create from the sources -# -d The directory where the fragments are kept -# -t Test to find out if a build is needed, basically concats the files to a temp -# location and compare with what's in the final location, return codes are designed -# for use with unless on an exec resource -# -w Add a shell style comment at the top of the created file to warn users that it -# is generated by puppet -# -f Enables the creation of empty output files when no fragments are found -# -n Sort the output numerically rather than the default alpha sort -# -# the command: -# -# concatfragments.sh -o /path/to/conffile.cfg -d /path/to/conf.d -# -# creates /path/to/conf.d/fragments.concat and copies the resulting -# file to /path/to/conffile.cfg. The files will be sorted alphabetically -# pass the -n switch to sort numerically. -# -# The script does error checking on the various dirs and files to make -# sure things don't fail. - -OUTFILE="" -WORKDIR="" -TEST="" -FORCE="" -WARN="" -SORTARG="" -ENSURE_NEWLINE="" - -PATH=/sbin:/usr/sbin:/bin:/usr/bin - -## Well, if there's ever a bad way to do things, Nexenta has it. -## http://nexenta.org/projects/site/wiki/Personalities -unset SUN_PERSONALITY - -while getopts "o:s:d:tnw:fl" options; do - case $options in - o ) OUTFILE=$OPTARG;; - d ) WORKDIR=$OPTARG;; - n ) SORTARG="-n";; - w ) WARNMSG="$OPTARG";; - f ) FORCE="true";; - t ) TEST="true";; - l ) ENSURE_NEWLINE="true";; - * ) echo "Specify output file with -o and fragments directory with -d" - exit 1;; - esac -done - -# do we have -o? -if [ "x${OUTFILE}" = "x" ]; then - echo "Please specify an output file with -o" - exit 1 -fi - -# do we have -d? -if [ "x${WORKDIR}" = "x" ]; then - echo "Please fragments directory with -d" - exit 1 -fi - -# can we write to -o? -if [ -f "${OUTFILE}" ]; then - if [ ! -w "${OUTFILE}" ]; then - echo "Cannot write to ${OUTFILE}" - exit 1 - fi -else - if [ ! -w `dirname "${OUTFILE}"` ]; then - echo "Cannot write to `dirname \"${OUTFILE}\"` to create ${OUTFILE}" - exit 1 - fi -fi - -# do we have a fragments subdir inside the work dir? -if [ ! -d "${WORKDIR}/fragments" ] && [ ! -x "${WORKDIR}/fragments" ]; then - echo "Cannot access the fragments directory" - exit 1 -fi - -# are there actually any fragments? -if [ ! "$(ls -A """${WORKDIR}/fragments""")" ]; then - if [ "x${FORCE}" = "x" ]; then - echo "The fragments directory is empty, cowardly refusing to make empty config files" - exit 1 - fi -fi - -cd "${WORKDIR}" - -if [ "x${WARNMSG}" = "x" ]; then - : > "fragments.concat" -else - printf '%s\n' "$WARNMSG" > "fragments.concat" -fi - -# find all the files in the fragments directory, sort them numerically and concat to fragments.concat in the working dir -IFS_BACKUP=$IFS -IFS=' -' -for fragfile in `find fragments/ -type f -follow -print0 | xargs -0 -n1 basename | LC_ALL=C sort ${SORTARG}` -do - cat "fragments/$fragfile" >> "fragments.concat" - # Handle newlines. - if [ "x${ENSURE_NEWLINE}" != "x" ]; then - echo >> "fragments.concat" - fi -done -IFS=$IFS_BACKUP - -if [ "x${TEST}" = "x" ]; then - # This is a real run, copy the file to outfile - cp fragments.concat "${OUTFILE}" - RETVAL=$? -else - # Just compare the result to outfile to help the exec decide - cmp "${OUTFILE}" fragments.concat - RETVAL=$? -fi - -exit $RETVAL diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/lib/facter/concat_basedir.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/lib/facter/concat_basedir.rb deleted file mode 100644 index bfac07102de..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/lib/facter/concat_basedir.rb +++ /dev/null @@ -1,11 +0,0 @@ -# == Fact: concat_basedir -# -# A custom fact that sets the default location for fragments -# -# "${::vardir}/concat/" -# -Facter.add("concat_basedir") do - setcode do - File.join(Puppet[:vardir],"concat") - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/fragment.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/fragment.pp deleted file mode 100644 index 40baadd2348..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/fragment.pp +++ /dev/null @@ -1,121 +0,0 @@ -# == Define: concat::fragment -# -# Puts a file fragment into a directory previous setup using concat -# -# === Options: -# -# [*target*] -# The file that these fragments belong to -# [*content*] -# If present puts the content into the file -# [*source*] -# If content was not specified, use the source -# [*order*] -# By default all files gets a 10_ prefix in the directory you can set it to -# anything else using this to influence the order of the content in the file -# [*ensure*] -# Present/Absent or destination to a file to include another file -# [*mode*] -# Deprecated -# [*owner*] -# Deprecated -# [*group*] -# Deprecated -# [*backup*] -# Deprecated -# -define concat::fragment( - $target, - $content = undef, - $source = undef, - $order = 10, - $ensure = undef, - $mode = undef, - $owner = undef, - $group = undef, - $backup = undef -) { - validate_string($target) - validate_string($content) - if !(is_string($source) or is_array($source)) { - fail('$source is not a string or an Array.') - } - validate_string($order) - if $mode { - warning('The $mode parameter to concat::fragment is deprecated and has no effect') - } - if $owner { - warning('The $owner parameter to concat::fragment is deprecated and has no effect') - } - if $group { - warning('The $group parameter to concat::fragment is deprecated and has no effect') - } - if $backup { - warning('The $backup parameter to concat::fragment is deprecated and has no effect') - } - if $ensure == undef { - $_ensure = getparam(Concat[$target], 'ensure') - } else { - if ! ($ensure in [ 'present', 'absent' ]) { - warning('Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated. If you want to use the content of a file as a fragment please use the $source parameter.') - } - $_ensure = $ensure - } - - include concat::setup - - $safe_name = regsubst($name, '[/:\n]', '_', 'GM') - $safe_target_name = regsubst($target, '[/:\n]', '_', 'GM') - $concatdir = $concat::setup::concatdir - $fragdir = "${concatdir}/${safe_target_name}" - $fragowner = $concat::setup::fragment_owner - $fragmode = $concat::setup::fragment_mode - - # The file type's semantics are problematic in that ensure => present will - # not over write a pre-existing symlink. We are attempting to provide - # backwards compatiblity with previous concat::fragment versions that - # supported the file type's ensure => /target syntax - - # be paranoid and only allow the fragment's file resource's ensure param to - # be file, absent, or a file target - $safe_ensure = $_ensure ? { - '' => 'file', - undef => 'file', - 'file' => 'file', - 'present' => 'file', - 'absent' => 'absent', - default => $_ensure, - } - - # if it looks line ensure => /target syntax was used, fish that out - if ! ($_ensure in ['', 'present', 'absent', 'file' ]) { - $ensure_target = $_ensure - } else { - $ensure_target = undef - } - - # the file type's semantics only allows one of: ensure => /target, content, - # or source - if ($ensure_target and $source) or - ($ensure_target and $content) or - ($source and $content) { - fail('You cannot specify more than one of $content, $source, $ensure => /target') - } - - if ! ($content or $source or $ensure_target) { - crit('No content, source or symlink specified') - } - - # punt on group ownership until some point in the distant future when $::gid - # can be relied on to be present - file { "${fragdir}/fragments/${order}_${safe_name}": - ensure => $safe_ensure, - owner => $fragowner, - mode => $fragmode, - source => $source, - content => $content, - backup => false, - alias => "concat_fragment_${name}", - notify => Exec["concat_${target}"] - } -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/init.pp deleted file mode 100644 index 91d82ebd3e5..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/init.pp +++ /dev/null @@ -1,232 +0,0 @@ -# == Define: concat -# -# Sets up so that you can use fragments to build a final config file, -# -# === Options: -# -# [*ensure*] -# Present/Absent -# [*path*] -# The path to the final file. Use this in case you want to differentiate -# between the name of a resource and the file path. Note: Use the name you -# provided in the target of your fragments. -# [*owner*] -# Who will own the file -# [*group*] -# Who will own the file -# [*mode*] -# The mode of the final file -# [*force*] -# Enables creating empty files if no fragments are present -# [*warn*] -# Adds a normal shell style comment top of the file indicating that it is -# built by puppet -# [*force*] -# [*backup*] -# Controls the filebucketing behavior of the final file and see File type -# reference for its use. Defaults to 'puppet' -# [*replace*] -# Whether to replace a file that already exists on the local system -# [*order*] -# [*ensure_newline*] -# [*gnu*] -# Deprecated -# -# === Actions: -# * Creates fragment directories if it didn't exist already -# * Executes the concatfragments.sh script to build the final file, this -# script will create directory/fragments.concat. Execution happens only -# when: -# * The directory changes -# * fragments.concat != final destination, this means rebuilds will happen -# whenever someone changes or deletes the final file. Checking is done -# using /usr/bin/cmp. -# * The Exec gets notified by something else - like the concat::fragment -# define -# * Copies the file over to the final destination using a file resource -# -# === Aliases: -# -# * The exec can notified using Exec["concat_/path/to/file"] or -# Exec["concat_/path/to/directory"] -# * The final file can be referenced as File["/path/to/file"] or -# File["concat_/path/to/file"] -# -define concat( - $ensure = 'present', - $path = $name, - $owner = undef, - $group = undef, - $mode = '0644', - $warn = false, - $force = false, - $backup = 'puppet', - $replace = true, - $order = 'alpha', - $ensure_newline = false, - $gnu = undef -) { - validate_re($ensure, '^present$|^absent$') - validate_absolute_path($path) - validate_string($owner) - validate_string($group) - validate_string($mode) - if ! (is_string($warn) or $warn == true or $warn == false) { - fail('$warn is not a string or boolean') - } - validate_bool($force) - validate_string($backup) - validate_bool($replace) - validate_re($order, '^alpha$|^numeric$') - validate_bool($ensure_newline) - if $gnu { - warning('The $gnu parameter to concat is deprecated and has no effect') - } - - include concat::setup - - $safe_name = regsubst($name, '[/:]', '_', 'G') - $concatdir = $concat::setup::concatdir - $fragdir = "${concatdir}/${safe_name}" - $concat_name = 'fragments.concat.out' - $script_command = $concat::setup::script_command - $default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.' - $bool_warn_message = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release' - - case $warn { - true: { - $warn_message = $default_warn_message - } - 'true', 'yes', 'on': { - warning($bool_warn_message) - $warn_message = $default_warn_message - } - false: { - $warn_message = '' - } - 'false', 'no', 'off': { - warning($bool_warn_message) - $warn_message = '' - } - default: { - $warn_message = $warn - } - } - - $warnmsg_escaped = regsubst($warn_message, '\'', '\'\\\'\'', 'G') - $warnflag = $warnmsg_escaped ? { - '' => '', - default => "-w '${warnmsg_escaped}'" - } - - $forceflag = $force ? { - true => '-f', - false => '', - } - - $orderflag = $order ? { - 'numeric' => '-n', - 'alpha' => '', - } - - $newlineflag = $ensure_newline ? { - true => '-l', - false => '', - } - - File { - backup => false, - } - - if $ensure == 'present' { - file { $fragdir: - ensure => directory, - mode => '0750', - } - - file { "${fragdir}/fragments": - ensure => directory, - mode => '0750', - force => true, - ignore => ['.svn', '.git', '.gitignore'], - notify => Exec["concat_${name}"], - purge => true, - recurse => true, - } - - file { "${fragdir}/fragments.concat": - ensure => present, - mode => '0640', - } - - file { "${fragdir}/${concat_name}": - ensure => present, - mode => '0640', - } - - file { $name: - ensure => present, - owner => $owner, - group => $group, - mode => $mode, - replace => $replace, - path => $path, - alias => "concat_${name}", - source => "${fragdir}/${concat_name}", - backup => $backup, - } - - # remove extra whitespace from string interpolation to make testing easier - $command = strip(regsubst("${script_command} -o \"${fragdir}/${concat_name}\" -d \"${fragdir}\" ${warnflag} ${forceflag} ${orderflag} ${newlineflag}", '\s+', ' ', 'G')) - - # if puppet is running as root, this exec should also run as root to allow - # the concatfragments.sh script to potentially be installed in path that - # may not be accessible by a target non-root owner. - exec { "concat_${name}": - alias => "concat_${fragdir}", - command => $command, - notify => File[$name], - subscribe => File[$fragdir], - unless => "${command} -t", - path => $::path, - require => [ - File[$fragdir], - File["${fragdir}/fragments"], - File["${fragdir}/fragments.concat"], - ], - } - } else { - file { [ - $fragdir, - "${fragdir}/fragments", - "${fragdir}/fragments.concat", - "${fragdir}/${concat_name}" - ]: - ensure => absent, - force => true, - } - - file { $path: - ensure => absent, - backup => $backup, - } - - $absent_exec_command = $::kernel ? { - 'windows' => 'cmd.exe /c exit 0', - default => 'true', - } - - $absent_exec_path = $::kernel ? { - 'windows' => $::path, - default => '/bin:/usr/bin', - } - - exec { "concat_${name}": - alias => "concat_${fragdir}", - command => $absent_exec_command, - path => $absent_exec_path - } - } -} - -# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/setup.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/setup.pp deleted file mode 100644 index 17674003cef..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/manifests/setup.pp +++ /dev/null @@ -1,58 +0,0 @@ -# === Class: concat::setup -# -# Sets up the concat system. This is a private class. -# -# [$concatdir] -# is where the fragments live and is set on the fact concat_basedir. -# Since puppet should always manage files in $concatdir and they should -# not be deleted ever, /tmp is not an option. -# -# It also copies out the concatfragments.sh file to ${concatdir}/bin -# -class concat::setup { - if $caller_module_name != $module_name { - warning("${name} is deprecated as a public API of the ${module_name} module and should no longer be directly included in the manifest.") - } - - if $::concat_basedir { - $concatdir = $::concat_basedir - } else { - fail ('$concat_basedir not defined. Try running again with pluginsync=true on the [master] and/or [main] section of your node\'s \'/etc/puppet/puppet.conf\'.') - } - - # owner and mode of fragment files (on windows owner and access rights should be inherited from concatdir and not explicitly set to avoid problems) - $fragment_owner = $osfamily ? { 'windows' => undef, default => $::id } - $fragment_mode = $osfamily ? { 'windows' => undef, default => '0640' } - - $script_name = $::kernel ? { - 'windows' => 'concatfragments.rb', - default => 'concatfragments.sh' - } - - $script_path = "${concatdir}/bin/${script_name}" - - $script_owner = $osfamily ? { 'windows' => undef, default => $::id } - - $script_mode = $osfamily ? { 'windows' => undef, default => '0755' } - - $script_command = $::kernel ? { - 'windows' => "ruby.exe ${script_path}", - default => $script_path - } - - File { - backup => false, - } - - file { $script_path: - ensure => file, - owner => $script_owner, - mode => $script_mode, - source => "puppet:///modules/concat/${script_name}", - } - - file { [ $concatdir, "${concatdir}/bin" ]: - ensure => directory, - mode => '0755', - } -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/backup_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/backup_spec.rb deleted file mode 100644 index 7b2858d8e90..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/backup_spec.rb +++ /dev/null @@ -1,101 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat backup parameter' do - context '=> puppet' do - before :all do - shell('rm -rf /tmp/concat') - shell('mkdir -p /tmp/concat') - shell("/bin/echo 'old contents' > /tmp/concat/file") - end - - pp = <<-EOS - concat { '/tmp/concat/file': - backup => 'puppet', - } - concat::fragment { 'new file': - target => '/tmp/concat/file', - content => 'new contents', - } - EOS - - it 'applies the manifest twice with "Filebucketed" stdout and no stderr' do - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stderr).to eq("") - expect(r.stdout).to match(/Filebucketed \/tmp\/concat\/file to puppet with sum 0140c31db86293a1a1e080ce9b91305f/) # sum is for file contents of 'old contents' - end - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'new contents' } - end - end - - context '=> .backup' do - before :all do - shell('rm -rf /tmp/concat') - shell('mkdir -p /tmp/concat') - shell("/bin/echo 'old contents' > /tmp/concat/file") - end - - pp = <<-EOS - concat { '/tmp/concat/file': - backup => '.backup', - } - concat::fragment { 'new file': - target => '/tmp/concat/file', - content => 'new contents', - } - EOS - - # XXX Puppet doesn't mention anything about filebucketing with a given - # extension like .backup - it 'applies the manifest twice no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'new contents' } - end - describe file('/tmp/concat/file.backup') do - it { should be_file } - it { should contain 'old contents' } - end - end - - # XXX The backup parameter uses validate_string() and thus can't be the - # boolean false value, but the string 'false' has the same effect in Puppet 3 - context "=> 'false'" do - before :all do - shell('rm -rf /tmp/concat') - shell('mkdir -p /tmp/concat') - shell("/bin/echo 'old contents' > /tmp/concat/file") - end - - pp = <<-EOS - concat { '/tmp/concat/file': - backup => '.backup', - } - concat::fragment { 'new file': - target => '/tmp/concat/file', - content => 'new contents', - } - EOS - - it 'applies the manifest twice with no "Filebucketed" stdout and no stderr' do - apply_manifest(pp, :catch_failures => true) do |r| - expect(r.stderr).to eq("") - expect(r.stdout).to_not match(/Filebucketed/) - end - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'new contents' } - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/concat_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/concat_spec.rb deleted file mode 100644 index 89919cc53b6..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/concat_spec.rb +++ /dev/null @@ -1,204 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'basic concat test' do - - shared_examples 'successfully_applied' do |pp| - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file("#{default['puppetvardir']}/concat") do - it { should be_directory } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 755 } - end - describe file("#{default['puppetvardir']}/concat/bin") do - it { should be_directory } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 755 } - end - describe file("#{default['puppetvardir']}/concat/bin/concatfragments.sh") do - it { should be_file } - it { should be_owned_by 'root' } - #it { should be_grouped_into 'root' } - it { should be_mode 755 } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file") do - it { should be_directory } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 750 } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments") do - it { should be_directory } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 750 } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments.concat") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments.concat.out") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - end - end - - context 'owner/group root' do - pp = <<-EOS - concat { '/tmp/concat/file': - owner => 'root', - group => 'root', - mode => '0644', - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - order => '02', - } - EOS - - it_behaves_like 'successfully_applied', pp - - describe file('/tmp/concat/file') do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 644 } - it { should contain '1' } - it { should contain '2' } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments/01_1") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments/02_2") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - end - end - - context 'owner/group non-root' do - before(:all) do - shell "groupadd -g 64444 bob" - shell "useradd -u 42 -g 64444 bob" - end - after(:all) do - shell "userdel bob" - end - - pp=" - concat { '/tmp/concat/file': - owner => 'bob', - group => 'bob', - mode => '0644', - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - order => '02', - } - " - - it_behaves_like 'successfully_applied', pp - - describe file('/tmp/concat/file') do - it { should be_file } - it { should be_owned_by 'bob' } - it { should be_grouped_into 'bob' } - it { should be_mode 644 } - it { should contain '1' } - it { should contain '2' } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments/01_1") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - it { should contain '1' } - end - describe file("#{default['puppetvardir']}/concat/_tmp_concat_file/fragments/02_2") do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - it { should be_mode 640 } - it { should contain '2' } - end - end - - context 'ensure' do - context 'works when set to present with path set' do - pp=" - concat { 'file': - ensure => present, - path => '/tmp/concat/file', - mode => '0644', - } - concat::fragment { '1': - target => 'file', - content => '1', - order => '01', - } - " - - it_behaves_like 'successfully_applied', pp - - describe file('/tmp/concat/file') do - it { should be_file } - it { should be_mode 644 } - it { should contain '1' } - end - end - context 'works when set to absent with path set' do - pp=" - concat { 'file': - ensure => absent, - path => '/tmp/concat/file', - mode => '0644', - } - concat::fragment { '1': - target => 'file', - content => '1', - order => '01', - } - " - - # Can't used shared examples as this will always trigger the exec when - # absent is set. - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should_not be_file } - end - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/deprecation_warnings_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/deprecation_warnings_spec.rb deleted file mode 100644 index f139d818c6b..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/deprecation_warnings_spec.rb +++ /dev/null @@ -1,230 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'deprecation warnings' do - - shared_examples 'has_warning'do |pp, w| - it 'applies the manifest twice with a stderr regex' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m) - expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m) - end - end - - context 'concat gnu parameter' do - pp = <<-EOS - concat { '/tmp/concat/file': - gnu => 'foo', - } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - } - EOS - w = 'The $gnu parameter to concat is deprecated and has no effect' - - it_behaves_like 'has_warning', pp, w - end - - context 'concat warn parameter =>' do - ['true', 'yes', 'on'].each do |warn| - context warn do - pp = <<-EOS - concat { '/tmp/concat/file': - warn => '#{warn}', - } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - } - EOS - w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release' - - it_behaves_like 'has_warning', pp, w - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '# This file is managed by Puppet. DO NOT EDIT.' } - it { should contain 'bar' } - end - end - end - - ['false', 'no', 'off'].each do |warn| - context warn do - pp = <<-EOS - concat { '/tmp/concat/file': - warn => '#{warn}', - } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - } - EOS - w = 'Using stringified boolean values (\'true\', \'yes\', \'on\', \'false\', \'no\', \'off\') to represent boolean true/false as the $warn parameter to concat is deprecated and will be treated as the warning message in a future release' - - it_behaves_like 'has_warning', pp, w - - describe file('/tmp/concat/file') do - it { should be_file } - it { should_not contain '# This file is managed by Puppet. DO NOT EDIT.' } - it { should contain 'bar' } - end - end - end - end - - context 'concat::fragment ensure parameter' do - context 'target file exists' do - before(:all) do - shell("/bin/echo 'file1 contents' > /tmp/concat/file1") - end - after(:all) do - # XXX this test may leave behind a symlink in the fragment directory - # which could cause warnings and/or breakage from the subsequent tests - # unless we clean it up. - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - shell('mkdir -p /tmp/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - ensure => '/tmp/concat/file1', - } - EOS - w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated. If you want to use the content of a file as a fragment please use the $source parameter.' - - it_behaves_like 'has_warning', pp, w - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'file1 contents' } - end - - describe 'the fragment can be changed from a symlink to a plain file' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'new content', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'new content' } - it { should_not contain 'file1 contents' } - end - end - end # target file exists - - context 'target does not exist' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - ensure => '/tmp/concat/file1', - } - EOS - w = 'Passing a value other than \'present\' or \'absent\' as the $ensure parameter to concat::fragment is deprecated. If you want to use the content of a file as a fragment please use the $source parameter.' - - it_behaves_like 'has_warning', pp, w - - describe file('/tmp/concat/file') do - it { should be_file } - end - - describe 'the fragment can be changed from a symlink to a plain file' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'new content', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'new content' } - end - end - end # target file exists - - end # concat::fragment ensure parameter - - context 'concat::fragment mode parameter' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - mode => 'bar', - } - EOS - w = 'The $mode parameter to concat::fragment is deprecated and has no effect' - - it_behaves_like 'has_warning', pp, w - end - - context 'concat::fragment owner parameter' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - owner => 'bar', - } - EOS - w = 'The $owner parameter to concat::fragment is deprecated and has no effect' - - it_behaves_like 'has_warning', pp, w - end - - context 'concat::fragment group parameter' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - group => 'bar', - } - EOS - w = 'The $group parameter to concat::fragment is deprecated and has no effect' - - it_behaves_like 'has_warning', pp, w - end - - context 'concat::fragment backup parameter' do - pp = <<-EOS - concat { '/tmp/concat/file': } - concat::fragment { 'foo': - target => '/tmp/concat/file', - content => 'bar', - backup => 'bar', - } - EOS - w = 'The $backup parameter to concat::fragment is deprecated and has no effect' - - it_behaves_like 'has_warning', pp, w - end - - context 'include concat::setup' do - pp = <<-EOS - include concat::setup - EOS - w = 'concat::setup is deprecated as a public API of the concat module and should no longer be directly included in the manifest.' - - it_behaves_like 'has_warning', pp, w - end - -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/empty_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/empty_spec.rb deleted file mode 100644 index 09995282a33..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/empty_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat force empty parameter' do - context 'should run successfully' do - pp = <<-EOS - concat { '/tmp/concat/file': - owner => root, - group => root, - mode => '0644', - force => true, - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should_not contain '1\n2' } - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/fragment_source_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/fragment_source_spec.rb deleted file mode 100644 index 3afd53430db..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/fragment_source_spec.rb +++ /dev/null @@ -1,134 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat::fragment source' do - context 'should read file fragments from local system' do - before(:all) do - shell("/bin/echo 'file1 contents' > /tmp/concat/file1") - shell("/bin/echo 'file2 contents' > /tmp/concat/file2") - end - - pp = <<-EOS - concat { '/tmp/concat/foo': } - - concat::fragment { '1': - target => '/tmp/concat/foo', - source => '/tmp/concat/file1', - } - concat::fragment { '2': - target => '/tmp/concat/foo', - content => 'string1 contents', - } - concat::fragment { '3': - target => '/tmp/concat/foo', - source => '/tmp/concat/file2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/foo') do - it { should be_file } - it { should contain 'file1 contents' } - it { should contain 'string1 contents' } - it { should contain 'file2 contents' } - end - end # should read file fragments from local system - - context 'should create files containing first match only.' do - before(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - shell('mkdir -p /tmp/concat') - shell("/bin/echo 'file1 contents' > /tmp/concat/file1") - shell("/bin/echo 'file2 contents' > /tmp/concat/file2") - end - - pp = <<-EOS - concat { '/tmp/concat/result_file1': - owner => root, - group => root, - mode => '0644', - } - concat { '/tmp/concat/result_file2': - owner => root, - group => root, - mode => '0644', - } - concat { '/tmp/concat/result_file3': - owner => root, - group => root, - mode => '0644', - } - - concat::fragment { '1': - target => '/tmp/concat/result_file1', - source => [ '/tmp/concat/file1', '/tmp/concat/file2' ], - order => '01', - } - concat::fragment { '2': - target => '/tmp/concat/result_file2', - source => [ '/tmp/concat/file2', '/tmp/concat/file1' ], - order => '01', - } - concat::fragment { '3': - target => '/tmp/concat/result_file3', - source => [ '/tmp/concat/file1', '/tmp/concat/file2' ], - order => '01', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - describe file('/tmp/concat/result_file1') do - it { should be_file } - it { should contain 'file1 contents' } - it { should_not contain 'file2 contents' } - end - describe file('/tmp/concat/result_file2') do - it { should be_file } - it { should contain 'file2 contents' } - it { should_not contain 'file1 contents' } - end - describe file('/tmp/concat/result_file3') do - it { should be_file } - it { should contain 'file1 contents' } - it { should_not contain 'file2 contents' } - end - end - - context 'should fail if no match on source.' do - before(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - shell('mkdir -p /tmp/concat') - shell('/bin/rm -rf /tmp/concat/fail_no_source /tmp/concat/nofilehere /tmp/concat/nothereeither') - end - - pp = <<-EOS - concat { '/tmp/concat/fail_no_source': - owner => root, - group => root, - mode => '0644', - } - - concat::fragment { '1': - target => '/tmp/concat/fail_no_source', - source => [ '/tmp/concat/nofilehere', '/tmp/concat/nothereeither' ], - order => '01', - } - EOS - - it 'applies the manifest with resource failures' do - apply_manifest(pp, :expect_failures => true) - end - describe file('/tmp/concat/fail_no_source') do - #FIXME: Serverspec::Type::File doesn't support exists? for some reason. so... hack. - it { should_not be_file } - it { should_not be_directory } - end - end -end - diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/newline_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/newline_spec.rb deleted file mode 100644 index 1e989df2ab1..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/newline_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat ensure_newline parameter' do - context '=> false' do - pp = <<-EOS - concat { '/tmp/concat/file': - ensure_newline => false, - } - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '12' } - end - end - - context '=> true' do - pp = <<-EOS - concat { '/tmp/concat/file': - ensure_newline => true, - } - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - #XXX ensure_newline => true causes changes on every run because the files - #are modified in place. - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain "1\n2\n" } - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml deleted file mode 100644 index f0ae87a5c82..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/aix-71-vcloud.yml +++ /dev/null @@ -1,19 +0,0 @@ -HOSTS: - pe-aix-71-acceptance: - roles: - - master - - dashboard - - database - - agent - - default - platform: aix-7.1-power - hypervisor: aix - ip: pe-aix-71-acceptance.delivery.puppetlabs.net -CONFIG: - type: pe - nfs_server: NONE - consoleport: 443 - datastore: instance0 - folder: Delivery/Quality Assurance/Enterprise/Dynamic - resourcepool: delivery/Quality Assurance/Enterprise/Dynamic - pooling_api: http://vcloud.delivery.puppetlabs.net/ diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml deleted file mode 100644 index 2ad90b86aab..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-59-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-59-x64: - roles: - - master - platform: el-5-x86_64 - box : centos-59-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml deleted file mode 100644 index 7d9242f1b95..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64-pe.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - centos-64-x64: - roles: - - master - - database - - dashboard - platform: el-6-x86_64 - box : centos-64-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: pe diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml deleted file mode 100644 index 05540ed8c5a..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/centos-64-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-64-x64: - roles: - - master - platform: el-6-x86_64 - box : centos-64-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml deleted file mode 100644 index 4c8be42d033..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-607-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - debian-607-x64: - roles: - - master - platform: debian-6-amd64 - box : debian-607-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml deleted file mode 100644 index 19181c123d0..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-70rc1-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - debian-70rc1-x64: - roles: - - master - platform: debian-7-amd64 - box : debian-70rc1-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml deleted file mode 100644 index 3e6a3a9dddf..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/debian-73-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - debian-73-x64.localhost: - roles: - - master - platform: debian-7-amd64 - box : debian-73-x64-virtualbox-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box - hypervisor : vagrant -CONFIG: - log_level: debug - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/default.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/default.yml deleted file mode 100644 index ae812b0aef9..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-64-x64.localdomain: - roles: - - master - platform: el-6-x86_64 - box : centos-65-x64-virtualbox-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml deleted file mode 100644 index 13616498307..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/fedora-18-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - fedora-18-x64: - roles: - - master - platform: fedora-18-x86_64 - box : fedora-18-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml deleted file mode 100644 index 41abe2135e2..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - sles-11-x64.local: - roles: - - master - platform: sles-11-x64 - box : sles-11sp1-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml deleted file mode 100644 index 554c37a505c..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/sles-11sp1-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - sles-11sp1-x64: - roles: - - master - platform: sles-11-x86_64 - box : sles-11sp1-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/sles-11sp1-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml deleted file mode 100644 index 5ca1514e407..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-10044-x64: - roles: - - master - platform: ubuntu-10.04-amd64 - box : ubuntu-server-10044-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml deleted file mode 100644 index d065b304f83..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-12042-x64: - roles: - - master - platform: ubuntu-12.04-amd64 - box : ubuntu-server-12042-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml deleted file mode 100644 index cba1cd04c25..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - ubuntu-server-1404-x64: - roles: - - master - platform: ubuntu-14.04-amd64 - box : puppetlabs/ubuntu-14.04-64-nocm - box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm - hypervisor : vagrant -CONFIG: - log_level : debug - type: git diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/order_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/order_spec.rb deleted file mode 100644 index 8bcb7131ce8..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/order_spec.rb +++ /dev/null @@ -1,137 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat order' do - before(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - shell('mkdir -p /tmp/concat') - end - - context '=> alpha' do - pp = <<-EOS - concat { '/tmp/concat/foo': - order => 'alpha' - } - concat::fragment { '1': - target => '/tmp/concat/foo', - content => 'string1', - } - concat::fragment { '2': - target => '/tmp/concat/foo', - content => 'string2', - } - concat::fragment { '10': - target => '/tmp/concat/foo', - content => 'string10', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/foo') do - it { should be_file } - it { should contain "string10\nstring1\nsring2" } - end - end - - context '=> numeric' do - pp = <<-EOS - concat { '/tmp/concat/foo': - order => 'numeric' - } - concat::fragment { '1': - target => '/tmp/concat/foo', - content => 'string1', - } - concat::fragment { '2': - target => '/tmp/concat/foo', - content => 'string2', - } - concat::fragment { '10': - target => '/tmp/concat/foo', - content => 'string10', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/foo') do - it { should be_file } - it { should contain "string1\nstring2\nsring10" } - end - end -end # concat order - -describe 'concat::fragment order' do - before(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - shell('mkdir -p /tmp/concat') - end - - context '=> reverse order' do - pp = <<-EOS - concat { '/tmp/concat/foo': } - concat::fragment { '1': - target => '/tmp/concat/foo', - content => 'string1', - order => '15', - } - concat::fragment { '2': - target => '/tmp/concat/foo', - content => 'string2', - # default order 10 - } - concat::fragment { '3': - target => '/tmp/concat/foo', - content => 'string3', - order => '1', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/foo') do - it { should be_file } - it { should contain "string3\nstring2\nsring1" } - end - end - - context '=> normal order' do - pp = <<-EOS - concat { '/tmp/concat/foo': } - concat::fragment { '1': - target => '/tmp/concat/foo', - content => 'string1', - order => '01', - } - concat::fragment { '2': - target => '/tmp/concat/foo', - content => 'string2', - order => '02' - } - concat::fragment { '3': - target => '/tmp/concat/foo', - content => 'string3', - order => '03', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/foo') do - it { should be_file } - it { should contain "string1\nstring2\nsring3" } - end - end -end # concat::fragment order diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/quoted_paths_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/quoted_paths_spec.rb deleted file mode 100644 index af352efce83..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/quoted_paths_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'quoted paths' do - before(:all) do - shell('rm -rf "/tmp/concat test" /var/lib/puppet/concat') - shell('mkdir -p "/tmp/concat test"') - end - - context 'path with blanks' do - pp = <<-EOS - concat { '/tmp/concat test/foo': - } - concat::fragment { '1': - target => '/tmp/concat test/foo', - content => 'string1', - } - concat::fragment { '2': - target => '/tmp/concat test/foo', - content => 'string2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat test/foo') do - it { should be_file } - it { should contain "string1\nsring2" } - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/replace_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/replace_spec.rb deleted file mode 100644 index 7b31e09c440..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/replace_spec.rb +++ /dev/null @@ -1,241 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'replacement of' do - context 'file' do - context 'should not succeed' do - before(:all) do - shell('mkdir -p /tmp/concat') - shell('echo "file exists" > /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': - replace => false, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain 'file exists' } - it { should_not contain '1' } - it { should_not contain '2' } - end - end - - context 'should succeed' do - before(:all) do - shell('mkdir -p /tmp/concat') - shell('echo "file exists" > /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': - replace => true, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should_not contain 'file exists' } - it { should contain '1' } - it { should contain '2' } - end - end - end # file - - context 'symlink' do - context 'should not succeed' do - # XXX the core puppet file type will replace a symlink with a plain file - # when using ensure => present and source => ... but it will not when using - # ensure => present and content => ...; this is somewhat confusing behavior - before(:all) do - shell('mkdir -p /tmp/concat') - shell('ln -s /tmp/concat/dangling /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': - replace => false, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_linked_to '/tmp/concat/dangling' } - end - - describe file('/tmp/concat/dangling') do - # XXX serverspec does not have a matcher for 'exists' - it { should_not be_file } - it { should_not be_directory } - end - end - - context 'should succeed' do - # XXX the core puppet file type will replace a symlink with a plain file - # when using ensure => present and source => ... but it will not when using - # ensure => present and content => ...; this is somewhat confusing behavior - before(:all) do - shell('mkdir -p /tmp/concat') - shell('ln -s /tmp/concat/dangling /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': - replace => true, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '1' } - it { should contain '2' } - end - end - end # symlink - - context 'directory' do - context 'should not succeed' do - before(:all) do - shell('mkdir -p /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with stderr for changing to file' do - expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/) - expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/change from directory to file failed/) - end - - describe file('/tmp/concat/file') do - it { should be_directory } - end - end - - # XXX concat's force param currently enables the creation of empty files - # when there are no fragments, and the replace param will only replace - # files and symlinks, not directories. The semantics either need to be - # changed, extended, or a new param introduced to control directory - # replacement. - context 'should succeed', :pending => 'not yet implemented' do - before(:all) do - shell('mkdir -p /tmp/concat/file') - end - after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - pp = <<-EOS - concat { '/tmp/concat/file': - force => true, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '1' } - end - end - end # directory -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/symbolic_name_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/symbolic_name_spec.rb deleted file mode 100644 index 7267f5e6b43..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/symbolic_name_spec.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'symbolic name' do - pp = <<-EOS - concat { 'not_abs_path': - path => '/tmp/concat/file', - } - - concat::fragment { '1': - target => 'not_abs_path', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => 'not_abs_path', - content => '2', - order => '02', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '1' } - it { should contain '2' } - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/warn_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/warn_spec.rb deleted file mode 100644 index cb0b7430dc8..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/acceptance/warn_spec.rb +++ /dev/null @@ -1,97 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'concat warn =>' do - context 'true should enable default warning message' do - pp = <<-EOS - concat { '/tmp/concat/file': - warn => true, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - order => '02', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '# This file is managed by Puppet. DO NOT EDIT.' } - it { should contain '1' } - it { should contain '2' } - end - end - context 'false should not enable default warning message' do - pp = <<-EOS - concat { '/tmp/concat/file': - warn => false, - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - order => '02', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should_not contain '# This file is managed by Puppet. DO NOT EDIT.' } - it { should contain '1' } - it { should contain '2' } - end - end - context '# foo should overide default warning message' do - pp = <<-EOS - concat { '/tmp/concat/file': - warn => '# foo', - } - - concat::fragment { '1': - target => '/tmp/concat/file', - content => '1', - order => '01', - } - - concat::fragment { '2': - target => '/tmp/concat/file', - content => '2', - order => '02', - } - EOS - - it 'applies the manifest twice with no stderr' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to eq("") - expect(apply_manifest(pp, :catch_changes => true).stderr).to eq("") - end - - describe file('/tmp/concat/file') do - it { should be_file } - it { should contain '# foo' } - it { should contain '1' } - it { should contain '2' } - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper.rb deleted file mode 100644 index 2c6f56649ae..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper.rb +++ /dev/null @@ -1 +0,0 @@ -require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper_acceptance.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper_acceptance.rb deleted file mode 100644 index 22bd72f06a5..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/spec_helper_acceptance.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'beaker-rspec/spec_helper' -require 'beaker-rspec/helpers/serverspec' - -unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no' - if hosts.first.is_pe? - install_pe - else - install_puppet - end - hosts.each do |host| - on hosts, "mkdir -p #{host['distmoduledir']}" - end -end - -RSpec.configure do |c| - # Project root - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - - # Readable test descriptions - c.formatter = :documentation - - # Configure all nodes in nodeset - c.before :suite do - # Install module and dependencies - puppet_module_install(:source => proj_root, :module_name => 'concat') - hosts.each do |host| - on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } - end - end - - c.before(:all) do - shell('mkdir -p /tmp/concat') - end - c.after(:all) do - shell('rm -rf /tmp/concat /var/lib/puppet/concat') - end - - c.treat_symbols_as_metadata_keys_with_true_values = true -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/classes/concat_setup_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/classes/concat_setup_spec.rb deleted file mode 100644 index bba455ab91d..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/classes/concat_setup_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'spec_helper' - -describe 'concat::setup', :type => :class do - - shared_examples 'setup' do |concatdir| - concatdir = '/foo' if concatdir.nil? - - let(:facts) {{ :concat_basedir => concatdir }} - - it do - should contain_file("#{concatdir}/bin/concatfragments.sh").with({ - :mode => '0755', - :source => 'puppet:///modules/concat/concatfragments.sh', - :backup => false, - }) - end - - [concatdir, "#{concatdir}/bin"].each do |file| - it do - should contain_file(file).with({ - :ensure => 'directory', - :mode => '0755', - :backup => false, - }) - end - end - end - - context 'facts' do - context 'concat_basedir =>' do - context '/foo' do - it_behaves_like 'setup', '/foo' - end - end - end # facts - - context 'deprecated as a public class' do - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_fragment_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_fragment_spec.rb deleted file mode 100644 index 3b5269e8d56..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_fragment_spec.rb +++ /dev/null @@ -1,267 +0,0 @@ -require 'spec_helper' - -describe 'concat::fragment', :type => :define do - - shared_examples 'fragment' do |title, params| - params = {} if params.nil? - - p = { - :content => nil, - :source => nil, - :order => 10, - :ensure => 'present', - }.merge(params) - - safe_name = title.gsub(/[\/\n]/, '_') - safe_target_name = p[:target].gsub(/[\/\n]/, '_') - concatdir = '/var/lib/puppet/concat' - fragdir = "#{concatdir}/#{safe_target_name}" - id = 'root' - if p[:ensure] == 'absent' - safe_ensure = p[:ensure] - else - safe_ensure = 'file' - end - - let(:title) { title } - let(:facts) {{ :concat_basedir => concatdir, :id => id }} - let(:params) { params } - let(:pre_condition) do - "concat{ '#{p[:target]}': }" - end - - it do - should contain_class('concat::setup') - should contain_concat(p[:target]) - should contain_file("#{fragdir}/fragments/#{p[:order]}_#{safe_name}").with({ - :ensure => safe_ensure, - :owner => id, - :mode => '0640', - :source => p[:source], - :content => p[:content], - :alias => "concat_fragment_#{title}", - :backup => false, - }) - end - end - - context 'title' do - ['0', '1', 'a', 'z'].each do |title| - it_behaves_like 'fragment', title, { - :target => '/etc/motd', - } - end - end # title - - context 'target =>' do - ['./etc/motd', 'etc/motd', 'motd_header'].each do |target| - context target do - it_behaves_like 'fragment', target, { - :target => '/etc/motd', - } - end - end - - context 'false' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) {{ :target => false }} - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # target => - - context 'ensure =>' do - ['present', 'absent'].each do |ens| - context ens do - it_behaves_like 'fragment', 'motd_header', { - :ensure => ens, - :target => '/etc/motd', - } - end - end - - context 'any value other than \'present\' or \'absent\'' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) {{ :ensure => 'invalid', :target => '/etc/motd' }} - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end # ensure => - - context 'content =>' do - ['', 'ashp is our hero'].each do |content| - context content do - it_behaves_like 'fragment', 'motd_header', { - :content => content, - :target => '/etc/motd', - } - end - end - - context 'false' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) {{ :content => false, :target => '/etc/motd' }} - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # content => - - context 'source =>' do - ['', '/foo/bar', ['/foo/bar', '/foo/baz']].each do |source| - context source do - it_behaves_like 'fragment', 'motd_header', { - :source => source, - :target => '/etc/motd', - } - end - end - - context 'false' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) {{ :source => false, :target => '/etc/motd' }} - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string or an Array/) - end - end - end # source => - - context 'order =>' do - ['', '42', 'a', 'z'].each do |order| - context '\'\'' do - it_behaves_like 'fragment', 'motd_header', { - :order => order, - :target => '/etc/motd', - } - end - end - - context 'false' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) {{ :order => false, :target => '/etc/motd' }} - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # order => - - context 'more than one content source' do - error_msg = 'You cannot specify more than one of $content, $source, $ensure => /target' - - context 'ensure => target and source' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) do - { - :target => '/etc/motd', - :ensure => '/foo', - :source => '/bar', - } - end - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m) - end - end - - context 'ensure => target and content' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) do - { - :target => '/etc/motd', - :ensure => '/foo', - :content => 'bar', - } - end - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m) - end - end - - context 'source and content' do - let(:title) { 'motd_header' } - let(:facts) {{ :concat_basedir => '/tmp' }} - let(:params) do - { - :target => '/etc/motd', - :source => '/foo', - :content => 'bar', - } - end - - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m) - end - end - - end # more than one content source - - describe 'deprecated parameter' do - context 'mode =>' do - context '1755' do - it_behaves_like 'fragment', 'motd_header', { - :mode => '1755', - :target => '/etc/motd', - } - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end # mode => - - context 'owner =>' do - context 'apenny' do - it_behaves_like 'fragment', 'motd_header', { - :owner => 'apenny', - :target => '/etc/motd', - } - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end # owner => - - context 'group =>' do - context 'apenny' do - it_behaves_like 'fragment', 'motd_header', { - :group => 'apenny', - :target => '/etc/motd', - } - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end # group => - - context 'backup =>' do - context 'foo' do - it_behaves_like 'fragment', 'motd_header', { - :backup => 'foo', - :target => '/etc/motd', - } - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end # backup => - end # deprecated params - -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_spec.rb deleted file mode 100644 index 9fdd7b26f12..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/defines/concat_spec.rb +++ /dev/null @@ -1,380 +0,0 @@ -require 'spec_helper' - -describe 'concat', :type => :define do - - shared_examples 'concat' do |title, params, id| - params = {} if params.nil? - id = 'root' if id.nil? - - # default param values - p = { - :ensure => 'present', - :path => title, - :owner => nil, - :group => nil, - :mode => '0644', - :warn => false, - :force => false, - :backup => 'puppet', - :replace => true, - :order => 'alpha', - :ensure_newline => false, - }.merge(params) - - safe_name = title.gsub('/', '_') - concatdir = '/var/lib/puppet/concat' - fragdir = "#{concatdir}/#{safe_name}" - concat_name = 'fragments.concat.out' - default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.' - - file_defaults = { - :backup => false, - } - - let(:title) { title } - let(:params) { params } - let(:facts) {{ :concat_basedir => concatdir, :id => id }} - - if p[:ensure] == 'present' - it do - should contain_file(fragdir).with(file_defaults.merge({ - :ensure => 'directory', - :mode => '0750', - })) - end - - it do - should contain_file("#{fragdir}/fragments").with(file_defaults.merge({ - :ensure => 'directory', - :mode => '0750', - :force => true, - :ignore => ['.svn', '.git', '.gitignore'], - :purge => true, - :recurse => true, - })) - end - - [ - "#{fragdir}/fragments.concat", - "#{fragdir}/#{concat_name}", - ].each do |file| - it do - should contain_file(file).with(file_defaults.merge({ - :ensure => 'present', - :mode => '0640', - })) - end - end - - it do - should contain_file(title).with(file_defaults.merge({ - :ensure => 'present', - :owner => p[:owner], - :group => p[:group], - :mode => p[:mode], - :replace => p[:replace], - :path => p[:path], - :alias => "concat_#{title}", - :source => "#{fragdir}/#{concat_name}", - :backup => p[:backup], - })) - end - - cmd = "#{concatdir}/bin/concatfragments.sh " + - "-o \"#{concatdir}/#{safe_name}/fragments.concat.out\" " + - "-d \"#{concatdir}/#{safe_name}\"" - - # flag order: fragdir, warnflag, forceflag, orderflag, newlineflag - if p.has_key?(:warn) - case p[:warn] - when TrueClass - message = default_warn_message - when 'true', 'yes', 'on' - # should generate a stringified boolean warning - message = default_warn_message - when FalseClass - message = nil - when 'false', 'no', 'off' - # should generate a stringified boolean warning - message = nil - else - message = p[:warn] - end - - unless message.nil? - cmd += " -w \'#{message}\'" - end - end - - cmd += " -f" if p[:force] - cmd += " -n" if p[:order] == 'numeric' - cmd += " -l" if p[:ensure_newline] == true - - it do - should contain_exec("concat_#{title}").with({ - :alias => "concat_#{fragdir}", - :command => cmd, - :unless => "#{cmd} -t", - }) - end - else - [ - fragdir, - "#{fragdir}/fragments", - "#{fragdir}/fragments.concat", - "#{fragdir}/#{concat_name}", - ].each do |file| - it do - should contain_file(file).with(file_defaults.merge({ - :ensure => 'absent', - :backup => false, - :force => true, - })) - end - end - - it do - should contain_file(title).with(file_defaults.merge({ - :ensure => 'absent', - :backup => p[:backup], - })) - end - - it do - should contain_exec("concat_#{title}").with({ - :alias => "concat_#{fragdir}", - :command => 'true', - :path => '/bin:/usr/bin', - }) - end - end - end - - context 'title' do - context 'without path param' do - # title/name is the default value for the path param. therefore, the - # title must be an absolute path unless path is specified - ['/foo', '/foo/bar', '/foo/bar/baz'].each do |title| - context title do - it_behaves_like 'concat', '/etc/foo.bar' - end - end - - ['./foo', 'foo', 'foo/bar'].each do |title| - context title do - let(:title) { title } - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not an absolute path/) - end - end - end - end - - context 'with path param' do - ['./foo', 'foo', 'foo/bar'].each do |title| - context title do - it_behaves_like 'concat', title, { :path => '/etc/foo.bar' } - end - end - end - end # title => - - context 'as non-root user' do - it_behaves_like 'concat', '/etc/foo.bar', {}, 'bob' - end - - context 'ensure =>' do - ['present', 'absent'].each do |ens| - context ens do - it_behaves_like 'concat', '/etc/foo.bar', { :ensure => ens } - end - end - - context 'invalid' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :ensure => 'invalid' }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^present$|^absent$"')}/) - end - end - end # ensure => - - context 'path =>' do - context '/foo' do - it_behaves_like 'concat', '/etc/foo.bar', { :path => '/foo' } - end - - ['./foo', 'foo', 'foo/bar', false].each do |path| - context path do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :path => path }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not an absolute path/) - end - end - end - end # path => - - context 'owner =>' do - context 'apenney' do - it_behaves_like 'concat', '/etc/foo.bar', { :owner => 'apenny' } - end - - context 'false' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :owner => false }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # owner => - - context 'group =>' do - context 'apenney' do - it_behaves_like 'concat', '/etc/foo.bar', { :group => 'apenny' } - end - - context 'false' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :group => false }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # group => - - context 'mode =>' do - context '1755' do - it_behaves_like 'concat', '/etc/foo.bar', { :mode => '1755' } - end - - context 'false' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :mode => false }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # mode => - - context 'warn =>' do - [true, false, '# foo'].each do |warn| - context warn do - it_behaves_like 'concat', '/etc/foo.bar', { :warn => warn } - end - end - - context '(stringified boolean)' do - ['true', 'yes', 'on', 'false', 'no', 'off'].each do |warn| - context warn do - it_behaves_like 'concat', '/etc/foo.bar', { :warn => warn } - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end - end - - context '123' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :warn => 123 }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string or boolean/) - end - end - end # warn => - - context 'force =>' do - [true, false].each do |force| - context force do - it_behaves_like 'concat', '/etc/foo.bar', { :force => force } - end - end - - context '123' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :force => 123 }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a boolean/) - end - end - end # force => - - context 'backup =>' do - context 'reverse' do - it_behaves_like 'concat', '/etc/foo.bar', { :backup => 'reverse' } - end - - context 'false' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :backup => false }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) - end - end - end # backup => - - context 'replace =>' do - [true, false].each do |replace| - context replace do - it_behaves_like 'concat', '/etc/foo.bar', { :replace => replace } - end - end - - context '123' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :replace => 123 }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a boolean/) - end - end - end # replace => - - context 'order =>' do - ['alpha', 'numeric'].each do |order| - context order do - it_behaves_like 'concat', '/etc/foo.bar', { :order => order } - end - end - - context 'invalid' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :order => 'invalid' }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape('does not match "^alpha$|^numeric$"')}/) - end - end - end # order => - - context 'ensure_newline =>' do - [true, false].each do |ensure_newline| - context 'true' do - it_behaves_like 'concat', '/etc/foo.bar', { :ensure_newline => ensure_newline} - end - end - - context '123' do - let(:title) { '/etc/foo.bar' } - let(:params) {{ :ensure_newline => 123 }} - it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a boolean/) - end - end - end # ensure_newline => - - describe 'deprecated parameter' do - context 'gnu =>' do - context 'foo' do - it_behaves_like 'concat', '/etc/foo.bar', { :gnu => 'foo'} - - it 'should create a warning' do - pending('rspec-puppet support for testing warning()') - end - end - end - end - -end - -# vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/facts/concat_basedir_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/facts/concat_basedir_spec.rb deleted file mode 100644 index 41bc90f1594..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/spec/unit/facts/concat_basedir_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'spec_helper' - -describe 'concat_basedir', :type => :fact do - before(:each) { Facter.clear } - - context 'Puppet[:vardir] ==' do - it '/var/lib/puppet' do - Puppet.stubs(:[]).with(:vardir).returns('/var/lib/puppet') - Facter.fact(:concat_basedir).value.should == '/var/lib/puppet/concat' - end - - it '/home/apenny/.puppet/var' do - Puppet.stubs(:[]).with(:vardir).returns('/home/apenny/.puppet/var') - Facter.fact(:concat_basedir).value.should == '/home/apenny/.puppet/var/concat' - end - end - -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/fragment.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/fragment.pp deleted file mode 100644 index a2dfaca2905..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/fragment.pp +++ /dev/null @@ -1,19 +0,0 @@ -concat { 'testconcat': - ensure => present, - path => '/tmp/concat', - owner => 'root', - group => 'root', - mode => '0664', -} - -concat::fragment { '1': - target => 'testconcat', - content => '1', - order => '01', -} - -concat::fragment { '2': - target => 'testconcat', - content => '2', - order => '02', -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/init.pp deleted file mode 100644 index fd21427180f..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/concat/tests/init.pp +++ /dev/null @@ -1,7 +0,0 @@ -concat { '/tmp/concat': - ensure => present, - force => true, - owner => 'root', - group => 'root', - mode => '0644', -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/Puppetfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/Puppetfile deleted file mode 100644 index 42968dff1bf..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/Puppetfile +++ /dev/null @@ -1,6 +0,0 @@ -forge "http://forge.puppetlabs.com" - -mod 'php', :git => 'https://github.com/puphpet/puppet-php.git' -mod 'composer', :git => 'https://github.com/puphpet/puppet-composer.git' -mod 'puphpet', :git => 'https://github.com/puphpet/puppet-puphpet.git' -mod 'puppi', :git => 'https://github.com/puphpet/puppi.git' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/README b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/README deleted file mode 100644 index d546e570ab3..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/README +++ /dev/null @@ -1,226 +0,0 @@ -DRUSH PUPPET MODULE -=================== - -This module manages Drush, a command line shell and scripting interface for -Drupal. - -It can install and upgrade Drush from Debian packages or source, as well as -download, enable and disable Drupal modules and themes, build codebases from -Drush makefiles, run arbitrary Drush commands and optionally log its output. - - -DEPENDENCIES ------------- - -None. - - -REQUIREMENTS ------------- - -The Drush Puppet module is designed to work on Debian GNU/Linux systems and -derivatives. It provides rudimentary support for apt-get, but defaults to -letting the OS's default packaging system handle installation. As such, it -should work with other *nix systems, assuming Drush is available for install -in the OS's packaging system, or Drush is installed from source using the -provided 'drush::git' class. - - -INSTALLATION ------------- - -To use this module, follow these directions: - -1. Your modules directory will need all the files included in this - repository placed under a directory called "drush". - -2. To install Drush, add one of these entries to your manifests (such as in - manifests/nodes.pp): - - include drush - - or - - class {'drush': - ensure => latest, - } - - The following parameters are available: - - api: The major version of Drush to install. Currently supports '4' or '5'. - dist: The Debian distribution from which to install via apt-get. Defaults - to 'stable'. Set to false to suppres adding custom sources for install - via apt-get. - ensure: What state the package should be in. Valid values are 'present' - (also called 'installed'), 'absent', 'purged', 'held', of 'latest'. - -2a. To install Drush from source, add one of these entries to your manifests: - - include drush::git::drush - - or - - class {'drush::git::drush': - git_branch => '8.x-6.x', - update => true, - } - - - The following parameters are available: - - git_branch: The git branch to track. - git_tag: The git tag to check out. - git_url: The git URL from which to clone the repository. - update: Whether to update to the latest code with each Puppet run. - Defaults to false. - - -USAGE ------ - -1. To run a Drush command, use the drush::run defined type like so: - - drush::run { '@dev uli --uid=42': } - - The following parameters are all optional: - - command: The command to run. Defaults to the name of the resource. - site_alias: The alias against which to run the command. - options: Options to pass to Drush. - arguments: Arguments to pass to the command. - site_path: The path to the site or code-base in which to run the command. - drush_user: The user under which to execute the command. - drush_home: Set the drush_user's home directory, for alias search paths. - log: Path to the logfile in which to log all Drush output. - creates, unless, onlyif, refreshonly: Control whether the command is - executed at each Puppet run. Identical to these paramaters on the - built-in 'exec' resource. - timeout: The maximum time the command should take, specified in seconds. - Defaults to 300 seconds. Disable the timeout by setting to 0. - paths: provide alternative paths to search for your Drush executable. - -2. To download projects from drupal.org to a site, add lines such as the - following to your manifests: - - drush::dl {'token': - site_path => '/var/aegir/platforms/drupal/sites/example.com', - log => '/var/aegir/drush.log', - } - - The following parameters are all optional: - - type: The type of package to download. Defaults to 'module'. - version: The version of the package to download. - site_path: Operates the same as for drush::run. Set this parameter to avoid - having a package downloaded repeatedly, as it will allow Puppet to see - whether it already exists. Alternatively, do not set this parameter to - have the package continuously updated. - site_alias, options, arguments, drush_user, drush_home, log: All operate - the same as for drush::run. - -3. To enable or disable projects on a Drupal site, add lines such as the following to your - manifests: - - drush::en {'token': - site_alias => '@www.example.com', - } - - drush::dis {'@prod devel, devel-generate':} - - The following parameters are all optional: - - site_alias, options, arguments, site_path, drush_user, drush_home, log: All - operate the same as for drush::run. - -4. To display the status of a site in your Puppet log, add lines such as the - following to your manifests: - - drush::dis {'@prod status': - options => '--full', - } - - The following parameters are all optional: - - site_alias, options, arguments, site_path, drush_user, drush_home, log: All - operate the same as for drush::run. - - -5. To build a Drupal code-base using Drush Make, add lines such as the following to your - manifests: - - drush::make {'/var/aegir/platform/Drupal7': - makefile => '/var/aegir/makefiles/drupal7.make', - } - - There is one required parameter: - - makefile: The path to the makefile to use in building the code-base. - - The following parameters are all optional: - - make_path: The path to build the code-base. Defaults to the name of the - resource. - options, drush_user, drush_home, log: All operate the same as for - drush::run. - - -6. The module also provides a simple way to clone git repos and keep them up- - to-date: - - drush::git { 'git://git.drupal.org:project/provision': - path => '/var/aegir/.drush', - } - - There is one required parameter: - - path: Where to clone the git repo. - - The following parameters are all optional: - - git_branch: The git branch to checkout. - git_tag: The git tag to check out. Overrides 'branch' if also specified. - git_repo: The git repository to clone. Defaults to the resource name. - dir_name: The name of the directory in which to clone the git repo. - update: Run 'git pull -r' in this repo on every Puppet run. - paths: Alternative search paths for your git binary. - - -DEVELOPING ----------- - -The drush::run defined type provides a basis on which to build pretty much any -Drush command imagineable. The other provided commands build upon it to provide -convenience resources for common use-cases. While quite simple, they should -form a good basis for creating your own custom defined types. - -For more complex examples, take a look at the puppet-aegir module, which -extends this API further in the context of the Aegir Hosting System. It can be -found at: - - https://drupal.org/project/puppet-aegir - -Along similar lines, Skynet takes this way too far: - - https://drupal.org/project/skynet - -The drush::git resource is a minimalist general-purpose function to allow -cloning and updating git repositories. It is not intended to be a full-featured -git class/resource. It will not attempt to install git for you either, but this -should be sufficient: - - package {'git':} - -This Puppet module is published under the GNU GPLv2 (General Public License, -Version 2), and as such is, and will always remain, Free Software. Engagement -in the development process by users and other developers is very much appreci- -ated. So, please feel free to post to the issue queue, submit bug reports and -feature requests, and ask questions about how to use or extend it. - - -------------------------------------------------------------------------------- -Current maintainers: Christopher Gervais (mailto:chris@praxis.coop) - Guillaume Boudrias (mailto:gboudrias@praxis.coop) -Original authors: Christopher Gervais (mailto:chris@koumbit.org) - Antoine Beaupré (mailto:anarcat@koumbit.org) -Copyright:: Copyright (c) 2011-2013 Réseau Koumbit Networks -License:: GPLv2 or later diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/apt.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/apt.pp deleted file mode 100644 index 8d7ff585614..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/apt.pp +++ /dev/null @@ -1,49 +0,0 @@ -class drush::apt ( $dist = false, $backports = false) { - - if $backports { - file { "/etc/apt/preferences.d/drush-${backports}.pref": - ensure => 'present', - content => "Package: drush\nPin: release a=${backports}-backports\nPin-Priority: 1001\n", - owner => root, group => root, mode => '0644', - notify => Exec['drush_update_apt'], - } - file { "/etc/apt/sources.list.d/drush-${backports}-backports.list" : - ensure => 'present', - content => "deb http://backports.debian.org/debian-backports ${backports}-backports main", - owner => root, group => root, mode => '0644', - notify => Exec['drush_update_apt'], - } - } - else { - file { [ - "/etc/apt/preferences.d/drush-${backports}.pref", - "/etc/apt/sources.list.d/drush-${backports}-backports.list", - ]: - ensure => 'absent', - notify => Exec['drush_update_apt'], - } - } - - if $dist { - file { "/etc/apt/sources.list.d/drush-${dist}.list" : - ensure => 'present', - content => "deb http://ftp.debian.org/debian ${dist} main", - owner => root, group => root, mode => '0644', - notify => Exec['drush_update_apt'], - before => Exec['drush_apt_update'], - } - } - - exec { 'drush_update_apt': - command => 'apt-get update & sleep 1', - path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ], - refreshonly => true, - } - - exec { 'drush_apt_update': - command => 'apt-get update && /usr/bin/apt-get autoclean', - path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ], - schedule => daily, - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dis.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dis.pp deleted file mode 100644 index 9cbf1bcaabc..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dis.pp +++ /dev/null @@ -1,25 +0,0 @@ -define drush::dis ( - $site_alias = $drush::params::site_alias, - $options = $drush::params::options, - $arguments = $drush::params::arguments, - $site_path = $drush::params::site_path, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log - ) { - - if $arguments { $real_args = $arguments } - else { $real_args = $name } - - drush::run {"drush-dis:${name}": - command => 'pm-disable', - site_alias => $site_alias, - options => $options, - arguments => $real_args, - site_path => $site_path, - drush_user => $drush_user, - drush_home => $drush_home, - log => $log, - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dl.pp deleted file mode 100644 index 89a9a290599..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/dl.pp +++ /dev/null @@ -1,48 +0,0 @@ -define drush::dl ( - $type = 'module', - $site_alias = $drush::params::site_alias, - $options = $drush::params::options, - $arguments = $drush::params::arguments, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log - ) { - - if $arguments { $real_args = $arguments } - else { $real_args = "${name}" } - - # Always download drush extensions without a site alias. - if $type == 'extension' { $real_alias = '@none' } - else { $real_alias = "${site_alias}" } - - drush::run {"drush-dl:${name}": - command => 'pm-download', - site_alias => $real_alias, - options => $options, - arguments => $real_args, - drush_user => $drush_user, - drush_home => $drush_home, - log => $log, - } - - # Add an 'unless' argument depending on the project type. - case $type { - 'module', 'theme': { - Drush::Run["drush-dl:${name}"] { - unless => "drush ${site_alias} pm-list | grep ${name}", - } - } - 'extension': { - Drush::Run["drush-dl:${name}"] { - unless => "[ -d '${drush_home}/.drush/${name}' ]", - } - } - } - - if defined(Drush::Run["drush-en:${name}"]) { - Drush::Run["drush-dl:${name}"] { - before +> Exec["drush-en:${name}"], - } - } -} - diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/en.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/en.pp deleted file mode 100644 index 036074968f5..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/en.pp +++ /dev/null @@ -1,26 +0,0 @@ -define drush::en ( - $site_alias = $drush::params::site_alias, - $options = $drush::params::options, - $arguments = $drush::params::arguments, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log, - $refreshonly = false - ) { - - if $arguments { $real_args = $arguments } - else { $real_args = $name } - - drush::run {"drush-en:${name}": - command => 'pm-enable', - site_alias => $site_alias, - options => $options, - arguments => $real_args, - drush_user => $drush_user, - drush_home => $drush_home, - refreshonly => $refreshonly, - log => $log, - unless => "drush ${site_alias} pm-list --status=enabled | grep ${name}", - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git.pp deleted file mode 100644 index dc0598121bb..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git.pp +++ /dev/null @@ -1,60 +0,0 @@ -define drush::git ( - $path, - $git_branch = '', - $git_tag = '', - $git_repo = false, - $dir_name = false, - $update = false, - $paths = $drush::params::paths, - $user = 'root', - ) { - - # Default to the resource name if no explicit git repo is provided. - if $git_repo { $real_git_repo = $git_repo } - else { $real_git_repo = $name } - - # Figure out the path and directory name. - if $dir_name { - $real_path = "${path}/${dir_name}" - $real_dir = $dir_name - } - else { - # Figure out the name of the cloned into directory from the git repo. - $repo_array = split($real_git_repo, '[/]') - $last_element = $repo_array[-1] - $real_dir = regsubst($last_element, '\.git$', '') - $real_path = "${path}/${real_dir}" - } - - exec {"drush-clone-repo:${name}": - command => "git clone ${real_git_repo} ${real_dir}", - creates => $real_path, - cwd => $path, - user => $user, - path => $paths, - timeout => 0, - } - - # The specific (tag) overrides the general (branch). - if $git_tag { $git_ref = $git_tag } - else { $git_ref = $git_branch } - - if $git_ref { - exec {"drush-checkout-ref:${name}": - command => "git checkout ${git_ref}", - cwd => $real_path, - path => $paths, - require => Exec["drush-clone-repo:${name}"], - } - } - - if $update { - exec {"drush-update-repo:${name}": - command => 'git pull -r', - cwd => $real_path, - path => $paths, - require => Exec["drush-clone-repo:${name}"], - } - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git/drush.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git/drush.pp deleted file mode 100644 index 36680c63f4c..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/git/drush.pp +++ /dev/null @@ -1,61 +0,0 @@ -class drush::git::drush ( - $git_branch = '', - $git_tag = '', - $git_repo = 'https://github.com/drush-ops/drush.git', - $update = false - ) inherits drush::params { - - include php::params - - Exec { path => ['/bin', '/usr/bin', '/usr/local/bin', '/usr/share'], } - - if ! defined(Package['git']) { - package { 'git': - ensure => present, - before => Drush::Git[$git_repo] - } - } - - if ! defined(Class['composer']) { - class { 'composer': - target_dir => '/usr/local/bin', - composer_file => 'composer', - download_method => 'curl', - logoutput => false, - tmp_path => '/tmp', - php_package => "${php::params::module_prefix}cli", - curl_package => 'curl', - suhosin_enabled => false, - } - } - - drush::git { $git_repo : - path => '/usr/share', - git_branch => $git_branch, - git_tag => $git_tag, - update => $update, - } - - composer::exec { 'drush': - cmd => 'install', - cwd => '/usr/share/drush', - require => Drush::Git[$git_repo], - notify => File['symlink drush'], - } - - file { 'symlink drush': - ensure => link, - path => '/usr/bin/drush', - target => '/usr/share/drush/drush', - require => Composer::Exec['drush'], - notify => Exec['first drush run'], - } - - # Needed to download a Pear library - exec { 'first drush run': - command => 'drush cache-clear drush', - refreshonly => true, - require => File['symlink drush'], - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/init.pp deleted file mode 100644 index 53325d537a6..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/init.pp +++ /dev/null @@ -1,33 +0,0 @@ -class drush ( - $api = $drush::params::api, - $dist = $drush::params::dist, - $ensure = $drush::params::ensure - ) inherits drush::params { - - include drush::params - - package { 'drush': - ensure => $ensure, - } - - case $operatingsystem { - /^(Debian|Ubuntu)$/: { - include drush::apt - Package['drush'] { require => Exec['drush_update_apt'] } - } - } - - if $dist { - - Package['drush'] { require => Class['drush::apt'] } - - if $api == 4 { $backports = 'squeeze' } - else { $backports = '' } - - class {'drush::apt': - dist => $dist, - backports => $backports, - } - } -} - diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/make.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/make.pp deleted file mode 100644 index e09efdfbb57..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/make.pp +++ /dev/null @@ -1,26 +0,0 @@ -define drush::make ( - $makefile, - $make_path = false, - $options = $drush::params::options, - $site_path = $drush::params::site_path, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log - ) { - - if $make_path { $real_make_path = $make_path } - else { $real_make_path = $name } - $arguments = "${makefile} ${real_make_path}" - - drush::run {"drush-make:${name}": - command => 'make', - creates => $make_path, - options => $options, - arguments => $arguments, - drush_user => $drush_user, - drush_home => $drush_home, - log => $log, - timeout => 0, - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/params.pp deleted file mode 100644 index 1af2e4ae7cb..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/params.pp +++ /dev/null @@ -1,35 +0,0 @@ -class drush::params { - - case $::operatingsystem { - 'centos', 'redhat': { - $php_cli_package = 'php-cli' - } - 'ubuntu', 'debian': { - $php_cli_package = 'php5-cli' - } - default: { - fail('The puppet-drush module only supports RHEL and Debian systems') - } - } - - $drush_user = 'root' - $drush_home = '/root' - $site_alias = '@none' - $options = '' - $arguments = '' - $api = 5 - $dist = false - $ensure = 'present' - $site_path = false - $log = false - $creates = false - $paths = [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] - - if defined(Class['drush::git::drush']) { - $installed = Class['drush::git::drush'] - } - else { - $installed = Class['drush'] - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/run.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/run.pp deleted file mode 100644 index 2b6c1d255ed..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/run.pp +++ /dev/null @@ -1,57 +0,0 @@ -define drush::run ( - $command = false, - $site_alias = $drush::params::site_alias, - $options = $drush::params::options, - $arguments = $drush::params::arguments, - $site_path = $drush::params::site_path, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log, - $installed = $drush::params::installed, - $creates = $drush::params::creates, - $paths = $drush::params::paths, - $timeout = false, - $unless = false, - $onlyif = false, - $refreshonly = false - ) { - - if $log { $log_output = " >> ${log} 2>&1" } - - if $command { $real_command = $command } - else { $real_command = $name} - - exec {"drush-run:${name}": - command => "drush ${site_alias} --yes ${options} ${real_command} ${arguments} ${log_output}", - user => $drush_user, - group => $drush_user, - path => $paths, - environment => "HOME=${drush_home}", - require => $installed, - } - - if $site_path { - Exec["drush-run:${name}"] { cwd => $site_path } - } - - if $creates { - Exec["drush-run:${name}"] { creates => $creates } - } - - if $timeout { - Exec["drush-run:${name}"] { timeout => $timeout } - } - - if $unless { - Exec["drush-run:${name}"] { unless => $unless } - } - - if $onlyif { - Exec["drush-run:${name}"] { onlyif => $onlyif } - } - - if $refreshonly { - Exec["drush-run:${name}"] { refreshonly => $refreshonly } - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/status.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/status.pp deleted file mode 100644 index 3f7784bd4b3..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/manifests/status.pp +++ /dev/null @@ -1,22 +0,0 @@ -define drush::status ( - $site_alias = $drush::params::site_alias, - $options = $drush::params::options, - $arguments = $drush::params::arguments, - $site_path = $drush::params::site_path, - $drush_user = $drush::params::drush_user, - $drush_home = $drush::params::drush_home, - $log = $drush::params::log - ) { - - drush::run {"drush-status:${name}": - command => 'core-status', - site_alias => $site_alias, - options => $options, - arguments => $arguments, - site_path => $site_path, - drush_user => $drush_user, - drush_home => $drush_home, - log => $log, - } - -} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/.module b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/.module deleted file mode 100644 index e430fc6c1d5..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/.module +++ /dev/null @@ -1 +0,0 @@ -drush diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/Vagrantfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/Vagrantfile deleted file mode 100644 index 6bb52efe911..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/Vagrantfile +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant::Config.run do |config| - config.vm.box = "Debian 6.0.7 x64" - config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210.box" - - config.vm.provision :shell, - :path => "./tests/.ci/vagrant_test.sh" - -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/test.sh b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/test.sh deleted file mode 100644 index 55ab628039f..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/drush/tests/.ci/test.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -echo "Creating test environment..." -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [ -e $SCRIPT_DIR/.module ] -then - MODULE=`cat $SCRIPT_DIR/.module` -else - echo "ERROR: The test script expects the name of the module to be in a file" - echo " called '.module', in the same directory as the test script." - echo $SCRIPT_DIR - exit 1 -fi -cd $SCRIPT_DIR -cd ../.. -if [ -e manifests/init.pp ] -then - MODULE_DIR=`pwd` -else - echo "ERROR: The test script expects to be in
-[section] -thing = X -- -You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both. To keep an option out of the my.cnf file, e.g. when using override_options to revert to a default value, you can pass thing => undef. -If an option needs multiple instances, you can pass an array. For example - -```puppet -$override_options = { - 'mysqld' => { - 'replicate-do-db' => ['base1', 'base2'], - } -} -``` - -will produce - -
-[mysql] -replicate-do-db = base1 -replicate-do-db = base2 -- -###Custom configuration - -To add custom MySQL configuration, drop additional files into -`/etc/mysql/conf.d/`. Dropping files into conf.d allows you to override settings or add additional ones, which is helpful if you choose not to use `override_options` in `mysql::server`. The conf.d location is hardcoded into the my.cnf template file. - -##Reference - -###Classes - -####Public classes -* `mysql::server`: Installs and configures MySQL. -* `mysql::server::account_security`: Deletes default MySQL accounts. -* `mysql::server::monitor`: Sets up a monitoring user. -* `mysql::server::mysqltuner`: Installs MySQL tuner script. -* `mysql::server::backup`: Sets up MySQL backups via cron. -* `mysql::bindings`: Installs various MySQL language bindings. -* `mysql::client`: Installs MySQL client (for non-servers). - -####Private classes -* `mysql::server::install`: Installs packages. -* `mysql::server::config`: Configures MYSQL. -* `mysql::server::service`: Manages service. -* `mysql::server::root_password`: Sets MySQL root password. -* `mysql::server::providers`: Creates users, grants, and databases. -* `mysql::bindings::java`: Installs Java bindings. -* `mysql::bindings::perl`: Installs Perl bindings. -* `mysql::bindings::python`: Installs Python bindings. -* `mysql::bindings::ruby`: Installs Ruby bindings. -* `mysql::client::install`: Installs MySQL client. - -###Parameters - -####mysql::server - -#####`root_password` - -The MySQL root password. Puppet will attempt to set the root password and update `/root/.my.cnf` with it. - -#####`old_root_password` - -The previous root password (**REQUIRED** if you wish to change the root password via Puppet.) - -#####`override_options` - -The hash of override options to pass into MySQL. It can be structured -like a hash in the my.cnf file, so entries look like - -```puppet -$override_options = { - 'section' => { - 'item' => 'thing', - } -} -``` - -For items that you would traditionally represent as: - -
-[section] -thing = X -- -You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both. To keep an option out of the my.cnf file, e.g. when using override_options to revert to a default value, you can pass thing => undef. - -#####`config_file` - -The location of the MySQL configuration file. - -#####`manage_config_file` - -Whether the MySQL configuration file should be managed. - -#####`purge_conf_dir` - -Whether the conf.d directory should be purged. - -#####`restart` - -Whether the service should be restarted when things change. - -#####`root_group` - -What is the group used for root? - -#####`package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`package_name` - -The name of the mysql server package to install. - -#####`remove_default_accounts` - -Boolean to decide if we should automatically include -`mysql::server::account_security`. - -#####`service_enabled` - -Boolean to decide if the service should be enabled. - -#####`service_manage` - -Boolean to decide if the service should be managed. - -#####`service_name` - -The name of the mysql server service. - -#####`service_provider` - -The provider to use to manage the service. - -#####`users` - -Optional hash of users to create, which are passed to [mysql_user](#mysql_user). - -```puppet -$users = { - 'someuser@localhost' => { - ensure => 'present', - max_connections_per_hour => '0', - max_queries_per_hour => '0', - max_updates_per_hour => '0', - max_user_connections => '0', - password_hash => '*F3A2A51A9B0F2BE2468926B4132313728C250DBF', - }, -} -``` - -#####`grants` - -Optional hash of grants, which are passed to [mysql_grant](#mysql_grant). - -```puppet -$grants = { - 'someuser@localhost/somedb.*' => { - ensure => 'present', - options => ['GRANT'], - privileges => ['SELECT', 'INSERT', 'UPDATE', 'DELETE'], - table => 'somedb.*', - user => 'someuser@localhost', - }, -} -``` - -#####`databases` - -Optional hash of databases to create, which are passed to [mysql_database](#mysql_database). - -```puppet -$databases = { - 'somedb' => { - ensure => 'present', - charset => 'utf8', - }, -} -``` - -####mysql::server::backup - -#####`backupuser` - -MySQL user to create for backups. - -#####`backuppassword` - -MySQL user password for backups. - -#####`backupdir` - -Directory to back up into. - -#####`backupdirmode` - -Permissions applied to the backup directory. This parameter is passed directly -to the `file` resource. - -#####`backupdirowner` - -Owner for the backup directory. This parameter is passed directly to the `file` -resource. - -#####`backupdirgroup` - -Group owner for the backup directory. This parameter is passed directly to the -`file` resource. - -#####`backupcompress` - -Boolean to determine if backups should be compressed. - -#####`backuprotate` - -How many days to keep backups for. - -#####`delete_before_dump` - -Boolean to determine if you should cleanup before backing up or after. - -#####`backupdatabases` - -Array of databases to specifically back up. - -#####`file_per_database` - -Whether a separate file be used per database. - -#####`ensure` - -Allows you to remove the backup scripts. Can be 'present' or 'absent'. - -#####`time` - -An array of two elements to set the backup time. Allows ['23', '5'] or ['3', '45'] for HH:MM times. - -#####`postscript` - -A script that is executed at when the backup is finished. This could be used to (r)sync the backup to a central store. This script can be either a single line that is directly executed or a number of lines, when supplied as an array. It could also be one or more externally managed (executable) files. - -####mysql::server::monitor - -#####`mysql_monitor_username` - -The username to create for MySQL monitoring. - -#####`mysql_monitor_password` - -The password to create for MySQL monitoring. - -#####`mysql_monitor_hostname` - -The hostname to allow to access the MySQL monitoring user. - -####mysql::bindings - -#####`java_enable` - -Boolean to decide if the Java bindings should be installed. - -#####`perl_enable` - -Boolean to decide if the Perl bindings should be installed. - -#####`php_enable` - -Boolean to decide if the PHP bindings should be installed. - -#####`python_enable` - -Boolean to decide if the Python bindings should be installed. - -#####`ruby_enable` - -Boolean to decide if the Ruby bindings should be installed. - -#####`java_package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`java_package_name` - -The name of the package to install. - -#####`java_package_provider` - -What provider should be used to install the package. - -#####`perl_package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`perl_package_name` - -The name of the package to install. - -#####`perl_package_provider` - -What provider should be used to install the package. - -#####`python_package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`python_package_name` - -The name of the package to install. - -#####`python_package_provider` - -What provider should be used to install the package. - -#####`ruby_package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`ruby_package_name` - -The name of the package to install. - -#####`ruby_package_provider` - -What provider should be used to install the package. - -####mysql::client - -#####`bindings_enable` - -Boolean to automatically install all bindings. - -#####`package_ensure` - -What to set the package to. Can be 'present', 'absent', or 'x.y.z'. - -#####`package_name` - -What is the name of the mysql client package to install. - -###Defines - -####mysql::db - -Creates a database with a user and assigns some privileges. - -```puppet - mysql::db { 'mydb': - user => 'myuser', - password => 'mypass', - host => 'localhost', - grant => ['SELECT', 'UPDATE'], - } -``` - -###Providers - -####mysql_database - -`mysql_database` can be used to create and manage databases within MySQL. - -```puppet -mysql_database { 'information_schema': - ensure => 'present', - charset => 'utf8', - collate => 'utf8_swedish_ci', -} -mysql_database { 'mysql': - ensure => 'present', - charset => 'latin1', - collate => 'latin1_swedish_ci', -} -``` - -####mysql_user - -`mysql_user` can be used to create and manage user grants within MySQL. - -```puppet -mysql_user { 'root@127.0.0.1': - ensure => 'present', - max_connections_per_hour => '0', - max_queries_per_hour => '0', - max_updates_per_hour => '0', - max_user_connections => '0', -} -``` - -####mysql_grant - -`mysql_grant` can be used to create grant permissions to access databases within -MySQL. To use it you must create the title of the resource as shown below, -following the pattern of `username@hostname/database.table`: - -```puppet -mysql_grant { 'root@localhost/*.*': - ensure => 'present', - options => ['GRANT'], - privileges => ['ALL'], - table => '*.*', - user => 'root@localhost', -} -``` - -##Limitations - -This module has been tested on: - -* RedHat Enterprise Linux 5/6 -* Debian 6/7 -* CentOS 5/6 -* Ubuntu 12.04 - -Testing on other platforms has been light and cannot be guaranteed. - -#Development - -Puppet Labs modules on the Puppet Forge are open projects, and community -contributions are essential for keeping them great. We can’t access the -huge number of platforms and myriad of hardware, software, and deployment -configurations that Puppet is intended to serve. - -We want to keep it as easy as possible to contribute changes so that our -modules work in your environment. There are a few guidelines that we need -contributors to follow so that we can have a chance of keeping on top of things. - -You can read the complete module contribution guide [on the Puppet Labs wiki.](http://projects.puppetlabs.com/projects/module-site/wiki/Module_contributing) - -### Authors - -This module is based on work by David Schmitt. The following contributors have contributed patches to this module (beyond Puppet Labs): - -* Larry Ludwig -* Christian G. Warden -* Daniel Black -* Justin Ellison -* Lowe Schmidt -* Matthias Pigulla -* William Van Hevelingen -* Michael Arnold -* Chris Weyl - diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/Rakefile deleted file mode 100644 index bb60173e570..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/Rakefile +++ /dev/null @@ -1,2 +0,0 @@ -require 'puppetlabs_spec_helper/rake_tasks' -require 'rspec-system/rake_task' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/TODO b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/TODO deleted file mode 100644 index 39132939307..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/TODO +++ /dev/null @@ -1,8 +0,0 @@ -The best that I can tell is that this code traces back to David Schmitt. It has been forked many times since then :) - -1. you cannot add databases to an instance that has a root password -2. you have to specify username as USER@BLAH or it cannot be found -3. mysql_grant does not complain if user does not exist -4. Needs support for pre-seeding on debian -5. the types may need to take user/password -6. rather or not to configure /etc/.my.cnf should be configurable diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/files/mysqltuner.pl b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/files/mysqltuner.pl deleted file mode 100644 index 46cdb7f42f9..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/mysql/files/mysqltuner.pl +++ /dev/null @@ -1,966 +0,0 @@ -#!/usr/bin/perl -w -# mysqltuner.pl - Version 1.2.0 -# High Performance MySQL Tuning Script -# Copyright (C) 2006-2011 Major Hayden - major@mhtx.net -# -# For the latest updates, please visit http://mysqltuner.com/ -# Git repository available at http://github.com/rackerhacker/MySQLTuner-perl -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see
deploy.pp |
- - |
|---|---|
|
-
- ¶
-
- Define: staging::deploy- -The define resource extracts compressed file to a staging location. - -Parameters:- -
Usage:- -
-
- |
-
- define staging::deploy (
- $source,
- $target,
- $staging_path = undef,
- $username = undef,
- $certificate = undef,
- $password = undef,
- $environment = undef,
- $timeout = undef,
- $user = undef,
- $group = undef,
- $creates = undef,
- $unless = undef,
- $onlyif = undef
-) {
-
- staging::file { $name:
- source => $source,
- target => $staging_path,
- username => $username,
- certificate => $certificate,
- password => $password,
- environment => $environment,
- subdir => $caller_module_name,
- timeout => $timeout,
- }
-
- staging::extract { $name:
- target => $target,
- source => $staging_path,
- user => $user,
- group => $group,
- environment => $environment,
- subdir => $caller_module_name,
- creates => $creates,
- unless => $unless,
- onlyif => $onlyif,
- require => Staging::File[$name],
- }
-
-} |
-
extract.pp |
- - |
|---|---|
|
-
- ¶
-
- Define: staging::extract- -Define resource to extract files from staging directories to target directories. - -Parameters:- -
Usage:- -
- |
-
- define staging::extract (
- $target,
- $source = undef,
- $creates = undef,
- $unless = undef,
- $onlyif = undef,
- $user = undef,
- $group = undef,
- $environment = undef,
- $subdir = $caller_module_name
-) {
-
- include staging
-
- if $source {
- $source_path = $source
- } else {
- $source_path = "${staging::path}/${subdir}/${name}"
- } |
-
|
-
- ¶
-
- Use user supplied creates path, set default value if creates, unless or -onlyif is not supplied. - - |
-
- if $creates {
- $creates_path = $creates
- } elsif ! ($unless or $onlyif) {
- if $name =~ /.tar.gz$/ {
- $folder = staging_parse($name, 'basename', '.tar.gz')
- $creates_path = "${target}/${folder}"
- } else {
- $folder = staging_parse($name, 'basename')
- $creates_path = "${target}/${folder}"
- }
- }
-
- if scope_defaults('Exec','path') {
- Exec{
- cwd => $target,
- user => $user,
- group => $group,
- environment => $environment,
- creates => $creates_path,
- unless => $unless,
- onlyif => $onlyif,
- logoutput => on_failure,
- }
- } else {
- Exec{
- path => $::path,
- cwd => $target,
- user => $user,
- group => $group,
- environment => $environment,
- creates => $creates_path,
- unless => $unless,
- onlyif => $onlyif,
- logoutput => on_failure,
- }
- }
-
- case $name {
- /.tar$/: {
- $command = "tar xf ${source_path}"
- }
-
- /(.tgz|.tar.gz)$/: {
- if $::osfamily == 'Solaris' {
- $command = "gunzip -dc < ${source_path} | tar xf - "
- } else {
- $command = "tar xzf ${source_path}"
- }
- }
-
- /.zip$/: {
- $command = "unzip ${source_path}"
- }
-
- /.war$/: {
- $command = "jar xf ${source_path}"
- }
-
- default: {
- fail("staging::extract: unsupported file format ${name}.")
- }
- }
-
- exec { "extract ${name}":
- command => $command,
- }
-} |
-
file.pp |
- - |
|---|---|
|
-
- ¶
-
- Define: staging::file- -Overview:- -Define resource to retrieve files to staging directories. It is -intententionally not replacing files, as these intend to be large binaries -that are versioned. - -Notes:- -If you specify a different staging location, please manage the file - resource as necessary. - -Parameters:- -
Usage:- -
-
- |
-
- define staging::file (
- $source,
- $target = undef,
- $username = undef,
- $certificate = undef,
- $password = undef,
- $environment = undef,
- $timeout = undef,
- $subdir = $caller_module_name
-) {
-
- include staging
-
- if $target {
- $target_file = $target
- $staging_dir = staging_parse($target, 'parent')
- } else {
- $staging_dir = "${staging::path}/${subdir}"
- $target_file = "${staging_dir}/${name}"
-
- if ! defined(File[$staging_dir]) {
- file { $staging_dir:
- ensure=>directory,
- }
- }
- }
-
- Exec {
- path => '/usr/local/bin:/usr/bin:/bin',
- environment => $environment,
- cwd => $staging_dir,
- creates => $target_file,
- timeout => $timeout,
- logoutput => on_failure,
- }
-
- case $source {
- /^\//: {
- file { $target_file:
- source => $source,
- replace => false,
- }
- }
-
- /^puppet:\/\//: {
- file { $target_file:
- source => $source,
- replace => false,
- }
- }
-
- /^http:\/\//: {
- exec { $target_file:
- command => "curl -L -o ${name} ${source}",
- }
- }
-
- /^https:\/\//: {
- if $username {
- $command = "curl -L -o ${name} -u ${username}:${password} ${source}"
- } elsif $certificate {
- $command = "curl -L -o ${name} -E ${certificate}:${password} ${source}"
- } else {
- $command = "curl -L -o ${name} ${source}"
- }
-
- exec { $target_file:
- command => $command,
- }
- }
-
- /^ftp:\/\//: {
- if $username {
- $command = "curl -o ${name} -u ${username}:${password} ${source}"
- } else {
- $command = "curl -o ${name} ${source}"
- }
-
- exec { $target_file:
- command => $command,
- }
- }
-
- default: {
- fail("stage::file: do not recognize source ${source}.")
- }
- }
-
-} |
-
init.pp |
- - |
|---|---|
|
-
- ¶
-
- Class: staging- -This module manages staging and extraction of files from various sources. - -Actions:- -Creates the root staging directory. By default files will be created in a subdirectory matching the caller_module_name. - -/opt/staging/ - -
-
-Parameters:- -
Usage:- -
-
- |
-
- class staging (
- $path = '/opt/staging',
- $owner = '0',
- $group = '0',
- $mode = '0755'
-) {
-
- file { $path:
- ensure => directory,
- owner => $owner,
- group => $group,
- mode => $mode,
- }
-
-} |
-
| t |