iddev: have the playbook call certbot directly

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2021-03-30 15:24:36 +02:00
parent 8708d57804
commit 18ad21119b

View file

@ -21,23 +21,16 @@
- import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml" - import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml"
- name: set hostname (required by some services, at least postfix need it) - name: set hostname (required by some services, at least postfix need it)
hostname: name="{{inventory_hostname}}" hostname: name="{{inventory_hostname}}"
- name: Add an apache config to proxy letsencrypt
shell: |
echo '<VirtualHost *:80>
ServerName iddev.fedorainfracloud.org
ProxyPass "/.well-known/acme-challenge" "https://certgetter01/.well-known/acme-challenge"
Redirect permanent / https://iddev.fedorainfracloud.org
</VirtualHost>' > /etc/httpd/conf.d/proxy_letsencrypt.conf
- name: reload apache - name: reload apache
ansible.builtin.service: ansible.builtin.service:
name: httpd name: httpd
state: reloaded state: stopped
- name: Letsencrypt for iddev.fedorainfracloud.org - name: Letsencrypt for iddev.fedorainfracloud.org
include_role: name=letsencrypt shell: /usr/bin/certbot renew --noninteractive --no-random-sleep-on-renew --force-renewal --standalone
vars: - name: reload apache
site_name: iddev.fedorainfracloud.org ansible.builtin.service:
tags: name: httpd
- letsencrypt state: restarted
handlers: handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml" - import_tasks: "{{ handlers_path }}/restart_services.yml"