Created
August 11, 2017 09:41
-
-
Save eumel8/94bf107edca947d2ad2f9c326e0c5447 to your computer and use it in GitHub Desktop.
[otc] search ecs instances by tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Request ecs list by tags from ECS API | |
uri: | |
url: "{{ AUTH_URL_ECS }}/servers?tags={{ mykey }}.{{ myvalue }}" | |
method: GET | |
return_content: yes | |
validate_certs: yes | |
HEADER_Content-Type: "application/json" | |
HEADER_X-Auth-Token: "{{ token['x_subject_token'] }}" | |
register: ecslist | |
- debug: | |
msg: "{{ (ecslist.content|from_json)|json_query('servers[].name') }}" | |
# ansible-playbook ecs.yml -e "mykey=mykey" -e "myvalue=myvalue" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
extended roles/ecs/tasks/main.yml with tags