algo/roles/cloud-ec2/tasks/cloudformation.yml
Elliot Murphy e3a6170ae6 AWS support for existing EIP (revised) (#1292)
* Support for associating to existing AWS Elastic IP

Signed-off-by: Elliot Murphy <statik@users.noreply.github.com>

* Backport ec2_eip_facts module for EIP support

This means that EIP support no longer requires Ansible 2.6
The local fact module has been named ec2_elasticip_facts
to avoid conflict with the ec2_eip_facts module whenever
the Ansible 2.6 upgrade takes place.

Signed-off-by: Elliot Murphy <statik@users.noreply.github.com>

* Update from review feedback.

Signed-off-by: Elliot Murphy <statik@users.noreply.github.com>

* Move to the native module. Add additional condition for existing Elastic IP
2019-05-20 14:40:51 +02:00

18 lines
602 B
YAML

---
- name: Deploy the template
cloudformation:
aws_access_key: "{{ access_key }}"
aws_secret_key: "{{ secret_key }}"
stack_name: "{{ stack_name }}"
state: "present"
region: "{{ algo_region }}"
template: roles/cloud-ec2/files/stack.yaml
template_parameters:
InstanceTypeParameter: "{{ cloud_providers.ec2.size }}"
PublicSSHKeyParameter: "{{ lookup('file', SSH_keys.public) }}"
ImageIdParameter: "{{ ami_image }}"
WireGuardPort: "{{ wireguard_port }}"
UseThisElasticIP: "{{ existing_eip }}"
tags:
Environment: Algo
register: stack