Ask Your Question
0

reading file contents on an agent

asked 2015-03-07 08:09:57 -0500

Gintas gravatar image

Hi,

What would be the best way to read file contents on a node and transfer it to other nodes?

My puppet agent is an openvpn server, thus I want to generate VPN certificates for clients and then to distribute them across VPN clients (other puppet nodes).

The only working solution I have managed to come up with is to move OpenVPN server to Puppet master. However, this might not be flexible enough in the future.

Thanks, Gin

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-09 16:32:18 -0500

lorcutt gravatar image

You could define a fact on a client based on the contents of a file. The manifest for the client could then use that data in a virtual class declaration with the @@ syntax ( see https://docs.puppetlabs.com/guides/virtual_resources.html ). The class could then be instantiated on another server.

This is pretty general, but the concept should work.

Hope that helps.

edit flag offensive delete link more

Comments

Thanks lorcutt. So if I have a set of certificates, my custom fact could then produce a hash (e.g. [cert_name, cert]) for each available certificate and then I could populate them across the cluster. Probably the best solution.

Gintas gravatar imageGintas ( 2015-03-09 17:04:16 -0500 )edit

But I hope this method imposes a restriction on file name to read. The file name has to hard coded in the facter definition.

vinodh.basavani gravatar imagevinodh.basavani ( 2017-01-10 00:30:02 -0500 )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

Stats

Asked: 2015-03-07 08:09:57 -0500

Seen: 1,391 times

Last updated: Mar 09 '15