---
- hosts:                "{{ stage }}" # Easy execution via: `ansible-playbook provision.yml -e stage=local`
  gather_facts:         yes           # Host specs required for templates

  roles:
    - prepare           # (Required) Stop any existing evolution services

    - common            # (Required) Base configuration
    - user              # (Required) User for SSH/Ansible/Capistrano auth
    - apache            # (Required) Web server (Soon: Nginx)
    - mysql             # (Required) Database server (Soon: Maria)
    - php               # (Required) PHP 5.3
    - node              # (Required) Tools for deployment (e.g. `bower`)
    - wp-cli            # (Required) CLI for managing WordPress

    # Optional Features
    <% if (props.ssl) { %>- pound             # (Optional) SSL support & decryption<% } %><% props.roles.map(function(role) { %>
    <%= role.checked ? '-' : '#' %> <%= role.value %><% }) %>
<% if (props.newrelic) { %>    - newrelic          # (Optional) New Relic application/server monitoring
<% } %><% if (props.datadog) { %>    - { role: Datadog.datadog, sudo: yes, when: stage == 'production' } # (Optional) Datadog monitoring support
<% } %>    # /Optional Features

    - cleanup           # (Required) Generate init.d for installed evolution services

---
- hosts:                "{{ stage }}" # Easy execution via: `ansible-playbook provision.yml -e stage=local`
  gather_facts:         yes           # Host specs required for templates

  roles:
    - prepare           # (Required) Stop any existing evolution services

    - common            # (Required) Base configuration
    - user              # (Required) User for SSH/Ansible/Capistrano auth
    - apache            # (Required) Web server (Soon: Nginx)
    - mysql             # (Required) Database server (Soon: Maria)
    - php               # (Required) PHP 5.3
    - node              # (Required) Tools for deployment (e.g. `bower`)
    - wp-cli            # (Required) CLI for managing WordPress

    # Optional Features
    <% if (props.ssl) { %>- pound             # (Optional) SSL support & decryption<% } %><% props.roles.map(function(role) { %>
    <%= role.checked ? '-' : '#' %> <%= role.value %><% }) %>
<% if (props.newrelic) { %>    - { role: newrelic, sudo: yes, when: stage == 'production' }        # (Optional) New Relic application/server monitoring
<% } %><% if (props.datadog) { %>    - { role: Datadog.datadog, sudo: yes, when: stage == 'production' } # (Optional) Datadog monitoring support
<% } %>    # /Optional Features

    - cleanup           # (Required) Generate init.d for installed evolution services

Provision should run newrelic role ONLY for production
Provision should run newrelic role ONLY for production
