Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nginx support #216

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ certbot_auto_renew_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
certbot_auto_renew_hour: "3"
certbot_auto_renew_minute: "30"
certbot_auto_renew_options: "--quiet"
certbot_package: certbot

certbot_testmode: false
certbot_hsts: false


# Parameters used when creating new Certbot certs.
certbot_create_if_missing: false
certbot_create_method: standalone
Expand Down
9 changes: 9 additions & 0 deletions tasks/create-cert-nginx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Check if certificate already exists.
stat:
path: /etc/letsencrypt/live/{{ cert_item.domains | first }}/cert.pem
register: letsencrypt_cert

- name: Generate new certificate if one doesn't exist.
command: "{{ certbot_create_command }}"
when: not letsencrypt_cert.stat.exists
8 changes: 0 additions & 8 deletions tasks/include-vars.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/install-with-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

- name: Set Certbot script variable.
set_fact:
certbot_script: "{{ certbot_package }}"
certbot_script: "certbot"
10 changes: 8 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
- import_tasks: include-vars.yml

- import_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'

Expand Down Expand Up @@ -29,5 +27,13 @@
loop_control:
loop_var: cert_item

- include_tasks: create-cert-nginx.yml
with_items: "{{ certbot_certs }}"
when:
- certbot_create_if_missing
- certbot_create_method == 'nginx'
loop_control:
loop_var: cert_item

- import_tasks: renew-cron.yml
when: certbot_auto_renew
2 changes: 0 additions & 2 deletions vars/Ubuntu-16.04.yml

This file was deleted.

2 changes: 0 additions & 2 deletions vars/default.yml

This file was deleted.

Loading