Skip to content

Instantly share code, notes, and snippets.

// Try to find a contact that is connected to a node
// with an email addrss of [email protected] or [email protected]
// Pick the first one (there should never be multiple contacts with the same emails)
// but just in case, pick the first found)
MATCH (e1:Email)-[:EMAIL]-(c1:Contact)
WHERE (e1.address IN ['[email protected]','[email protected]'])
WITH e1,c1
LIMIT 1
// Create or make user based on ID
MERGE (u:User {id: 3})
---
- hosts: tag_Name_MyApp:&tag_Env_staging:&tag_Role_web
roles:
- common
- web
- ruby
- mongos_client
---
- hosts: localhost
vars_files:
# Todo: Find a way of putting this in another file and including it. Otherwise we'll be repeating it all over the place.
- ["inventory/group_vars/{{ env_name | mandatory }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}-{{ role_name }}.yml", "inventory/group_vars/empty.yml"]
pre_tasks:
- debug: var=num_servers_to_provision
roles:
---
- hosts: localhost
vars_files:
# Todo: Find a way of putting this in another file and including it. Otherwise we'll be repeating it all over the place.
- ["inventory/group_vars/{{ env_name | mandatory }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}-{{ role_name }}.yml", "inventory/group_vars/empty.yml"]
pre_tasks:
- debug: var=num_servers_to_provision
roles:
---
- hosts: localhost
include: myvars.yml
pre_tasks:
- debug: var=num_servers_to_provision
roles:
- {role: provision}