opentelekomcloud.cloud.tag – Manage tags on diverse OpenStack/OTC resources¶
Note
This plugin is part of the opentelekomcloud.cloud collection (version 0.9.0).
To install it use: ansible-galaxy collection install opentelekomcloud.cloud.
To use it in a playbook, specify: opentelekomcloud.cloud.tag.
New in version 0.0.1: of opentelekomcloud.cloud
Synopsis¶
set or delete tags on the OpenStack/OTC resources
Requirements¶
The below requirements are needed on the host that executes this module.
openstacksdk
openstacksdk >= 0.36.0
otcextensions
python >= 2.7
python >= 3.6
Parameters¶
Notes¶
Note
One and only one of
server,floating_ip,network,port,router,security_group,security_group_rule,subnet,trunkshould be set.The standard OpenStack environment variables, such as
OS_USERNAMEmay be used instead of providing explicit values.Auth information is driven by openstacksdk, which means that values can come from a yaml config file in /etc/ansible/openstack.yaml, /etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml, then from standard environment variables, then finally by explicit parameters in plays. More information can be found at https://docs.openstack.org/openstacksdk/
Examples¶
---
- name: replace all tags with a single tag on a server
os_tag:
server: "{{ server_name }}"
state: present
tags:
- new_tag
mode: replace
- name: replace all tags with a single tag on a network
os_tag:
network: "{{ network_name }}"
state: present
tags:
- new_tag
mode: replace
- name: append tags on instance
os_tag:
server: "{{ server_name }}"
state: present
mode: set
tags:
- new_tag1
- new_tag2
- name: remove all tags
os_tag:
server: "{{ server_name }}"
state: present
tags:
- name: remove only given tags
os_tag:
server: "{{ server_name }}"
state: present
tags:
- new_tag1
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
tags
list
/ elements=string
|
success |
Present tags on the instance.
Sample:
['tag1', 'tag2']
|
Authors¶
Artem Goncharov (@gtema)