summaryrefslogtreecommitdiffstats
path: root/inventory/multi_inventory.yaml.example
blob: 0f0788d18e5540f6f0d3a83a59df970e787518b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# multi ec2 inventory configs
#
cache_location: ~/.ansible/tmp/multi_inventory.cache

accounts:
  - name: aws1
    provider: aws/ec2.py
    provider_files:
    - name: ec2.ini
      content: |-
        [ec2]
        regions = all
        regions_exclude =  us-gov-west-1,cn-north-1
        destination_variable = public_dns_name
        route53 = False
        cache_path = ~/.ansible/tmp
        cache_max_age = 300
        vpc_destination_variable = ip_address
    env_vars:
      AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXX
      AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
      EC2_INI_PATH: ${tmpdir}/ec2.ini # we replace ${tmpdir} with the temporary directory that we've created for the provider.
    extra_vars:
      cloud: aws
      account: aws1

-   name: mygce
    extra_vars:
      cloud: gce
      account: gce1
    env_vars:
      GCE_INI_PATH: ${tmpdir}/gce.ini # we replace ${tmpdir} with the temporary directory that we've created for the provider.
    provider: gce/gce.py
    provider_files:
    - name: priv_key.pem
      contents: |-
        -----BEGIN PRIVATE KEY-----
        yourprivatekeydatahere
        -----END PRIVATE KEY-----
    - name: gce.ini
      contents: |-
        [gce]
        gce_service_account_email_address = <uuid>@developer.gserviceaccount.com
        gce_service_account_pem_file_path = ${tmpdir}/priv_key.pem # we replace ${tmpdir} with the temporary directory that we've created for the provider.
        gce_project_id = gce-project
        zone = us-central1-a
        network = default
        gce_machine_type = n1-standard-2
        gce_machine_image = rhel7

cache_max_age: 600