Created
November 16, 2015 22:49
-
-
Save adz/e298bff83fcd97d47ca0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get contents of conf dir | |
- shell: ls -1 {{ nginx_conf_dir }}/*.conf | |
register: contents | |
when: nginx_sites | |
# so we can delete the ones we don't manage | |
- name: empty old confs | |
file: path="{{ item }}" state=absent | |
with_items: contents.stdout_lines | |
when: nginx_sites and item not in nginx_confs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment