Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clean parameter #5

Merged
merged 2 commits into from
Nov 14, 2017
Merged

Add clean parameter #5

merged 2 commits into from
Nov 14, 2017

Conversation

raphink
Copy link
Member

@raphink raphink commented Aug 24, 2017

This PR adds a clean parameter, which allows to clean the certificate from the CA upon destroying it.

This is useful to keep the CA clean. It requires to add a rule to auth.conf on the CA, for example by allowing certificates to clean themselves:

        {
            # Allow nodes to delete their own certificate
            match-request: {
                path: "^/puppet-ca/v1/certificate(_status|_request)?/([^/]+)$"
                type: regex
                method: [delete]
            }
            allow: "$2"
            sort-order: 500
            name: "c2c puppet cert clean"
        },

Together with #3 and #4, this allows to set up automatic renewal of Puppet certificates, with something along the lines of:

    file { "${confdir}/puppet/csr_attributes.yaml":
      ensure  => file,
      owner   => 'root',
      group   => 'root',
      mode    => '0440',
      content => template('blah/csr_attributes.yaml.erb'),
    }
    ~> puppet_certificate { $certname:
      ensure               => valid,
      waitforcert          => 60,
      renewal_grace_period => 20,
      clean                => true,
    }

@raphink
Copy link
Member Author

raphink commented Nov 13, 2017

@reidmv added a description here, too. It should give you an idea of what #3, #4 and #5 achieve together (I plan on writing a blog post on what we're doing with that once it's merged).

@reidmv reidmv merged commit ba0b944 into voxpupuli:master Nov 14, 2017
reidmv added a commit that referenced this pull request Nov 14, 2017
@reidmv reidmv mentioned this pull request Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants