Skip to content

Instantly share code, notes, and snippets.

@Xerkus
Created December 18, 2013 15:18
Show Gist options
  • Save Xerkus/8024034 to your computer and use it in GitHub Desktop.
Save Xerkus/8024034 to your computer and use it in GitHub Desktop.
---
- name: Test
hosts: 127.0.0.1
connection: local
gather_facts: no
vars:
- modules: ['--with-http_image_filter_module', '--with-http_xslt_module']
- recompile: false
tasks:
- name: Get installed modules
shell: nginx -V
register: nginx_flags
ignore_errors: True
- set_fact:
recompile: true
when: "item not in nginx_flags.stderr"
with_items: modules
- name: Configure nginx
debug: msg="./configure --prefix=/opt/nginx {{modules|join(' ') }}"
when: recompile == true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment