The Puppet 3 Cookbook by Arundel John

The Puppet 3 Cookbook by Arundel John

Author:Arundel, John
Language: eng
Format: epub
Publisher: Packt Publishing


We've passed in an array of strings to the dotfile parameter of our ssh_user definition. Here's where that gets expanded into resource declarations:

if $dotfile { $filepath = regsubst($dotfile,'^(.*)$',"/home/${name}/.\\0", 'G') user_dotfile { $filepath: user => $name, } }

So, if a value is passed in for dotfile, we first of all transform it into the full path for dotfile (bashrc becomes /home/jamil/.bashrc) using regsubst. Then we declare an instance of user_dotfile:

user_dotfile { '/home/jamil/.bashrc': user => 'jamil', }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.