Ask Your Question
1

Problem with concat: "Error: Could not set 'present' on ensure: No such file or directory" [closed]

asked 2013-09-27 11:50:26 -0500

robrwo gravatar image

updated 2013-10-01 10:13:10 -0500

I am trying to use concat to combine configuration fragments from several nodes:

$order = fqdn_rand(10000,1000)

@@concat::fragment { "${::fqdn}_my_config":
  target  => '/etc/myconfig.conf',
  content => template('mymodule/node.erb'),
  tag     => 'my_config',
  order   => $order,
}

which is executed on every node. On a server node, the following is executed:

concat{ '/etc/myconfig.conf':
  target => '/etc/myconfig.conf',
  owner => 'root',
  group => 'root',
  mode => '0644',
}

concat::fragment { 'myconf_header':
  target => '/etc/myconfig.conf',
  content => template('mymodule/server.erb'),      
  order => 1,
}

Concat::Fragment <<| tag = 'my_config' |>>

But puppet returns the following errors:

Error: Could not set 'present' on ensure: No such file or directory - /_etc_myconfig.conf ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by robrwo
close date 2013-10-15 11:05:40.172820

Comments

fqdn is a core Facter fact for Puppet. Have you tried just using "${fqdn}_my_config": Also, can you use a notify and output the value of ${::fqdn} to confirm a ...(more)

bmurts gravatar imagebmurts ( 2013-09-28 08:01:48 -0500 )edit

I know about fqdn. The value is being set. But why is the file disappearing?

robrwo gravatar imagerobrwo ( 2013-09-30 03:00:30 -0500 )edit

Fixed typo

robrwo gravatar imagerobrwo ( 2013-10-01 10:13:28 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-10-02 07:39:28 -0500

robrwo gravatar image

I think I've found the cause of the problem. I've added the line

include concat::setup

after a bit of poking around the web, I found that mentioned in http://www.tenshu.net/2010/08/adventures-in-puppet-concat-module.html - that seems to have solved the problem.

edit flag offensive delete link more

Comments

I want to add that this should be added inside a class and not outside of it (like in scala, java or c/c++ imports)

drm509 gravatar imagedrm509 ( 2015-10-14 13:19:42 -0500 )edit
0

answered 2013-09-30 13:10:28 -0500

jonuwz gravatar image

From Github : Since puppet-concat now relies on a fact for the concat directory, you will need to set up pluginsync = true on both the master and client node's '/etc/puppet/puppet.conf' for at least the first run.

You have pluginsync ?

Also, collecting the fragments might be happening before the concat, this might help

Concat ['/etc/myconfig.conf'] -> Concat::Fragment <<| tag = 'my_config' |>>

Finally, i'm assuming

contact{ '/etc/myconfig.conf':

is a cut and paste derp. - That says 'contact' not 'concat' ..

edit flag offensive delete link more

Comments

Yes, pluginsync is enabled on both the master and agent servers. And yes, that was a typo.

robrwo gravatar imagerobrwo ( 2013-10-01 08:08:47 -0500 )edit

Your advice for ordering Concat ['/etc/myconfig.conf'] -> Concat::Fragment <<| tag = 'my_config' |>> Gives an error about it creating a dependency cycle.

robrwo gravatar imagerobrwo ( 2013-10-01 08:11:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-09-27 11:50:26 -0500

Seen: 1,573 times

Last updated: Oct 02 '13