Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
---
|
|
|
|
- name: Certbot work directory is present
|
|
ansible.builtin.file:
|
|
dest: "{{ certbot_work_dir }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Check if Nginx is installed
|
|
ansible.builtin.stat:
|
|
path: /etc/nginx
|
|
register: is_nginx
|
|
|
|
- name: ACME challenge for Nginx is installed
|
|
ansible.builtin.template:
|
|
src: acme-challenge/nginx.conf.j2
|
|
dest: /etc/nginx/snippets/letsencrypt.conf
|
|
force: yes
|
|
notify: reload nginx
|
|
when: is_nginx.stat.exists
|
|
|
|
- name: Check if Apache is installed
|
|
ansible.builtin.stat:
|
|
path: /usr/sbin/apachectl
|
|
register: is_apache
|
|
|
|
- name: ACME challenge for Apache
|
|
block:
|
|
- name: ACME challenge for Apache is installed
|
|
ansible.builtin.template:
|
|
src: acme-challenge/apache.conf.j2
|
|
dest: /etc/apache2/conf-available/letsencrypt.conf
|
|
force: yes
|
|
notify: reload apache
|
|
|
|
- name: ACME challenge for Apache is enabled
|
|
ansible.builtin.command:
|
|
cmd: "a2enconf letsencrypt"
|
|
register: command_result
|
|
changed_when: "'Enabling' in command_result.stderr"
|
|
notify: reload apache
|
|
when: is_apache.stat.exists
|
|
|
|
- name: Check if HAProxy is installed
|
|
ansible.builtin.stat:
|
|
path: /etc/haproxy
|
|
register: is_haproxy
|
|
|
|
- name: ACME challenge for HAProxy is installed
|
|
ansible.builtin.debug:
|
|
msg: "ACME challenge configuration for HAProxy must be configured manually"
|
|
when: is_haproxy.stat.exists
|