Skip to content

Commit fcaa79c

Browse files
committed
docs(readme): modify according to standard structure
1 parent 550b56d commit fcaa79c

File tree

1 file changed

+92
-13
lines changed

1 file changed

+92
-13
lines changed

docs/README.rst

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,66 @@
1-
===================
1+
.. _readme:
2+
23
letsencrypt-formula
34
===================
45

6+
|img_travis| |img_sr|
7+
8+
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/letsencrypt-formula.svg?branch=master
9+
:alt: Travis CI Build Status
10+
:scale: 100%
11+
:target: https://travis-ci.com/saltstack-formulas/letsencrypt-formula
12+
.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
13+
:alt: Semantic Release
14+
:scale: 100%
15+
:target: https://github.com/semantic-release/semantic-release
16+
517
Creates certificates and manages renewal using the letsencrypt service.
618

7-
.. image:: https://travis-ci.org/saltstack-formulas/letsencrypt-formula.svg?branch=master
19+
.. contents:: **Table of Contents**
20+
21+
General notes
22+
-------------
23+
24+
See the full `SaltStack Formulas installation and usage instructions
25+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
26+
27+
If you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section
28+
<https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas>`_.
29+
30+
If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
31+
which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
832

9-
.. note::
33+
See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
1034

11-
See the full `Salt Formulas installation and usage instructions
12-
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
35+
If you need (non-default) configuration, please pay attention to the ``pillar.example`` file and/or `Special notes`_ section.
36+
37+
Contributing to this repo
38+
-------------------------
39+
40+
**Commit message formatting is significant!!**
41+
42+
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
43+
44+
Special notes
45+
-------------
46+
47+
None
1348

1449
Available states
15-
================
50+
----------------
1651

1752
.. contents::
18-
:local:
53+
:local:
1954

2055
``letsencrypt``
21-
---------------
56+
^^^^^^^^^^^^^^^
2257

2358
This is a shortcut for letsencrypt.install letsencrypt.config and letsencrypt.domains.
2459

2560
If `use_package` is `True` (the default), the formula will try to install the *certbot* package from your Distro's repo.
2661
Keep in mind that most distros don't have a package available by default: Ie, current Debian (Stretch) requires a backports repo installed.
2762
Centos 7 requires EPEL, etc. This formula **DOES NOT** manage these repositories. Use the `apt-formula <https://github.com/saltstack-formulas/apt-formula>`_
28-
or the `epel-formula <https://github.com/saltstack-formulas/epel-formula`_ to manage them.
63+
or the `epel-formula <https://github.com/saltstack-formulas/epel-formula>`_ to manage them.
2964

3065
If `use_package` is `False` it installs and configures the letsencrypt cli from git, creates the requested certificates and installs renewal cron job.
3166

@@ -37,23 +72,67 @@ If you set `use_package` to `True`, it will:
3772
systemd's timer unit to renew all the certs)
3873
* Delete git-based installation's scripts (usually installed under /usr/local/bin) if they still exist declared in
3974
*letsencrypt*'s pillar.
40-
* As a safety meassure, if there's an /opt/letsencrypt directory from a git-based installation, it will be left
75+
* As a safety measure, if there's an /opt/letsencrypt directory from a git-based installation, it will be left
4176
untouched, but unused.
4277
To check dependencies to use the package for your distro, check https://certbot.eff.org/all-instructions.
4378

4479
``letsencrypt.install``
45-
-----------------------
80+
^^^^^^^^^^^^^^^^^^^^^^^
4681

4782
Only installs the letsencrypt client (see above).
4883

4984
``letsencrypt.config``
50-
----------------------
85+
^^^^^^^^^^^^^^^^^^^^^^
5186

5287
Manages /etc/letsencrypt/cli.ini config file.
5388

5489
``letsencrypt.domains``
55-
-----------------------
90+
^^^^^^^^^^^^^^^^^^^^^^^
5691

5792
Creates a certificate with the domains in each domain set (letsencrypt:domainsets in pillar). Letsencrypt uses a relatively short validity of 90 days.
5893
Therefore, a cron job for automatic renewal every 60 days is installed for each domain set as well.
5994

95+
Testing
96+
-------
97+
98+
Linux testing is done with ``kitchen-salt``.
99+
100+
Requirements
101+
^^^^^^^^^^^^
102+
103+
* Ruby
104+
* Docker
105+
106+
.. code-block:: bash
107+
108+
$ gem install bundler
109+
$ bundle install
110+
$ bin/kitchen test [platform]
111+
112+
Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
113+
e.g. ``debian-9-2019-2-py3``.
114+
115+
``bin/kitchen converge``
116+
^^^^^^^^^^^^^^^^^^^^^^^^
117+
118+
Creates the docker instance and runs the ``template`` main state, ready for testing.
119+
120+
``bin/kitchen verify``
121+
^^^^^^^^^^^^^^^^^^^^^^
122+
123+
Runs the ``inspec`` tests on the actual instance.
124+
125+
``bin/kitchen destroy``
126+
^^^^^^^^^^^^^^^^^^^^^^^
127+
128+
Removes the docker instance.
129+
130+
``bin/kitchen test``
131+
^^^^^^^^^^^^^^^^^^^^
132+
133+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
134+
135+
``bin/kitchen login``
136+
^^^^^^^^^^^^^^^^^^^^^
137+
138+
Gives you SSH access to the instance for manual testing.

0 commit comments

Comments
 (0)