Ask Your Question
0

Transferring files from node to node

asked 2014-12-05 07:45:55 -0500

Gintas gravatar image

updated 2014-12-12 05:51:11 -0500

Hi,

I'm trying to use puppet-openvpn module [1] for openvpn management. I want to create an OpenVPN server (puppet agent), generate certificates and transfer them to an OpenVPN client (puppet agent).

I looked at [1] Example and it seems that they assume that OpenVPN server is the puppet master.

Is there a reasonable solution to this relying on puppet infrastructure and not using "exec"?

Thanks, Gin

[1][https://github.com/luxflux/puppet-openvpn](https://github.com/luxflux/puppet-openvpn)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-10 01:24:12 -0500

GregLarkin gravatar image

Hi Gin,

Definitely have a look at exported resources. Once you generate the certificates on the OpenVPN server and export the file resources, the OpenVPN clients can collect them based on the criteria that you specify.

edit flag offensive delete link more

Comments

Thanks. Worked perfectly.

Gintas gravatar imageGintas ( 2014-12-13 09:22:59 -0500 )edit

Interesting though, RE approach worked fine only with file{content=>XXX}. In this case I need a way to read file contents into a variable. Attempts to use file{source=><absolute path="">} resulted in error: "Could not evaluate: Could not retrieve information from environment production source(s)".

Gintas gravatar imageGintas ( 2014-12-15 18:08:58 -0500 )edit

Can you post a pastebin link to your code, both what's working and the version that isn't (with source attribute?). That will be helpful so I can create a small testcase here.

GregLarkin gravatar imageGregLarkin ( 2014-12-16 21:28:10 -0500 )edit

The NON-working version is here: http://pastebin.com/ZMEbBAW4 Unfortunately I cannot reproduce the working version since I was only experimenting and did not save the changes. I think I used File => "content" attribute instead of "source". Thanks Greg for responding!

Gintas gravatar imageGintas ( 2014-12-16 22:06:23 -0500 )edit

It's possible that Puppet is already interpreting the file source this way, but can you change your source attribute to 'source => "file:///tmp/input",' and try that? From the docs, the source attribute recognizes puppet:// and file:// URLs, so it might be confused by the absolute path.

GregLarkin gravatar imageGregLarkin ( 2014-12-17 21:16:44 -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: 2014-12-05 07:45:55 -0500

Seen: 128 times

Last updated: Dec 12 '14