Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/memset_server_info/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: query API with invalid API key
12 memset_server_info:
13 api_key: 'wa9aerahhie0eekee9iaphoorovooyia'
14 name: 'testyaa1'
15 ignore_errors: true
16 register: result
17
18 - name: check API response with invalid API key
19 assert:
20 that:
21 - "'Memset API returned a 403 response (ApiErrorForbidden, Bad api_key)' in result.msg"
22 - result is not successful
23
24 - name: request server infos
25 memset_server_info:
26 api_key: "{{ api_key }}"
27 name: 'testyaa1'
28 register: result
29
30 - name: check the request succeeded
31 assert:
32 that:
33 - result is not changed
34 - result is successful