blob: 852adc7b5881842ff1487e5ce11a96ec6e5c7c20 (
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
|
---
# This task file expects l_nodes_to_build to be passed in.
# When openshift_aws_use_custom_ami is '' then
# we retrieve the latest build AMI.
# Then set openshift_aws_ami to the ami.
- when: openshift_aws_ami == ''
block:
- name: fetch recently created AMI
ec2_ami_find:
region: "{{ openshift_aws_region }}"
sort: creationDate
sort_order: descending
name: "{{ openshift_aws_ami_name }}*"
ami_tags: "{{ openshift_aws_ami_tags }}"
no_result_action: fail
register: amiout
- name: Set the openshift_aws_ami
set_fact:
openshift_aws_ami: "{{ amiout.results[0].ami_id }}"
when:
- "'results' in amiout"
- amiout.results|length > 0
# Need to set epoch time in one place to use for launch_config and scale_group
- set_fact:
l_epoch_time: "{{ ansible_date_time.epoch }}"
- when: openshift_aws_create_launch_config
include: launch_config.yml
- when: openshift_aws_create_scale_group
include: scale_group.yml
|