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 ### Changed
- test: replace kitchen to molecule - test: replace kitchen to molecule
- chore: use FQCN for module name
### Removed ### Removed

View file

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

View file

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