In 
http://groups.google.com/group/puppet-users/browse_thread/thread/1dc2dbac1f6cc0de?hl=en
I was asking about pushing passwd.db out to clients, and James pointed 
me to Exported Resources. I've read up on Exported Resources, but I'm 
not getting where I want. The wiki has
http://reductivelabs.com/trac/puppet/wiki/ExportedResources#file-example

which shows definining some content on node-a, and it appearing on node-b.

For my passwd.db I don't want to define the content of the file within 
the puppet manifest. I want a script to generate the file on one server, 
and then make that file available elsewhere.

So I did a test. On chiraz-60 I created /var/tmp/nss.db with the content 
'test'.

Then I defined:

node 'chiraz-60.trinity.unimelb.edu.au' inherits default {
     @@file { "/var/tmp/nss.db": tag => "nss-db-file", }
}
node 'test-db-01.trinity.unimelb.edu.au' inherits default {
     File <<| tag == 'nss-db-file' |>>
}

And after running puppetd --test on both a few times, the files haven't 
shown up on test-db-01.

So I tried something else. I thought maybe if on chiraz-60 I defined a 
file with source from that machine, I could get there:

node 'chiraz-60.trinity.unimelb.edu.au' inherits default {
     @@file { "/var/tmp/nss2.db":
         tag => "nss-db-file",
         source => "/var/tmp/nss.db",
     }
}
node 'test-db-01.trinity.unimelb.edu.au' inherits default {
     File <<| tag == 'nss-db-file' |>>
}


But then when running 'puppetd --test' on test-db-01 I see:
err: //Node[test-db-01.trinity.unimelb.edu.au]/File[/var/tmp/nss2.db]: 
Failed to retrieve current state of resource: No specified source was 
found from /var/tmp/nss.db


Another approach would be:
node 'chiraz-60.trinity.unimelb.edu.au' inherits default {
     @@file { "/var/tmp/nss.db":
         tag => "nss-db-file",
         source => "puppet:///nss.db",
     }
}
And on the puppet master install a cronjob that updates that file, where 
ever nss.db might be on the filesystem. But I'd prefer not to do this 
because my manifest is in svn, and the cronjob would be creating files 
inside an svn working directory that were not under revision control. 
Also, I'd prefer the generation of nss.db to happen on the ldap master, 
rather than on the puppet master.

-- 
+-Geoff Crompton
+--Debian System Administrator
+---Trinity College

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to