FAQ
I am trying the following to recursively copy a dir while ignoring things
like .hg and a few others.

file {
"/etc/work-related-dir" :
source => "/path/to/masterfiles/work-related-dir",
recurse => 'inf',
owner => '0',
group => '0',
ignore => '{.hg,*.conf~}',
checksum => 'mtime',
backup => false;
}

Running a noop mode tries to copy everything including the one that matches
".hg, *.conf~". If I specify only a single parameter value for ignore, i.e.
".hg", then it doesn't try the copy of .hg directory and works as expected.

Following an earlier post about this, I checked Ruby's globing options,and
found that the pattern I am providing matches multiple files in the source
area.

Any help or suggestion would be appreciated.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/u2yIrhvtie0J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Jcbollinger at Jan 3, 2013 at 2:22 pm

    On Wednesday, January 2, 2013 3:17:39 PM UTC-6, iamauser wrote:
    I am trying the following to recursively copy a dir while ignoring things
    like .hg and a few others.

    file {
    "/etc/work-related-dir" :
    source => "/path/to/masterfiles/work-related-dir",
    recurse => 'inf',
    owner => '0',
    group => '0',
    ignore => '{.hg,*.conf~}',
    checksum => 'mtime',
    backup => false;
    }

    Running a noop mode tries to copy everything including the one that
    matches ".hg, *.conf~". If I specify only a single parameter value for
    ignore, i.e. ".hg", then it doesn't try the copy of .hg directory and works
    as expected.

    Following an earlier post about this, I checked Ruby's globing options,and
    found that the pattern I am providing matches multiple files in the source
    area.
    When you say "you checked Ruby's globbing options", do you mean you
    actually ran the glob against the target directory using the same Ruby that
    the master runs on? It should be pretty easy to do that via irb, just to
    be sure, though I don't actually see a problem with your glob. Since the
    type docs specifically say that the ignore pattern is interpreted via
    Ruby's globbing engine, I suggest you file a ticket if Puppet is including
    files that genuinely match your 'ignore' glob.

    Meanwhile, the Puppet type documentation subtly hints that you may be able
    to pass an array of ignore patterns. I don't know whether that actually
    works, but you could try it instead of glob alternation, i.e. "ignore =>
    ['.hg', '*.conf~']".


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/MkatCFwc9OQJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Iamauser at Jan 3, 2013 at 4:58 pm
    When you say "you checked Ruby's globbing options", do you mean you
    actually ran the glob against the target directory using the same Ruby that
    the master runs on? It should be pretty easy to do that via irb, just to
    be sure, though I don't actually see a problem with your glob. Since the
    type docs specifically say that the ignore pattern is interpreted via
    Ruby's globbing engine, I suggest you file a ticket if Puppet is including
    files that genuinely match your 'ignore' glob.
    Yes, I used irb to test the matching files with the patterns.

    Meanwhile, the Puppet type documentation subtly hints that you may be able
    to pass an array of ignore patterns. I don't know whether that actually
    works, but you could try it instead of glob alternation, i.e. "ignore =>
    ['.hg', '*.conf~']".
    That worked... Thanks for the tips... I believe I tried this earlier, but
    missing a comma somewhere ;)


    John
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DJeBsPq6gooJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Peter Brown at Jan 7, 2013 at 3:32 am
    More a random question than anything.
    I am going to assume the .hg files are from mercurial.
    Assuming this I am wondering why you aren't using something like
    puppetlabs-vcsrepo on puppet forge to deploy the directory via mercurial.
    It seems like a better idea in my brain.

    Pete.
    On 3 January 2013 07:17, iamauser wrote:

    I am trying the following to recursively copy a dir while ignoring things
    like .hg and a few others.

    file {
    "/etc/work-related-dir" :
    source => "/path/to/masterfiles/work-related-dir",
    recurse => 'inf',
    owner => '0',
    group => '0',
    ignore => '{.hg,*.conf~}',
    checksum => 'mtime',
    backup => false;
    }

    Running a noop mode tries to copy everything including the one that
    matches ".hg, *.conf~". If I specify only a single parameter value for
    ignore, i.e. ".hg", then it doesn't try the copy of .hg directory and works
    as expected.

    Following an earlier post about this, I checked Ruby's globing options,and
    found that the pattern I am providing matches multiple files in the source
    area.

    Any help or suggestion would be appreciated.

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/puppet-users/-/u2yIrhvtie0J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/puppet-users?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJan 2, '13 at 9:17p
activeJan 7, '13 at 3:32a
posts4
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase