vpc_and_subnet_id.yml 535 B

12345678910111213141516171819202122232425
  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 vcpout
  9. debug:
  10. var: vpcout
  11. verbosity: 1
  12. - name: fetch the default subnet id
  13. ec2_vpc_subnet_facts:
  14. region: "{{ openshift_aws_region }}"
  15. filters:
  16. "availability-zone": "{{ openshift_aws_subnet_az }}"
  17. vpc-id: "{{ vpcout.vpcs[0].id }}"
  18. register: subnetout
  19. - name: debug subnetout
  20. debug:
  21. var: subnetout
  22. verbosity: 1