vbotka.certificate
certificate
Ansible role. Manage SSL certificates.
Feel free to share your feedback and report issues.
Tested providers
Tested providers: selfsigned Not tested yet: acme, entrust, ownca
Requirements and dependencies
Roles
- ansible_lib library of Ansible tasks.
Collections
Packages
Role Variables
- See default variables in defaults/main.yml
- See OS specific variables in vars/defaults/
- See examples in vars/main.yml
freebsd_flavors_enable (default: false)
This variable enables the flavors stored in freebsd_flavors. By default the flavors are disabled. This means that the default flavors from /etc/make.conf will be installed. Enable this variable only if freebsd_install_method=packages. Ports won't recognize the flavors and the installation will crash. See the variables certificate_packages and certificate_packages2 in vars/defaults/FreeBSD.yml. There naming of the package acme-tiny and the port security/py-acme-tiny is not consistent. Fit the names to the current status of the ports collections and the packages. Put your changes into the file vars/FreeBSD.yml if necessary.
certificate_sanity_packages (default: true)
This variable enables the testing of the packages installed. By default the flavor certificate_python_version is required. The default is the version of ansible_python_version.
Workflow
Install the role and required dependencies
Create playbook
shell> cat playbook.yml
- hosts: srv.example.com
roles:
- vbotka.certificate
- Display help
shell> ansible-playbook playbook.yml
- Run setup tasks
shell> ansible-playbook playbook.yml -t certificate_debug -e certificate_debug=true
shell> ansible-playbook playbook.yml -t certificate_pkg -e certificate_install=true
shell> ansible-playbook playbook.yml -t certificate_sanity -e al_debug=true
shell> ansible-playbook playbook.yml -t certificate_dirs
- Optionally, generate a self signed OpenSSL certificates by openssl command
shell> ansible-playbook playbook.yml -t certificate_command
- Optionally, generate private keys, CSRs, and certificates step-by-step
shell> ansible-playbook playbook.yml -t certificate_openssl_privatekey
shell> ansible-playbook playbook.yml -t certificate_openssl_csr
shell> ansible-playbook playbook.yml -t certificate_openssl_certificate
- Optionally, generate private keys, CSRs, and certificates in one step
shell> ansible-playbook playbook.yml -t certificate_openssl
- Optionally, display information on OpenSSL private keys, CSRs, and certificates
shell> ansible-playbook playbook.yml -t certificate_openssl_privatekey_info
shell> ansible-playbook playbook.yml -t certificate_openssl_csr_info
shell> ansible-playbook playbook.yml -t certificate_openssl_certificate_info
- Optionally, display status of files OpenSSL private keys, CSRs, and certificates
shell> ansible-playbook playbook.yml -t certificate_openssl_stat
Ansible lint
Use the configuration file .ansible-lint.local when running ansible-lint. Some rules might be disabled and some warnings might be ignored. See the notes in the configuration file.
shell> ansible-lint -c .ansible-lint.local
References
- PKCS#10 certificate request and certificate generating utility
- SSL and TLS Deployment Best Practices
- SSL Best Practices: a Quick and Dirty
- ACME Protocol Updates
- ACME RFC8555 8.Identifier Validation Challenges
- ACME-TLS-ALPN Draft 3.TLS with Application Level Protocol Negotiation (TLS ALPN) Challenge
- Flavors - FreeBSD Handbook
License
Author Information
ansible-galaxy install vbotka.certificate