Tag Info

Hot answers tagged

4

Puppet has no concept of VCS versions for its modules and manifests. It will simply use the files that are stored in the correct place and there is no way to require a specific version for a client. Instead of this, you can work with Puppet environments and only deploy the new version of a module to e.g. the testing environment and test it with clients ...


4

This should be doable with install_options (which, for the yum provider, requires Puppet 3.6 or newer): package { 'somepackage': ensure => present, install_options => [ '--installroot=' ], }


4

There are a few ways to handle this, you could simply use your ternary check directly in the user declaration like so: user { $user: ensure => $ensure, managehome => $ensure ? { present => true, default => false, }, uid => $uid, gid => $gid, password => $password, groups => $groups, comment ...


4

The answer really depends on how version-controlled you want to be. There are a few main approaches: House everything in a single flat Git repository, and just clone it on your masters (or nodes if you're running masterless). This is by far the simplest option, but means that you'll have multiple copies of the same module across your production and ...


3

You set refreshonly => true and as such you need to use a notification arrow instead (~>).


3

The $environment variable isn't technically a fact - it is set by the agent from its puppet.conf, instead of a fact. You'll need to edit it in the agent's puppet.conf instead of facts.d. An ENC can set a node's environment (overriding what the agent selects as its own environment), but the master would need to be the one overriding it, not the agent.


2

It seems that you installed and ran your puppet master first and then changed the hostname. On puppet master execute: puppet config print certname This will show the certname your master uses. It should be equal to your hostname. You can verify common name in master's certificate if it matches your hostname: openssl x509 -noout -subject -in $(puppet ...


2

In case it is of interest to anyone, I guess at minimum I can give a user experience report having put made my first use of Ansible's out of the box push capability in the context of patch management of multi-host setups of mission-critical systems in the Amazon cloud. To understand my preconceptions or biases, I should explain that I have a preference for ...


2

On the guest, that folder is going to be at /vagrant/puppet/files, but you don't want to use that at all since it doesn't translate from vagrant to everywhere else. The answer by @deagh starts to lead you in the right direction. You need to move any files into a modules folder. So c:\myproject\ Vagranfile puppet\ modules\ ...


2

I'm not happy with the necessity of using an absolute path to find the dockutil script. You could partly address this by setting up resource default for your exec. Specifically you could set a path. Set something like this perhaps? Exec { path => ['/opt/boxen/repo/script/', '/usr/sbin', '/usr/bin', '/sbin', '/bin'] } If created a custom fact ...


2

Puppet 3 includes hiera and doesn't need/require any additional packages being installed for it.


1

For example like this: notify { $::os[release][major] : } Note that you need to set the option stringify_facts to false for this to work (default as of writing with Puppet 3.7.1: true).


1

You can't remove a resource definition after it is declared, and you are right, class inheritance should be used very sparingly I would use your class parameters example with hiera node s1.example.comf { include videoServer } node s2.example.comf { include videoServer } Setting s2.example.com.yaml to videoServer::fileState2: absent


1

Puppet Dashboard can act as an External Node Classifier, applying classes to nodes. The Enterprise dashboard seems like it's a pretty capable ENC, and the newly announced Puppet Node Manager will be its successor. On the open source side, the Puppet Labs team has stopped supporting Dashboard, leaving support of it to the community. For node classification ...


1

You could add a postrotate script to your current block in order to delete files older than n days with the following : find /var/log/apache2 -name "*.log.gz" -maxdepth 1 +mtime <n> -delete &>/dev/null Wait for the next rotation then remove it and let logrotate do its normal job again.


1

If you install puppet agent it does not differ from ant other agent. So you can do that either by using puppet apply on a master node or just adding corresponding node section into the main site.pp manifest and invoking puppet agent -t or via cron/daemon.


1

I assume you use the foreman WebGui: If you are in the Smart Class Parameter tab of the ntp class, select servers, check the Override Box an then select array for Parameter type. Then input the list of your desired timeserver in the following form: ["timehost1.domain.tld","timehost2", ...] It took me a while myself to figure that out. In general, you ...


1

You would get much better results using puppet modules for apt, nodejs etc. take a look at puppet forge. Using exec is a bad idea, as you really need to take care of the idempotency on your own. For example instead of lines: package { 'nodejs': ensure => latest, require => [Exec['apt_update'], Exec['add-node-repo']] } # Install npm exec { ...


1

That happens to me as well. I kicked puppet and it seems to apply all the configuration, except file_line and it still won't apply it in every run until I manually will kick puppet agent for the second time. # puppet pluginsync=true file { "/etc/puppet/puppet.conf": mode => 644, owner => root, group => root, source => ...


1

If you can create a script (on the Puppet master) that will print the name (likely through calls to the AWS CLI), you can use the generate function to use the name in your Puppet manifests and templates. You can add this call right in your site.pp file. $rds_internal_name = generate('/usr/local/sbin/get-rds-internal-name')


1

Solution: # Apache logging <% if classes.include?("httpd") %> local5.* @<%= scope.function_hiera(["ls_gelf_host"]) %>:<%= @service_port -%> local5.info ~ local5.err ~ <% else %> local5.info ~ local5.err ~ <% end %> # Nginx logging <% if classes.include?("nginx") %> local4.* @<%= scope.function_hiera(["ls_gelf_host"]) ...


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 ...



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