DCD-224: Move EC2 metadata retrieval to aws_common

This commit is contained in:
Steve Smith
2019-04-11 12:02:41 +10:00
parent bc893a0a2e
commit 1651b7b3ee
5 changed files with 9 additions and 11 deletions

View File

@@ -8,5 +8,5 @@
** This is where env-vars should be converted to Ansible vars. It also acts as a required-env list.
** The CF env is usually stored in /etc/atl. The script `bin/ansible-with-atl-env` will run Ansible with that environment set.
* Runtime information about the EC2 environment can be injected by depending on
`aws_metadata` in a role's `meta/main.yml`.
`aws_common` in a role's `meta/main.yml` (or adding it to the playbook before
the requiring role.

View File

@@ -6,3 +6,8 @@
- ec2-utils
- amazon-ssm-agent
- amazon-efs-utils
- name: Fetch local EC2 metadata
ec2_metadata_facts:
# Guard is mostly for testing
when: ansible_system_vendor == "Amazon EC2"

View File

@@ -1,3 +1,3 @@
---
dependencies:
- aws_metadata
- aws_common

View File

@@ -4,7 +4,7 @@
file:
state: directory
path: "{{ atl_shared_mountpoint }}"
owner: "{{ product_user }}"
owner: "{{ atl_product_user }}"
mode: 0755
- name: Enable mountpoint in fstab

View File

@@ -1,7 +0,0 @@
---
# This role is primarily intended to be depended on via `meta` by
# roles that need runtime information available.
- name: Fetch local EC2 metadata
ec2_metadata_facts: