chore: use FQCN for module name

This commit is contained in:
Adrien Waksberg 2021-08-24 18:18:42 +02:00
parent aab9e5cb08
commit b9e7adfe81
3 changed files with 15 additions and 16 deletions

View file

@ -13,6 +13,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
### Changed
- test: replace kitchen to molecule
- chore: use FQCN for module name
### Removed

View file

@ -1,17 +1,15 @@
---
- name: install certbot package
apt:
name: '{{ packages }}'
default_release: '{{ certbot_distribution|default(ansible_distribution_release) }}'
state: present
vars:
packages:
ansible.builtin.apt:
name:
- certbot
- cron
default_release: '{{ certbot_distribution|default(ansible_distribution_release) }}'
state: present
tags: certbot
- name: create webroot path directory
file:
ansible.builtin.file:
path: '{{ certbot_path }}'
owner: root
group: root
@ -20,7 +18,7 @@
tags: certbot
- name: install certbot-renew binary
copy:
ansible.builtin.copy:
src: certbot-renew
dest: /usr/local/bin/certbot-renew
owner: root
@ -29,7 +27,7 @@
tags: certbot
- name: install certbot renew configuration
template:
ansible.builtin.template:
src: renew.cfg.j2
dest: /etc/letsencrypt/renew.cfg
owner: root
@ -38,16 +36,16 @@
tags: certbot
- name: remove old cerbot renew cron
file:
ansible.builtin.file:
path: /etc/cron.d/certbot
state: absent
tags: certbot
- name: add certbot renew cron
cron:
ansible.builtin.cron:
name: certbot-renew
user: root
hour: '*/12'
minute: 0
minute: '0'
job: perl -e 'sleep int(rand(3600))' && certbot -q renew --renew-hook /usr/local/bin/certbot-renew
tags: certbot

View file

@ -1,19 +1,19 @@
---
- name: check if certificate exist
stat:
ansible.builtin.stat:
path: '/etc/letsencrypt/live/{{ item.name }}'
loop: '{{ certbot_domains }}'
register: st
tags: certbot
- name: check if nginx is launch
stat:
ansible.builtin.stat:
path: /var/run/nginx.pid
register: ng
tags: certbot
- name: create a new certificate
command: >
ansible.builtin.command: >
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
--webroot --webroot-path {{ certbot_path }} --rsa-key-size {{ certbot_key_size }}
loop: '{{ st.results }}'
@ -21,7 +21,7 @@
tags: certbot
- name: create a new certificate (standalone)
command: >
ansible.builtin.command: >
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
--standalone --rsa-key-size {{ certbot_key_size }}
loop: '{{ st.results }}'