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