Install and configure a certificate authority on your system.
Find a file
2023-09-25 16:14:48 +02:00
.github Use new action and container. 2023-09-25 16:14:48 +02:00
defaults Implement ansible-lint hints. 2023-01-02 13:45:34 +01:00
meta Test Ansible 8 and RHEL9 (if applicable) 2023-06-12 15:00:35 +02:00
molecule/default Fix capitalization. 2023-06-01 08:21:34 +02:00
tasks Shorter task names. 2023-09-20 14:11:59 +02:00
templates Add ansible_managed comment to templates. 2020-11-27 07:18:12 +01:00
vars Simpler; remove Rocky references, it's RedHat now. Regenerate docs. 2022-02-10 09:33:02 +01:00
.ansible-lint ansible lint has changed a bit. 2023-07-12 17:28:49 +02:00
.gitignore Make unused variable finding work on Mac OS X 2021-03-25 15:05:36 +01:00
.gitlab-ci.yml Use new action and container. 2023-09-25 08:09:51 +02:00
.pre-commit-config.yaml Newer version of pre-commit components. 2023-06-13 13:09:06 +02:00
.yamllint No rawhide, package GPG issue. 2021-02-15 14:27:42 +01:00
CODE_OF_CONDUCT.md Initial commit. 2018-12-14 17:37:52 +01:00
CONTRIBUTING.md Make all assertions silent. 2020-08-19 20:56:32 +02:00
LICENSE Happy 2023\! 2023-01-01 11:27:24 +01:00
README.md Test Ansible 8 and RHEL9 (if applicable) 2023-06-12 15:00:35 +02:00
requirements.txt External pip dependencies and fix (temporary?) issue: ansible-community molecule issues 3903 2023-05-03 08:42:42 +02:00
requirements.yml Remove not-required collections, add collections that are required, FQCN. 2022-01-25 21:52:32 +01:00
SECURITY.md Update components, regenerate files. 2023-02-28 11:55:55 +01:00
tox.ini Use new action and container. 2023-09-25 08:09:51 +02:00

ca

Install and configure a certificate authority on your system.

GitHub GitLab Quality Downloads Version
github gitlab quality downloads Version

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.ca

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  gather_facts: no
  become: yes

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.buildtools
    - role: robertdebock.epel
    - role: robertdebock.python_pip
    - role: robertdebock.openssl
      openssl_items:
        - name: apache-httpd
          common_name: "{{ ansible_fqdn }}"
    - role: robertdebock.httpd

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# defaults file for ca

# set ca_init: 'yes' to create CA
ca_init: yes

# ca_own_root: 'yes' if you want to have yout own root CA.
# if no, set ca_certificate_path manually
ca_own_root: yes

# A passphrase for the CA key.
ca_passphrase: SuP3rS3creT

# The common name for the CA.
ca_common_name: example.com

# Other details for the CA.
ca_country_name: NL
ca_email_address: robert@meinit.nl
ca_organization_name: Very little
ca_organizational_unit_name: Even less
ca_state_or_province_name: Utrecht
ca_locality_name: Utrecht

# There are two formats to request a key and certificate:
# 1. With details: (Includes `name:`)
# ca_requests:
#   - name: certificate1.example.com
#     passphrase: S3creT
#
# 2. Without details: (Does not include `name:`)
# ca_requests:
#   - "{{ ansible_fqdn }}"

# You can also mix these formats:
# ca_requests:
#   - name: certificate1.example.com
#     passphrase: S3creT
#   - "{{ ansible_fqdn }}"

# Where to publish the certificates, normally a webserver location.
# If not specified, certificates will not be published.
# {{ httpd_data_directory }} is inheritted from the role robertdebock.httpd.
ca_publication_location: "{{ httpd_data_directory | default('/tmp') }}/pub"

# Where do the certificates need to be stored? By default the distribution
# preferred locations are used (see `vars/main.yml`, under `_ca_openssl_path`.
# If you need a CA certificate somewhere else, simple use something like this:
# ca_openssl_path: /my/preferred/path
ca_openssl_path: "{{ _ca_openssl_path[ansible_os_family] | default(_ca_openssl_path['default']) }}"

Requirements

State of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.buildtools Build Status GitHub Build Status GitLab
robertdebock.epel Build Status GitHub Build Status GitLab
robertdebock.httpd Build Status GitHub Build Status GitLab
robertdebock.openssl Build Status GitHub Build Status GitLab
robertdebock.python_pip Build Status GitHub Build Status GitLab

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
EL 8, 9
Debian all
Fedora all
opensuse all
Ubuntu all

The minimum version of Ansible required is 2.12, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub

License

Apache-2.0.

Author Information

robertdebock

Please consider sponsoring me.