From 6c63e70b92e24730f24df554c97d9e0f1f40ad82 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 8 Apr 2019 14:18:19 +1000 Subject: [PATCH] DCD-224: Add inventory file for SSH tunnel. --- group_vars/all.yml | 2 +- inv/tunnel | 7 +++++++ roles/aws_metadata/tasks/main.yml | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 inv/tunnel diff --git a/group_vars/all.yml b/group_vars/all.yml index f6e0984..f545972 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -6,5 +6,5 @@ atl_shared_mountpoint: "/media/atl" # The following are imports from the environment. These are generally # set in /etc/atl by the CloudFormation template and sourced before -# Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper. +# Ansible is run. See bin/ansible-with-atl-env for a convenient wrapper atl_efs_id: "{{ lookup('env', 'ATL_EFS_ID') }}" diff --git a/inv/tunnel b/inv/tunnel new file mode 100644 index 0000000..8c04110 --- /dev/null +++ b/inv/tunnel @@ -0,0 +1,7 @@ +# This is for use with an ssh tunnel to the target host via a bastion. To use create a port-forward with ssh e.g: +# +# ssh -L 2222:${TARGETIP}:22 ec2-user@${BASTIONHOST} +# +# Where $BASTIONHOST is the bastion public ip/hostname, and $TARGETIP is the private IP of the target host. +[all] +ec2-user@localhost ansible_port=2222 diff --git a/roles/aws_metadata/tasks/main.yml b/roles/aws_metadata/tasks/main.yml index 1df971b..b40b29b 100644 --- a/roles/aws_metadata/tasks/main.yml +++ b/roles/aws_metadata/tasks/main.yml @@ -5,4 +5,3 @@ - name: Fetch local EC2 metadata ec2_metadata_facts: -