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

Is there a way of getting a file to be deployed into a variable to check and use

$
0
0
Im trying to define a class that will .given a source directory structure on the master, deliver a set of files depending on the node. We used this type prior to puppet. e.g. ROOT-DIR/etc/motd:RHEL ROOT-DIR/etc/motd:SLES A script would detect if your SLES or RHEL and would deliver the above files to /etc/motd for the correct OS if we then added ROOT-DIR/etc/motd:RHEL-5 then this would deliver this file to Redhat 5 boxes only and Redhat and Sles the same. If any other OS came along they would not get any file. Wanted to reproduce this type of delivery for fixed files in puppet but for this i want to 1/ check which file to deploy 2/ create the dirs. 3/ permissions will be created later (from an array). To solve 1 i want something like this. $fileiwillget = some_file_source_function ( "puppet:///modules/rootdir/${name}:${::fqdn}", "puppet:///modules/rootdir/${name}:${::operatingsystem}-${::operatingsystemmajrelease}", "puppet:///modules/rootdir/${name}:${::operatingsystem}-${::operatingsystemrelease}", "puppet:///modules/rootdir/${name}:${::operatingsystem}", "puppet:///modules/rootdir/${name}")

Viewing all articles
Browse latest Browse all 6104

Trending Articles