Skip to content

Instantly share code, notes, and snippets.

@ralfbergs
Last active November 7, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbergs/4cfffc0d10c85806ff4035af6cb21c10 to your computer and use it in GitHub Desktop.
Save ralfbergs/4cfffc0d10c85806ff4035af6cb21c10 to your computer and use it in GitHub Desktop.
---
- set_fact:
myenv: "{{ env }}"
when: myenv is not defined
- name: "Find {{ myenv }} VPC id"
ec2_vpc_net_facts:
region: "{{ region }}"
filters:
"tag:Name": "{{ owner }}_vpc_{{ myenv }}"
register: aws_find_vpc_facts
env_devmgmt_name: "devmgmt"
---
dependencies:
- { role: aws.find-vpc, env: "devenvs", when: env == env_devmgmt_name }
---
- hosts: localhost
vars:
env: "{{ env_devmgmt_name }}"
roles:
- aws/create
TASK [debug] *******************************************************************
ok: [localhost] => {
"env": "devmgmt"
}
TASK [debug] *******************************************************************
ok: [localhost] => {
"env_devmgmt_name": "devmgmt"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment