Ask Your Question

How do you ensure vcsrepo files are not removed by another puppet module?

asked 2017-05-01 15:22:37 -0600

corywink gravatar image

updated 2017-05-02 07:40:01 -0600

DarylW gravatar image

I am currently using puppet to manage logstash with the elastic/logstash module. I am also using puppetlabs/vcsrepo to place the logstash conf files in the logstash/conf.d directory. However, when a puppet run is triggered on the agent, I can see that all of the files that should be in the logstash/conf.d directory are removed. Is there a way to make sure they stay? It looks like the logstash module is removing them to ensure that the conf.d directory is empty.

Here is my manifest:

class profile::logstash {
  class { 'logstash':
    manage_repo       => true,
    restart_on_change => true,
    auto_upgrade      => true,

  vcsrepo { '/etc/logstash/':
    ensure    => latest,
    provider  => git,
    source    => 'OurLogstashRepo',
    user      => 'root',
    revision  => 'staging',
    require   => File['/root/.ssh/id_rsa'],
    force     => true,

  file { '/root/.ssh/id_rsa':
    ensure => file,
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-01 21:32:39 -0600

smarlow gravatar image

You are correct in thinking that the elastic/logstash module is getting rid of the files. This is controlled by the purge_config parameter in the logstash class. You should set it to false if you do not want your config files purged.

It's worth noting also that the module provides logstash::configfile and logstash::patternfile defines for directly managing the configuration.

edit flag offensive delete link more


Thank you very much! This fixed the issue!

corywink gravatar imagecorywink ( 2017-05-03 12:39:54 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-05-01 15:22:37 -0600

Seen: 51 times

Last updated: May 02 '17