Commit a3f92eca by Max Rothman

Deal with disks with no fs and make the ec2_lookup failsafe work

parent a6aa82ad
...@@ -225,20 +225,19 @@ ...@@ -225,20 +225,19 @@
with_items: metric_alarms with_items: metric_alarms
when: auto_scaling_service when: auto_scaling_service
- name: See if instances already exist - name: Transform tags into dict format for the modules that expect it
local_action:
module: "ec2_lookup"
region: "{{ aws_region }}"
tags: "{{ asg_instance_tags }}"
register: potential_existing_instances
- name: Transform tags to the format ec2 module expects
util_map: util_map:
function: zip_to_dict function: zip_to_dict
input: "{{ asg_instance_tags }}" input: "{{ asg_instance_tags }}"
args: ['key', 'value'] args: ['key', 'value']
register: reformatted_asg_instance_tags register: reformatted_asg_instance_tags
- name: See if instances already exist
ec2_lookup:
region: "{{ aws_region }}"
tags: "{{ reformatted_asg_instance_tags.function_output }}"
register: potential_existing_instances
#This task will create the number of instances requested (create_instances parameter). #This task will create the number of instances requested (create_instances parameter).
# By default, it will create instances equaling the number of subnets specified. # By default, it will create instances equaling the number of subnets specified.
#Modulo logic explained: The subnet specified will be the instance number modulo the number of subnets, #Modulo logic explained: The subnet specified will be the instance number modulo the number of subnets,
...@@ -290,13 +289,13 @@ ...@@ -290,13 +289,13 @@
- name: Gather facts - name: Gather facts
setup: setup:
- name: Unmount disks mounted to the wrong place - name: Unmount all specified disks that are currently mounted
mount: mount:
name: "{{ item[0].mount }}" name: "{{ item[0].mount }}"
src: "{{ item[0].device }}" src: "{{ item[0].device }}"
fstype: "{{ item[0].fstype }}" fstype: "{{ item[0].fstype }}"
state: unmounted state: absent
when: item[1].device_name == item[0].device and item[1].mount != item[0].mount when: item[1].device_name == item[0].device
with_nested: with_nested:
- ansible_mounts - ansible_mounts
- volumes - volumes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment