radify/radiian

View on GitHub
lib/templates/tag-old-nodes.yaml.mustache

Summary

Maintainability
Test Coverage
---
- hosts: all
  gather_facts: false
  sudo: no
  vars:
    region: '{{{ region }}}'
  tasks:
  - name: Get instance ec2 facts
    action: ec2_facts
    register: ec2_facts
  - name: Add a tag "{{{ tag_old_app }}}" to all existing nodes, so we can filter them out later
    local_action: ec2_tag resource={{=<% %>=}}{{ec2_facts.ansible_facts.ansible_ec2_instance_id}}<%={{ }}=%> region='{{=<% %>=}}{{ec2_facts.ansible_facts.ansible_ec2_placement_region}}<%={{ }}=%>' state=present
    args:
      tags:
        {{{ tag_old_app }}}: true