Skip to content

Commit

Permalink
add 'only_certs' tag for easy skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jul 2, 2024
1 parent db882ef commit 75be8ea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ There are also some useful **tags** available:
* certs
* letsencrypt
* auth
* only_certs (can be used as skip-tag)

To debug errors - you can set the 'debug' variable at runtime:
```bash
Expand Down
2 changes: 1 addition & 1 deletion tasks/debian/add_certs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
when: "site.ssl.mode in ['ca', 'selfsigned', 'snakeoil', 'quick']"
args:
apply:
tags: [certs, sites]
tags: [certs, sites, only_certs]

- name: "Nginx | Site '{{ name }}' | Certs | Trying to copy cert pub"
ansible.builtin.copy:
Expand Down
2 changes: 1 addition & 1 deletion tasks/debian/add_site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
when:
- not site.plain_only | bool
- "site.ssl.mode in ['selfsigned', 'existing', 'ca', 'snakeoil', 'quick']"
tags: [certs]
tags: [certs, only_certs]

# as letsencrypt generator could be skipped on previous run
- name: "Nginx | Site '{{ name }}' | Checking if certificate exists"
Expand Down
6 changes: 3 additions & 3 deletions tasks/debian/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ansible.builtin.set_fact:
ng_letsencrypt_certs: "{{ NGINX_CONFIG.sites | prepare_letsencrypt(NGINX_CONFIG.state | default(defaults_site.state),
NGINX_CONFIG.letsencrypt.email, only_site | default(none)) }}"
tags: [certs, letsencrypt]
tags: [certs, letsencrypt, only_certs]

- name: Nginx | Getting certificates using LetsEncrypt
ansible.builtin.include_role:
Expand All @@ -28,10 +28,10 @@
service: 'nginx'
renew: "{{ NGINX_CONFIG.letsencrypt.renew }}"
no_log: true
tags: [certs, letsencrypt]
tags: [certs, letsencrypt, only_certs]
args:
apply:
tags: [certs, letsencrypt]
tags: [certs, letsencrypt, only_certs]

- name: Nginx | Removing site
ansible.builtin.include_tasks: rm_site.yml
Expand Down

0 comments on commit 75be8ea

Please sign in to comment.