Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/scaleway_container_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 container_namespace
12 community.general.scaleway_container_namespace:
13 state: present
14 name: '{{ container_namespace_name }}'
15 region: '{{ scaleway_region }}'
16 project_id: '{{ scw_project }}'
17 description: '{{ description }}'
18 register: integration_container_namespace
19
20 - name: Create container
21 community.general.scaleway_container:
22 state: present
23 name: '{{ name }}'
24 region: '{{ scaleway_region }}'
25 namespace_id: '{{ integration_container_namespace.container_namespace.id }}'
26 registry_image: '{{ image }}'
27 description: '{{ description }}'
28 environment_variables: '{{ environment_variables }}'
29 secret_environment_variables: '{{ secret_environment_variables }}'
30 port: '{{ port }}'
31
32 - name: Get container info
33 community.general.scaleway_container_info:
34 name: '{{ name }}'
35 region: '{{ scaleway_region }}'
36 namespace_id: '{{ integration_container_namespace.container_namespace.id }}'
37 register: cn_info_task
38
39 - ansible.builtin.debug:
40 var: cn_info_task
41
42 - name: Check module call result
43 ansible.builtin.assert:
44 that:
45 - cn_info_task is success
46 - cn_info_task is not changed
47
48 - name: Delete container
49 community.general.scaleway_container:
50 state: absent
51 name: '{{ name }}'
52 region: '{{ scaleway_region }}'
53 description: '{{ description }}'
54 namespace_id: '{{ integration_container_namespace.container_namespace.id }}'
55 registry_image: '{{ image }}'
56
57 - name: Delete container namespace
58 community.general.scaleway_container_namespace:
59 state: absent
60 name: '{{ container_namespace_name }}'
61 region: '{{ scaleway_region }}'
62 description: '{{ description }}'
63 project_id: '{{ scw_project }}'