mise au point : attention , certbot en test-mode
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
service:
|
service:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: restarted
|
state: restarted
|
||||||
when: apache_restart
|
|
||||||
|
|
||||||
- name: restart zabbix_agentd
|
- name: restart zabbix_agentd
|
||||||
service:
|
service:
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
---
|
---
|
||||||
- name: install certbot
|
- name: install certbot
|
||||||
package:
|
package:
|
||||||
name: certbot
|
name:
|
||||||
|
- certbot
|
||||||
|
- mod_ssl
|
||||||
|
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: install apache config file without ssl
|
- name: install apache config file without ssl
|
||||||
@@ -24,13 +27,13 @@
|
|||||||
- name: generate certificates for domaine and subdomains
|
- name: generate certificates for domaine and subdomains
|
||||||
vars:
|
vars:
|
||||||
subdomains: "-d {{ apache_server_alias | join( ' -d ' ) }}"
|
subdomains: "-d {{ apache_server_alias | join( ' -d ' ) }}"
|
||||||
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }} {{ subdomains }}
|
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }} --test-cert {{ subdomains }}
|
||||||
args:
|
args:
|
||||||
creates: "{{ apache_ssl_chain }}"
|
creates: "{{ apache_ssl_chain }}"
|
||||||
when: apache_server_alias is defined
|
when: apache_server_alias is defined
|
||||||
|
|
||||||
- name: generate certificates
|
- name: generate certificates
|
||||||
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }}
|
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }} --test-cert
|
||||||
args:
|
args:
|
||||||
creates: "{{ apache_ssl_chain }}"
|
creates: "{{ apache_ssl_chain }}"
|
||||||
when: apache_server_alias is not defined
|
when: apache_server_alias is not defined
|
||||||
|
|||||||
@@ -41,6 +41,10 @@
|
|||||||
include_tasks: dns.yml
|
include_tasks: dns.yml
|
||||||
when: apache_use_dns
|
when: apache_use_dns
|
||||||
|
|
||||||
|
- name: create certificate
|
||||||
|
include_tasks: certbot.yml
|
||||||
|
when: apache_use_ssl
|
||||||
|
|
||||||
- name: vhost config file
|
- name: vhost config file
|
||||||
template:
|
template:
|
||||||
src: vhost.conf.jj
|
src: vhost.conf.jj
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
DocumentRoot {{ apache_document_root }}
|
DocumentRoot {{ apache_document_root }}
|
||||||
<Directory {{ apache_document_root }}>
|
<Directory {{ apache_document_root }}>
|
||||||
require all granted
|
require all granted
|
||||||
Options -indexes
|
Options +indexes
|
||||||
</Directory>
|
</Directory>
|
||||||
{%if apache_use_ssl %}
|
{%if apache_use_ssl %}
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|||||||
Reference in New Issue
Block a user