Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

source_dir reporting errors on files/directories that exist in /etc/puppet #42

@StFS

Description

@StFS

Hi.

I was trying to specify the source_dir parameter to put a set of configuration files into /etc/puppet/. I have files and directories there already that I don't want to change so I specified source_dir_purge => false as well. You can see my site.pp file below.

So, in /etc/puppet/environments/production/modules/data/files/puppet/conf/ I have the following files: auth.conf fileserver.conf puppet.conf tagmail.conf

In /etc/puppet I have roughly the following structure:

/etc/puppet/
      +- environments/
      |        +- production/  # contains manifests/ and modules/ dirs from git
      |        +- test/        # contains manifests/ and modules/ dirs from git
      +- ssl/                  # contains puppet certificates
      +- foo.txt               # just some file I want to keep there
      +-.git/                  # my puppet conf is in a git repo
      +- puppet.conf
      +- auth.conf
      +- fileserver.conf
      +- tagmail.conf

What I want is for the puppet module to install the files that are present in my /etc/puppet/environments/production/modules/data/files/puppet/conf/ directory into the /etc/puppet/ directory but leave all the other files and directories in there in peace.

What happens when I run puppet is I get a bunch of warnings and errors relating to the files that are in /etc/puppet (but not in /etc/puppet/environments/production/modules/data/files/puppet/conf/).

An example of this is the following:

Info: Applying configuration version '1366838929'
Notice: /File[puppet.dir]: Not removing directory; use 'force' to override
Notice: /File[puppet.dir]: Not removing directory; use 'force' to override
Error: Could not rename temporary file /etc/puppet.puppettmp_413 to /etc/puppet: Is a directory - /etc/puppet.puppettmp_413 or /etc/puppet
Error: /File[puppet.dir]/ensure: change from directory to file failed: Could not rename temporary file /etc/puppet.puppettmp_413 to /etc/puppet: Is a directory - /etc/puppet.puppettmp_413 or /etc/puppet
Notice: /File[/etc/puppet/ssl]: Dependency File[puppet.dir] has failures: true
Warning: /File[/etc/puppet/ssl]: Skipping because of failed dependencies
Notice: /File[/etc/puppet/.git]: Dependency File[puppet.dir] has failures: true
Warning: /File[/etc/puppet/.git]: Skipping because of failed dependencies

I seem to get one Notice and one Warning line for each file that exists in /etc/puppet/ (and/or subdirectories) and doesn't exist in /etc/puppet/environments/production/modules/data/files/puppet/conf/. I do not get these lines for files that do exist there.

My site.pp:

class base_nopuppet {
  include openssh
  class { 'sudo':
    source => [ "puppet:///modules/data/sudo/sudo.conf-${hostname}" , "puppet:///modules/data/sudo/sudo.conf" ],
  }
  class { 'mailx':
    source => [ "puppet:///modules/data/mailx/mailx.conf-${hostname}" , "puppet:///modules/data/mailx/mailx.conf" ],
  }
}

class base {
  include base_nopuppet
  class { 'puppet':
    source_dir => 'puppet:///modules/data/puppet/conf/',
    source_dir_purge => false,
    template => absent,
  }
}

node default {
  include base
}

node 'puppet.cs.ru.is' {
  include base_nopuppet

  class { 'puppet':
    mode => 'server',
    source_dir => 'puppet:///modules/data/puppet/conf/',
    source_dir_purge => false,                                               
    template => absent,                                                          
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions