Advertisement
Guest User

Untitled

a guest
Oct 26th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. - name: Get facts for all Public IPs within a resource groups
  2. azure_rm_publicipaddress_facts:
  3. resource_group: "{{ resource_group }}"
  4. register: output_ip_address
  5.  
  6. - name: Get loadbalancer info
  7. azure_rm_loadbalancer_facts:
  8. resource_group: "{{ resource_group }}"
  9. name: "{{ loadbalancer_name }}"
  10. register: output
  11.  
  12. - name: Add all hosts
  13. add_host:
  14. groups: scalesethosts
  15. hostname: "{{ output_ip_address.ansible_facts.azure_publicipaddresses[0].properties.ipAddress }}_{{ item.properties.frontendPort }}"
  16. ansible_host: "{{ output_ip_address.ansible_facts.azure_publicipaddresses[0].properties.ipAddress }}"
  17. ansible_port: "{{ item.properties.frontendPort }}"
  18. ansible_ssh_user: "{{ admin_username }}"
  19. ansible_ssh_pass: "{{ admin_password }}"
  20. with_items:
  21. - "{{ output.ansible_facts.azure_loadbalancers[0].properties.inboundNatRules }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement