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 x509_cert and x509_csr types and providers #9

Merged
merged 65 commits into from
Apr 23, 2013
Merged

Add x509_cert and x509_csr types and providers #9

merged 65 commits into from
Apr 23, 2013

Conversation

raphink
Copy link
Member

@raphink raphink commented Apr 16, 2013

This PR provides three new types and associated openssl providers:

  • ssl_pkey generates a private key;
  • x509_cert generates a certificate from a private key and a given template;
  • x509_request generates a certificate signing request based on a given a key (private_key) and a template.

Examples:

ssl_pkey { '/etc/ssl/my.key':
  ensure     => 'present',
  password   => 'crackmenot', # optional
}

x509_cert { '/etc/ssl/my.crt':
  ensure        => 'present',
  private_key   => '/etc/ssl/my.key', # optional, uses .key if not specified
  password      => 'crackmenot', # to decrypt the key
  days          => 3650,
  template      => '/path/to/my_template.cnf',
  force         => true, # Re-generate certificate if key has changed
}

x509_request { '/etc/ssl/my.csr':
  ensure        => 'present',
  private_key   => '/etc/ssl/my.key', # optional, uses .key if not specified
  password      => 'crackmenot', # to decrypt the key
  template      => '/path/to/my_template.cnf',
  force         => true, # Re-generate certificate if key has changed
}

These three providers make it possible to replace files/generate-x509-cert.sh and openssl::genx509, and to rewrite openssl::certificate::x509 as a wrapper doing:

  • generate and deploy the certificate template (file resource, unchanged);
  • generate the private key using the ssl_pkey type;
  • generate the certificate using the x509_cert type;
  • generate the certificate signing request using the x509_request type.

  rebase openssl::certificate::x509 on x509_cert and x509_csr
raphink added a commit that referenced this pull request Apr 23, 2013
Add x509_cert and x509_csr types and providers
@raphink raphink merged commit 61f8bbc into voxpupuli:master Apr 23, 2013
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.

1 participant