Compare commits
2 Commits
213e7ed175
...
e7dd861d7a
| Author | SHA1 | Date | |
|---|---|---|---|
|
e7dd861d7a
|
|||
|
cb828bdf53
|
@@ -65,14 +65,14 @@
|
||||
|
||||
- name: Grab Cloudflare API token for configuration
|
||||
ansible.builtin.slurp:
|
||||
src: /root/.cloudflare-api
|
||||
src: /etc/letsencrypt/cloudflare-api.key
|
||||
register: cfapi
|
||||
when: proxy.production is defined and proxy.production and proxy.dns_cloudflare is defined
|
||||
|
||||
- name: Install Cloudflare API token
|
||||
ansible.builtin.template:
|
||||
src: cloudflare.ini.j2
|
||||
dest: /root/.cloudflare.ini
|
||||
dest: /etc/letsencrypt/cloudflare.ini
|
||||
mode: "400"
|
||||
diff: false
|
||||
when: proxy.production is defined and proxy.production and proxy.dns_cloudflare is defined
|
||||
@@ -91,23 +91,37 @@
|
||||
mode: "0755"
|
||||
when: proxy.production is defined and proxy.production
|
||||
|
||||
- name: Enable SELinux bool certbot_acmesh to allow sh access for DNS-01
|
||||
ansible.posix.seboolean:
|
||||
name: certbot_acmesh
|
||||
state: true
|
||||
persistent: true
|
||||
when:
|
||||
- selinux is defined
|
||||
- selinux is not false
|
||||
- proxy is defined
|
||||
- proxy.production is defined
|
||||
- proxy.production
|
||||
- proxy.dns_cloudflare is defined
|
||||
|
||||
- name: Run Cloudflare DNS-01 challenges on wildcard domains
|
||||
ansible.builtin.shell: '/usr/bin/certbot certonly \
|
||||
--non-interactive \
|
||||
--agree-tos \
|
||||
--email "{{ proxy.dns_cloudflare.email }}" \
|
||||
--dns-cloudflare \
|
||||
--dns-cloudflare-credentials /root/.cloudflare.ini \
|
||||
--dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \
|
||||
-d "*.{{ item }}" \
|
||||
-d "{{ item }}" \
|
||||
{{ proxy.dns_cloudflare.opts | default("") }}'
|
||||
{{ proxy.dns_cloudflare.opts | default("") }}
|
||||
< /dev/null'
|
||||
args:
|
||||
creates: "/etc/letsencrypt/live/{{ item }}/fullchain.pem"
|
||||
loop: "{{ proxy.dns_cloudflare.wildcard_domains }}"
|
||||
when: proxy.production is defined and proxy.production and proxy.dns_cloudflare is defined
|
||||
notify: reload_nginx
|
||||
|
||||
- name: Enable httpd_can_network_connect to allow nginx network access
|
||||
- name: Enable SELinux bool httpd_can_network_connect to give nginx networking
|
||||
ansible.posix.seboolean:
|
||||
name: httpd_can_network_connect
|
||||
state: true
|
||||
|
||||
Reference in New Issue
Block a user