-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdebugTest.yml
More file actions
40 lines (35 loc) · 824 Bytes
/
Copy pathdebugTest.yml
File metadata and controls
40 lines (35 loc) · 824 Bytes
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
---
- name: Let's test debug
hosts: localhost
gather_facts: false
vars:
region: us-west-2
count: 1
id_base: aws-twr
tasks:
- name: create/launch
ec2:
keypair: dsilva
group: dsilva-demo
image: ami-5189a661
instance_type: t2.micro
region: "{{ region }}"
instance_tags:
Name: "dsilva_demo"
count: "{{ count }}"
wait: true
register: ec2
- name: tag it
ec2_tag:
resource: "{{ item.id }}"
region: "{{ region }}"
state: present
tags:
Name: "{{ id_base }}-{{ item.id }}"
with_items: ec2.instances
- name: create output
debug:
msg: "{% set comma = joiner(',') %}
{% for host in ec2.instances -%}
'{{ comma() }}{{ host.dns_name }}'
{%- endfor %}"