#!/bin/bash
...
# Ensure the app's cache is up to date
inventory/ec2.py --refresh-cache
echo 'Now terminate any instances with tag "old"'
ansible-playbook destroy-old-nodes.yaml --limit tag_old_whatever_True || true
Without that extra refresh cache the old nodes don't get removed
Without that extra refresh cache the old nodes don't get removed