Skip to content

Instantly share code, notes, and snippets.

@mzeier
Created November 12, 2018 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzeier/d9fd235988c8fcc336d550a47524aadd to your computer and use it in GitHub Desktop.
Save mzeier/d9fd235988c8fcc336d550a47524aadd to your computer and use it in GitHub Desktop.
Tag instances to exclude
mrz-masaba:anisble mrz$ ansible-playbook fdb-excludes.yml \
> -l tag_cluster_red:\&tag_mirror_primary \
> -t "mark" -e "cluster=red" \
> -e mode=ssd \
> -e mirror=primary
PLAY [tag_index_1:&tag_role_db:!tag_planned_removal_true] ***************************************************************************
TASK [Gathering Facts] **************************************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : fail] ***********************************************************************************************************
skipping: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : fail] ***********************************************************************************************************
skipping: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : fail] ***********************************************************************************************************
skipping: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : gather ec2_facts] ***********************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : remove deps and re-install in proper order.] ********************************************************************
ok: [red_2b_db1_i_059a3574011096da1] => (item={u'name': u'aws'})
ok: [red_2b_db1_i_059a3574011096da1] => (item={u'name': u'fabric'})
TASK [fdb-exclude : ensure required deps are present] *******************************************************************************
changed: [red_2b_db1_i_059a3574011096da1] => (item={u'name': u'awscli'})
changed: [red_2b_db1_i_059a3574011096da1] => (item={u'name': u'boto'})
TASK [fdb-exclude : Get a list of existing instances] *******************************************************************************
changed: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : set_fact] *******************************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : set_fact] *******************************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : set_fact] *******************************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1]
TASK [fdb-exclude : debug] **********************************************************************************************************
ok: [red_2b_db1_i_059a3574011096da1] => {
"instances_to_mark": [
"i-059a3574011096da1",
"i-002cb6194a8594414",
"i-0b1d0ad6fe5a5dda7"
]
}
TASK [fdb-exclude : Tag this node for exclusion] ************************************************************************************
changed: [red_2b_db1_i_059a3574011096da1] => (item=i-059a3574011096da1)
changed: [red_2b_db1_i_059a3574011096da1] => (item=i-002cb6194a8594414)
changed: [red_2b_db1_i_059a3574011096da1] => (item=i-0b1d0ad6fe5a5dda7)
TASK [fdb-exclude : include] ********************************************************************************************************
PLAY RECAP **************************************************************************************************************************
red_2b_db1_i_059a3574011096da1 : ok=10 changed=3 unreachable=0 failed=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment