Keep OpenStack VMs with Tag keep_me

so we can have some systems for debugging

(cherry picked from commit 5dc895fbee)
This commit is contained in:
Alexander Todorov 2019-02-08 12:23:40 +02:00 committed by Brian C. Lane
parent f7e71768fa
commit ea63fbcc5b

View File

@ -65,9 +65,9 @@ rlJournalStart
name: "{{item.id}}"
state: absent
loop: "{{openstack_servers}}"
when: item.created < lookup('env','TIMESTAMP')
when: item.created < lookup('env','TIMESTAMP') and (item.metadata.Tag is not defined or item.metadata.Tag != "keep_me")
loop_control:
label: "{{item.name}} (id: {{item.id}} created: {{item.created}})"
label: "{{item.name}} (id: {{item.id}} created: {{item.created}} metadata: {{item.metadata}})"
__EOF__
rlLogInfo "Removing VMs created before $TIMESTAMP"