Skip to content

Commit

Permalink
Add documentation of file system layout and service configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ganto committed Aug 31, 2016
1 parent c2503c0 commit 90bded0
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 1 deletion.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# .. vim: foldmarker=[[[,]]]:foldmethod=marker

# Default Role Variables [[[
# Default role variables [[[
# ==========================

# .. contents:: Sections
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Ansible role: ganto.acme_tiny
introduction
getting-started
defaults
system-configuration
copyright

..
Expand Down
8 changes: 8 additions & 0 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ automates the creation of certificate requests and renewal of certificates,
including service restart after the certificates have been replaced.


.. _acme_tiny_installation:

Installation
~~~~~~~~~~~~


.. _acme_tiny_ansible_role:

Ansible Role
^^^^^^^^^^^^

Expand All @@ -20,6 +25,9 @@ This role requires at least Ansible ``v2.0.0``. To install it, run:
ansible-galaxy install ganto.acme_tiny
.. _acme_tiny_upstream:

acme-tiny
^^^^^^^^^

Expand Down
128 changes: 128 additions & 0 deletions docs/system-configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
System configuration
====================

.. _acme_tiny_ref_fs_layout
File system layout
------------------

The role will setup a configurable directory layout to store the certificates
and make them accessible by the services.

Example layout of the default configuration:

======================================================= ==================================
Server path Ansible role variable
======================================================= ==================================
:file:`/etc/ssl/acme-tiny` :envvar:`acme_tiny__config_dir`
:file:`/etc/ssl/acme-tiny/example.com` :envvar:`acme_tiny__cert_dir`
:file:`/etc/ssl/acme-tiny/example.com/example.com.key` :envvar:`acme_tiny__private_key`
:file:`/etc/ssl/acme-tiny/example.com/example.com.crq` :envvar:`acme_tiny__cert_request`
:file:`/etc/ssl/acme-tiny/example.com/example.com.crt` :envvar:`acme_tiny__certificate`
======================================================= ==================================

When setting a :envvar:`acme_tiny_cert_type` other than ``plain`` or ``chain``
an additional layer of indirection through symlinks which will make the
certificates accessible in a transparent way. For each service the role will
create a :file:`ssl/` subdirectory from where the actual certificates and keys
are symlinked. Like this the CA could be changed easily without reconfiguration
of the secured services.

E.g. For for Apache :program:`httpd` this would look like this::

/etc/apache2/ssl/example.com.crt -> /etc/ssl/acme-tiny/example.com/example.com_chain.crt
/etc/apache2/ssl/example.com.key -> /etc/ssl/acme-tiny/example.com/example.com.key

For :program:`lighttpd`::

/etc/lighttpd/ssl/example.com.pem -> /etc/ssl/acme-tiny/example.com/example.com_lighttpd.pem
/etc/lighttpd/ssl/ca.crt -> /etc/ssl/acme-tiny/intermediate.crt

For :program:`Dovecot`::

/etc/dovecot/ssl/example.com.crt -> /etc/ssl/acme-tiny/example.com/example.com.crt
/etc/dovecot/ssl/example.com.key -> /etc/ssl/acme-tiny/example.com/example.com.key


.. _acme_tiny_ref_service_cfg
Service configuration
---------------------

This section describes how the configured certificates should be configured
within the individual service setups. As different Linux distributions
organize the involved configuration files in a different layout the following
snippets are limited to the configuration directives without exact file name.


.. _acme_tiny_ref_apache_cfg
Apache httpd
~~~~~~~~~~~~

.. code-block:: apacheconf
SSLCertificateFile /etc/apache2/ssl/example.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
.. _acme_tiny_ref_dovecot_cfg
Dovecot
~~~~~~~

.. code-block:: dovecotconf
ssl_cert = </etc/dovecot/ssl/example.com.crt
ssl_key = </etc/dovecot/ssl/example.com.key
.. _acme_tiny_ref_lighttpd
Lighttpd
~~~~~~~~

.. code-block:: lighttpdconf
ssl.pemfile /etc/lighttpd/ssl/example.com.pem
ssl.cafile /etc/lighttpd/ssl/ca.crt
.. _acme_tiny_ref_nginx
Nginx
~~~~~

.. code-block:: nginxconf
ssl_certificate /etc/nginx/ssl/example.com.crt
ssl_certificate_key /etc/nginx/ssl/example.com.key
- Upstream documentation:
`Module ngx_http_ssl_module <http://nginx.org/en/docs/http/ngx_http_ssl_module.html>`


.. _acme_tiny_ref_postfix
Postfix
~~~~~~~

.. code-block:: postfixconf
smtpd_tls_cert_file = /etc/nginx/ssl/example.com.crt
smtpd_tls_key_file = /etc/nginx/ssl/example.com.key
- Upstream documentation:
`Postfix TLS Support <http://www.postfix.org/TLS_README.html>`


.. _acme_tiny_ref_cert_renewal
Certificate renewal
-------------------

..
Local Variables:
mode: rst
ispell-local-dictionary: "american"
End:

0 comments on commit 90bded0

Please sign in to comment.