Tag Info

Hot answers tagged

4

It's been requested as a feature for years... But you'd end up needing a custom function for this... or to use curl or wget. See Puppet Forge. What's in text.txt?


4

Try this: hiera cluster '::nodetype=diskless' See: https://docs.puppetlabs.com/hiera/1/command_line.html#fact-sources


3

It's not possible out of the box right now: source: ... The available URI schemes are puppet and file. Puppet URIs will retrieve files from Puppet’s built-in file server I ended up using define I found on the internet: define remote_file($remote_location=undef, $mode='0644'){ exec{ "retrieve_${title}": command => "/usr/bin/wget ...


2

Where can I control the time interval between each pulls? One method would be to Stop/Disable the service. Trigger the agent via cron, or whatever method you like. You can also update the puppet.conf and set the runinterval. The advantage of cron (or other task scheduler) method is that the agent doesn't stay running in the background. For systems ...


2

I have found that with puppet 3.7.1 passing 'install_options' to the yum provider works. I was able to successfully pass '--nogpgcheck' using it. Just update your puppet now.


2

It's using the right location for the file, but there's no file there, which means it's using defaults for all the settings at the moment. Go ahead and create the file and populate it with the settings you need, it's INI format and probably most of the settings can go under a [main] section.


2

Seeing as you want Hiera to merge arrays from the hierarchy (hiera --array), you cannot rely on Puppet's automagic parameter binding. You will have to explicitly call the hiera_array function instead. class sysbase($packages = hiera_array('sysbase::packages')) { ... } As described in the former answer, I think your mileage would be better with a ...


2

You linked to the documentation, but you seem to have missed the part, right under the command it told you to run, which says: This will create the CA certificate and the puppet master certificate, with the appropriate DNS names included. Once it says Notice: Starting Puppet master version <VERSION>, type ctrl-C to kill the process.


1

Using Hiera is the right approach and you can achieve the dynamic nature of what you want by using PuppetDB along with the PuppetDB Hiera backend. This allows you to have something like the following in your Hiera YAML files: zookeeper::servers::_nodequery: ['Class[Zookeeper]', 'ipaddress'] This will return an array of $::ipaddress facts for all of the ...


1

Defining wheel users this way causes them to be added, but if you remove jane from the class, she will not be removed from the wheel group on the next Puppet run. class wheel { augeas { "wheelgroup": context => "/files/etc/group/wheel", changes => [ 'set user[1] bob', 'set user[2] jane', ] } } The only way I have found ...


1

You can't. Either you use regexes for the node name, or roll your own External Node Classifier (ENC) that lets you this in a simplified fashion.


1

To debug this, you can make the compiler fail before making this particular check: fail("Packages: $packages") It should become obvious wether Puppet sees the less entry. The approach of handing in package titles via Hiera is not particularly elegant, anyway, because the user can make the class manage any package they want, which is poor semantics. If ...


1

Facter's variable partitions: [vagrant@localhost ~]$ facter partitions {"sda1"=>{"uuid"=>"X", "size"=>"1024000", "mount"=>"/boot"}, "sda2"=>{"size"=>"Y"}} could be used within an if statement as follows: if $partitions !~ /sd[b-z]1/ { notify{"partition does not exist":} } Outcome [vagrant@localhost ~]$ sudo puppet agent -t Info: ...


1

You have multiple options. It's absolutely possible to have puppet run a script on the target machine. Depending on what the script does, you want to prevent it from running more than once though. This would be such a case. You can add facter modules on the target machines that would export informations about block devices as facts. ...


1

For this specific thing, you can use -l 100%FREE as a size value to assign all free space with lvcreate. On a more fundamental level, if you don't want to use exec to get the data, you will have to extend facter to get you the data you need. https://docs.puppetlabs.com/facter/2.3/custom_facts.html#adding-custom-facts-to-facter


1

According to Microsoft's technet blog, both Puppet and Chef are supported for managing Azure instances. I cannot comment on the advantages that either solution, besides my general conviction that Puppet is a great tool.


1

Far and away the most compelling reason to adopt Chef for managing policy for Azure nodes is that it is the recommended/approved solution by the vendor. This means you will have an easier time getting help and support. This means that if things change (and they will always change), you are more likely to get a complete solution, rather than pointers in the ...


1

Before writing your own code take a look at https://forge.puppetlabs.com. Because usually there is a module which totally covers all your needs. In your case if I understand your task correctly it's https://forge.puppetlabs.com/example42/network If you still want to do that manually you should either use simple template substitution as was mentioned ...


1

Yes, Hiera would be the best solution. Note that you can (and should) add Hiera to Pupet 2.7.x in plugin form. Barring that, your options are limited. The require relationship between any two classes will not have an effect. On the contrary, observe that the following refactoring of your working manifest does yield your error as well: class { ...


1

You can also use profiles via CLI. This is totally unattended and if your profile requires any user input it will fail to install. I've successfully deployed WiFi networks via Puppet using this method. The command to install a profile is: sudo profiles -I -F /path/to/profile.mobileconfig Running as sudo/root will install the profile as a Device Profile ...


1

There is a plugin to keep your infrastructure definition in Foreman, pretty much a serialized version of your data in Git, and upload (and change your infrastructure) changes. Maybe that'd be useful for you https://github.com/marianitadn/foregit


1

I was looking for the same thing for a similar reason. and have found that hiera backedn in github helpful jjulien/hiera-regex . As an example from the project itself readme file: you have to configure a new backend that deals with the grouping as in: /etc/puppet/hiera.yaml: :backends: - regex - yaml :yaml: :datadir: /var/lib/hiera :regex: ...



Only top voted, non community-wiki answers of a minimum length are eligible