Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/scaleway_function_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) 2022, Guillaume MARTINEZ <[email protected]>
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: Create function_namespace
12 community.general.scaleway_function_namespace:
13 state: present
14 name: '{{ function_namespace_name }}'
15 region: '{{ scaleway_region }}'
16 project_id: '{{ scw_project }}'
17 description: '{{ description }}'
18 register: integration_function_namespace
19
20 - name: Create function
21 community.general.scaleway_function:
22 state: present
23 name: '{{ name }}'
24 region: '{{ scaleway_region }}'
25 namespace_id: '{{ integration_function_namespace.function_namespace.id }}'
26 runtime: '{{ runtime }}'
27 description: '{{ description }}'
28 environment_variables: '{{ environment_variables }}'
29 secret_environment_variables: '{{ secret_environment_variables }}'
30
31 - name: Get function info
32 community.general.scaleway_function_info:
33 name: '{{ name }}'
34 region: '{{ scaleway_region }}'
35 namespace_id: '{{ integration_function_namespace.function_namespace.id }}'
36 register: fn_info_task
37
38 - ansible.builtin.debug:
39 var: fn_info_task
40
41 - name: Check module call result
42 ansible.builtin.assert:
43 that:
44 - fn_info_task is success
45 - fn_info_task is not changed
46
47 - name: Delete function
48 community.general.scaleway_function:
49 state: absent
50 name: '{{ name }}'
51 region: '{{ scaleway_region }}'
52 description: '{{ description }}'
53 namespace_id: '{{ integration_function_namespace.function_namespace.id }}'
54 runtime: '{{ runtime }}'
55
56 - name: Delete function namespace
57 community.general.scaleway_function_namespace:
58 state: absent
59 name: '{{ function_namespace_name }}'
60 region: '{{ scaleway_region }}'
61 description: '{{ description }}'
62 project_id: '{{ scw_project }}'