[Scaleway] Add module to manage function namespaces (#5415)

* [Scaleway] Add module to manage function namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* rename short_descriptions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* handle changed verification on hashed secret values

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix syntax for python 2.6

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing argon2 in unittest

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing value on description field

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
This commit is contained in:
Guillaume MARTINEZ 2022-11-02 20:11:04 +01:00 committed by GitHub
commit 5fe0f57033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 962 additions and 1 deletions

View file

@ -0,0 +1,6 @@
# Copyright (c) 2022, Guillaume MARTINEZ <lunik@tiwabbit.fr>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
cloud/scaleway
unsupported

View file

@ -0,0 +1,13 @@
---
# Copyright (c) 2022, Guillaume MARTINEZ <lunik@tiwabbit.fr>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
scaleway_region: fr-par
name: fn-ansible-test
description: Function namespace used for testing scaleway_function_namespace_info ansible module
updated_description: Function namespace used for testing scaleway_function_namespace_info ansible module (Updated description)
environment_variables:
MY_VAR: my_value
secret_environment_variables:
MY_SECRET_VAR: my_secret_value

View file

@ -0,0 +1,43 @@
---
####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
# Copyright (c) 2022, Guillaume MARTINEZ <lunik@tiwabbit.fr>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Create function_namespace
community.general.scaleway_function_namespace:
state: present
name: '{{ name }}'
region: '{{ scaleway_region }}'
project_id: '{{ scw_project }}'
description: '{{ description }}'
secret_environment_variables: '{{ secret_environment_variables }}'
- name: Get function namespace info
community.general.scaleway_function_namespace_info:
name: '{{ name }}'
region: '{{ scaleway_region }}'
project_id: '{{ scw_project }}'
register: fn_info_task
- ansible.builtin.debug:
var: fn_info_task
- name: Check module call result
ansible.builtin.assert:
that:
- fn_info_task is success
- fn_info_task is not changed
- "'hashed_value' in fn_info_task.function_namespace.secret_environment_variables[0]"
- name: Delete function namespace
community.general.scaleway_function_namespace:
state: absent
name: '{{ name }}'
region: '{{ scaleway_region }}'
description: '{{ description }}'
project_id: '{{ scw_project }}'