How to deploy Puppet Enterprise license key?

asked 2017-08-08 05:12:57 -0500

Paul Tung gravatar image

Hi there,

I have renewed the PE license and want to deploy by Puppet, bu there has a problem:

When I try to update the license file by 'file', it will be recover with old license by 'puppet_enterprise::license' always.

So I do a dirty work to require 'puppet_enterprise::license' to run first like this:

    file { '/etc/puppetlabs/license.key_temp':
      ensure  => file,
      mode    => '0644',
      source  => 'puppet:///modules/md_com_pm/etc/puppetlabs/license.key',
    },
    exec { 'Update Puppet Enterprise license key':
      command => '/bin/cp -f /etc/puppetlabs/license.key_temp /etc/puppetlabs/license.key',
      require => [
        File['/etc/puppetlabs/license.key_temp'],
        Class['puppet_enterprise::license'],
      ],
      unless  => '/usr/bin/diff -d /etc/puppetlabs/license.key_temp /etc/puppetlabs/license.key',
    }

Is there any way update license gracefully?

edit retag flag offensive close merge delete