This commit is contained in:
commit
8f1bf16c08
67 changed files with 2971 additions and 0 deletions
45
roles/certbot/README.md
Normal file
45
roles/certbot/README.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Ansible Role Certbot
|
||||
|
||||
## Table of content
|
||||
|
||||
<!-- ANSIBLE DOCSMITH TOC START -->
|
||||
* [Role variables](#variables)
|
||||
* [`certbot_email`](#variable-certbot_email)
|
||||
* [`certbot_domain`](#variable-certbot_domain)
|
||||
<!-- ANSIBLE DOCSMITH TOC END -->
|
||||
|
||||
<!-- ANSIBLE DOCSMITH MAIN START -->
|
||||
|
||||
## Role variables<a id="variables"></a>
|
||||
|
||||
The following variables can be configured for this role:
|
||||
|
||||
| Variable | Type | Required | Default | Description (abstract) |
|
||||
|----------|------|----------|---------|------------------------|
|
||||
| `certbot_email` | `str` | Yes | N/A | E-mail to register the certificate |
|
||||
| `certbot_domain` | `str` | Yes | N/A | Domain name to register the certificate |
|
||||
|
||||
### `certbot_email`<a id="variable-certbot_email"></a>
|
||||
|
||||
[*⇑ Back to ToC ⇑*](#toc)
|
||||
|
||||
E-mail to register the certificate
|
||||
|
||||
- **Type**: `str`
|
||||
- **Required**: Yes
|
||||
|
||||
|
||||
|
||||
### `certbot_domain`<a id="variable-certbot_domain"></a>
|
||||
|
||||
[*⇑ Back to ToC ⇑*](#toc)
|
||||
|
||||
Domain name to register the certificate
|
||||
|
||||
- **Type**: `str`
|
||||
- **Required**: Yes
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ANSIBLE DOCSMITH MAIN END -->
|
||||
18
roles/certbot/meta/argument_specs.yml
Normal file
18
roles/certbot/meta/argument_specs.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Install and configure a certbot
|
||||
description:
|
||||
- Install and configure a [certbot](https://certbot.eff.org/).
|
||||
author:
|
||||
- jriou
|
||||
options:
|
||||
certbot_email:
|
||||
description:
|
||||
- E-mail to register the certificate
|
||||
required: true
|
||||
|
||||
certbot_domain:
|
||||
description:
|
||||
- Domain name to register the certificate
|
||||
required: true
|
||||
17
roles/certbot/tasks/main.yml
Normal file
17
roles/certbot/tasks/main.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
- name: Check requirements
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- certbot_email is defined
|
||||
- certbot_domain is defined
|
||||
|
||||
- name: Install packages
|
||||
ansible.builtin.package:
|
||||
name: certbot
|
||||
|
||||
- name: Request certificate
|
||||
ansible.builtin.command:
|
||||
cmd: >-
|
||||
certbot certonly --standalone -n --agree-tos
|
||||
--email {{ certbot_email }} -d {{ certbot_domain }}
|
||||
creates: /etc/letsencrypt/live/{{ certbot_domain }}/fullchain.pem
|
||||
Loading…
Add table
Add a link
Reference in a new issue