Skip to content

Instantly share code, notes, and snippets.

@s-hertel
Last active November 1, 2017 13:28
Show Gist options
  • Save s-hertel/b807cef12db9ee66a2a314ee615498fd to your computer and use it in GitHub Desktop.
Save s-hertel/b807cef12db9ee66a2a314ee615498fd to your computer and use it in GitHub Desktop.
tasks:
- name: add two tags to a resource
ec2_tag:
state: present
resource: “{{ id }}”
tags:
foo: bar
name: test
#- name: this should remove the foo bar tag
# ec2_tag:
# state: absent
# resource: “{{ id }}”
# tags:
# foo: bar
- name: this task would also remove the foo bar tag
ec2_tag:
state: present
resource: “{{ id }}”
purge_tags: true # remove any existing tags that are not listed here
tags:
name: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment