vpc_and_subnet_id.yml 429 B

123456789101112131415161718
  1. ---
  2. - name: query vpc
  3. ec2_vpc_net_facts:
  4. region: "{{ openshift_aws_region }}"
  5. filters:
  6. 'tag:Name': "{{ openshift_aws_vpc_name }}"
  7. register: vpcout
  8. - name: debug
  9. debug: var=vpcout
  10. - name: fetch the default subnet id
  11. ec2_vpc_subnet_facts:
  12. region: "{{ openshift_aws_region }}"
  13. filters:
  14. "tag:Name": "{{ openshift_aws_subnet_name }}"
  15. vpc-id: "{{ vpcout.vpcs[0].id }}"
  16. register: subnetout