Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 75

Include a puppet-served file (not a subtemplate) in a template

$
0
0
Greetings. I've tried searching, but I'm probably searching for the wrong words. I have a module class foo { file { "/etc/foo.txt" : ensure => file, source => 'puppet:///modules/foo/foo.txt', } And a file `..../modules/foo/files/foo.txt` with some text contained in it. Just text, nothing special. I have a second module class createfoo { file { "/etc/createfoo.sh" : ensure => file, content => template("bar/createfoo.sh") } and I have a template `..../modules/createfoo/templates/createfoo.sh` that looks something like this: #!/bin/bash # # this file was generated by puppet for <%= @hostname %> # to create the foo.txt file # rm /etc/foo.txt cat > /etc/foo.txt << EOF um EOF chmod 644 /etc/foo.txt Please don't ask why I need both; just accept that I need both. The question is ... I have the word "um" in my template. What can I put there that says "go get me the file from `puppet:///modules/foo/foo.txt` and put it here" ?

Viewing all articles
Browse latest Browse all 75

Trending Articles