multi_inventory.yaml.example 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # multi ec2 inventory configs
  2. #
  3. cache_location: ~/.ansible/tmp/multi_inventory.cache
  4. accounts:
  5. - name: aws1
  6. provider: aws/ec2.py
  7. provider_files:
  8. - name: ec2.ini
  9. content: |-
  10. [ec2]
  11. regions = all
  12. regions_exclude = us-gov-west-1,cn-north-1
  13. destination_variable = public_dns_name
  14. route53 = False
  15. cache_path = ~/.ansible/tmp
  16. cache_max_age = 300
  17. vpc_destination_variable = ip_address
  18. env_vars:
  19. AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXX
  20. AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  21. EC2_INI_PATH: ${tmpdir}/ec2.ini # we replace ${tmpdir} with the temporary directory that we've created for the provider.
  22. extra_vars:
  23. cloud: aws
  24. account: aws1
  25. - name: mygce
  26. extra_vars:
  27. cloud: gce
  28. account: gce1
  29. env_vars:
  30. GCE_INI_PATH: ${tmpdir}/gce.ini # we replace ${tmpdir} with the temporary directory that we've created for the provider.
  31. provider: gce/gce.py
  32. provider_files:
  33. - name: priv_key.pem
  34. contents: |-
  35. -----BEGIN PRIVATE KEY-----
  36. yourprivatekeydatahere
  37. -----END PRIVATE KEY-----
  38. - name: gce.ini
  39. contents: |-
  40. [gce]
  41. gce_service_account_email_address = <uuid>@developer.gserviceaccount.com
  42. gce_service_account_pem_file_path = ${tmpdir}/priv_key.pem # we replace ${tmpdir} with the temporary directory that we've created for the provider.
  43. gce_project_id = gce-project
  44. zone = us-central1-a
  45. network = default
  46. gce_machine_type = n1-standard-2
  47. gce_machine_image = rhel7
  48. cache_max_age: 600