diff options
author | Rémy Léone <rleone@scaleway.com> | 2019-04-01 10:54:34 +0200 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2019-04-09 15:41:30 -0700 |
commit | 16c4df439a6cf9b9a3cd6847ba6be654c8f8f3f6 (patch) | |
tree | df5b1fb2e243a9531ea16d756d9f218e8de4968f /test/legacy | |
parent | 5215d004626856b3d0faa2bc8b5b2e84a2fb807e (diff) | |
download | ansible-16c4df439a6cf9b9a3cd6847ba6be654c8f8f3f6.tar.gz |
Migrate Scaleway tests to integration tests
Diffstat (limited to 'test/legacy')
39 files changed, 0 insertions, 2755 deletions
diff --git a/test/legacy/roles/scaleway_compute/defaults/main.yml b/test/legacy/roles/scaleway_compute/defaults/main.yml deleted file mode 100644 index 4b2b2799c3..0000000000 --- a/test/legacy/roles/scaleway_compute/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Below information has been taken from https://developer.scaleway.com/#servers ---- -scaleway_image_id: 6a601340-19c1-4ca7-9c1c-0704bcc9f5fe -scaleway_organization: '{{ scw_org }}' -scaleway_region: ams1 -scaleway_commerial_type: START1-S -scaleway_name: scaleway_compute_test -first_server_name: scaleway_compute_test_first -second_server_name: scaleway_compute_test_second diff --git a/test/legacy/roles/scaleway_compute/tasks/ip.yml b/test/legacy/roles/scaleway_compute/tasks/ip.yml deleted file mode 100644 index 445e955d8c..0000000000 --- a/test/legacy/roles/scaleway_compute/tasks/ip.yml +++ /dev/null @@ -1,201 +0,0 @@ -- name: Create a server with no IP (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - - register: server_creation_absent_check_task - -- debug: var=server_creation_absent_check_task - -- assert: - that: - - server_creation_absent_check_task is success - - server_creation_absent_check_task is changed - -- name: Create a server - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_absent_task - -- debug: var=server_creation_absent_task - -- assert: - that: - - server_creation_absent_task is success - - server_creation_absent_task is changed - -- name: Create a server (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_absent_confirmation_task - -- debug: var=server_creation_absent_confirmation_task - -- assert: - that: - - server_creation_absent_confirmation_task is success - - server_creation_absent_confirmation_task is not changed - -# Add a dynamic IP to the instance - -- name: Patch server tags (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: dynamic - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - - register: ip_patching_check_task - -- debug: var=ip_patching_check_task - -- assert: - that: - - ip_patching_check_task is success - - ip_patching_check_task is changed - -- name: Patch server tags - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: dynamic - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - register: ip_patching_task - -- debug: var=ip_patching_task - -- assert: - that: - - ip_patching_task is success - - ip_patching_task is changed - -- name: Patch server tags (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: dynamic - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: ip_patching_confirmation_task - -- debug: var=ip_patching_confirmation_task - -- assert: - that: - - ip_patching_confirmation_task is success - - ip_patching_confirmation_task is not changed - -# Remove dynamic IP - -- name: Patch server tags (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - - register: remove_ip_check_task - -- debug: var=remove_ip_check_task - -- assert: - that: - - remove_ip_check_task is success - - remove_ip_check_task is changed - -- name: Patch server tags - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: remove_ip_task - -- debug: var=remove_ip_task - -- assert: - that: - - remove_ip_task is success - - remove_ip_task is changed - -- name: Patch server tags (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - public_ip: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: remove_ip_confirmation_task - -- debug: var=remove_ip_confirmation_task - -- assert: - that: - - remove_ip_confirmation_task is success - - remove_ip_confirmation_task is not changed - -- name: Destroy it - scaleway_compute: - name: '{{ scaleway_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_destroy_task - -- debug: var=server_destroy_task - -- assert: - that: - - server_destroy_task is success - - server_destroy_task is changed
\ No newline at end of file diff --git a/test/legacy/roles/scaleway_compute/tasks/main.yml b/test/legacy/roles/scaleway_compute/tasks/main.yml deleted file mode 100644 index 922b1ea30f..0000000000 --- a/test/legacy/roles/scaleway_compute/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -# SCW_API_KEY='XXX' SCW_ORG='YYY' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_compute - -- include_tasks: state.yml -- include_tasks: ip.yml -- include_tasks: security_group.yml -- include_tasks: pagination.yml diff --git a/test/legacy/roles/scaleway_compute/tasks/pagination.yml b/test/legacy/roles/scaleway_compute/tasks/pagination.yml deleted file mode 100644 index 0ba108b847..0000000000 --- a/test/legacy/roles/scaleway_compute/tasks/pagination.yml +++ /dev/null @@ -1,71 +0,0 @@ -- name: Create a first server - scaleway_compute: - name: '{{ first_server_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - -- name: Create a second server - scaleway_compute: - name: '{{ second_server_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - -- name: Get server informations of the first page - scaleway_server_facts: - region: par1 - query_parameters: - per_page: 1 - page: 1 - register: first_page - -- debug: var=first_page - -- assert: - that: - - first_page is success - -- name: Get server informations of the second page - scaleway_server_facts: - region: par1 - query_parameters: - per_page: 1 - page: 2 - register: second_page - -- debug: var=second_page - -- assert: - that: - - second_page is success - -- assert: - that: - - first_page.ansible_facts.scaleway_server_facts[0].id != second_page.ansible_facts.scaleway_server_facts[0].id - -- name: Delete first server - scaleway_compute: - name: '{{ first_server_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - -- name: Delete second server - scaleway_compute: - name: '{{ second_server_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true diff --git a/test/legacy/roles/scaleway_compute/tasks/security_group.yml b/test/legacy/roles/scaleway_compute/tasks/security_group.yml deleted file mode 100644 index a0e273c2ca..0000000000 --- a/test/legacy/roles/scaleway_compute/tasks/security_group.yml +++ /dev/null @@ -1,147 +0,0 @@ -- name: Create a scaleway security_group - scaleway_security_group: - state: present - region: '{{ scaleway_region }}' - name: test_compute - description: test_compute - organization: '{{ scaleway_organization }}' - stateful: true - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group - -- debug: var=security_group - -- block: - - name: Create a server with security_group (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - - register: server_creation_check_task - - - debug: var=server_creation_check_task - - - assert: - that: - - server_creation_check_task is success - - server_creation_check_task is changed - - - name: Create a server - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - wait: true - - register: server_creation_task - - - debug: var=server_creation_task - - - assert: - that: - - server_creation_task is success - - server_creation_task is changed - - - name: Create a server with security_group (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - wait: true - - register: server_creation_confirmation_task - - - debug: var=server_creation_confirmation_task - - - assert: - that: - - server_creation_confirmation_task is success - - server_creation_confirmation_task is not changed - - - name: Keep current security_group (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - wait: true - - register: server_creation_confirmation_task - - - debug: var=server_creation_confirmation_task - - - assert: - that: - - server_creation_confirmation_task is success - - server_creation_confirmation_task is not changed - - - name: Keep current security_group - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_confirmation_task - - - debug: var=server_creation_confirmation_task - - - assert: - that: - - server_creation_confirmation_task is success - - server_creation_confirmation_task is not changed - - always: - - name: Destroy it - scaleway_compute: - name: '{{ scaleway_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_destroy_task - - - debug: var=server_destroy_task - - - assert: - that: - - server_destroy_task is success - - server_destroy_task is changed - - - name: Create a scaleway security_group - scaleway_security_group: - state: absent - region: '{{ scaleway_region }}' - name: test_compute - description: test_compute - organization: '{{ scaleway_organization }}' - stateful: true - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false diff --git a/test/legacy/roles/scaleway_compute/tasks/state.yml b/test/legacy/roles/scaleway_compute/tasks/state.yml deleted file mode 100644 index effd27e85f..0000000000 --- a/test/legacy/roles/scaleway_compute/tasks/state.yml +++ /dev/null @@ -1,387 +0,0 @@ -- name: Create a server (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - - register: server_creation_check_task - -- debug: var=server_creation_check_task - -- assert: - that: - - server_creation_check_task is success - - server_creation_check_task is changed - -- name: Create a server - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_task - -- debug: var=server_creation_task - -- assert: - that: - - server_creation_task is success - - server_creation_task is changed - -- name: Create a server (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_confirmation_task - -- debug: var=server_creation_confirmation_task - -- assert: - that: - - server_creation_confirmation_task is success - - server_creation_confirmation_task is not changed - -- name: Patch server tags (Check) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - tags: - - test - - www - register: server_patching_check_task - -- debug: var=server_patching_check_task - -- assert: - that: - - server_patching_check_task is success - - server_patching_check_task is changed - -- name: Patch server tags - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_patching_task - -- debug: var=server_patching_task - -- assert: - that: - - server_patching_task is success - - server_patching_task is changed - -- name: Patch server tags (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_patching_confirmation_task - -- debug: var=server_patching_confirmation_task - -- assert: - that: - - server_patching_confirmation_task is success - - server_patching_confirmation_task is not changed - -- name: Run it (Check mode) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: running - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - tags: - - test - - www - register: server_run_check_task - -- debug: var=server_run_check_task - -- assert: - that: - - server_run_check_task is success - - server_run_check_task is changed - -- name: Run it - scaleway_compute: - name: '{{ scaleway_name }}' - state: running - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_run_task - -- debug: var=server_run_task - -- assert: - that: - - server_run_task is success - - server_run_task is changed - -- name: Run it - scaleway_compute: - name: '{{ scaleway_name }}' - state: running - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_run_confirmation_task - -- debug: var=server_run_confirmation_task - -- assert: - that: - - server_run_confirmation_task is success - - server_run_confirmation_task is not changed - -- name: Reboot it (Check mode) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: restarted - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - tags: - - test - - www - register: server_reboot_check_task - -- debug: var=server_reboot_check_task - -- assert: - that: - - server_reboot_check_task is success - - server_reboot_check_task is changed - -- name: Reboot it - scaleway_compute: - name: '{{ scaleway_name }}' - state: restarted - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_reboot_task - -- debug: var=server_reboot_task - -- assert: - that: - - server_reboot_task is success - - server_reboot_task is changed - -- name: Stop it (Check mode) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: stopped - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - tags: - - test - - www - register: server_stop_check_task - -- debug: var=server_stop_check_task - -- assert: - that: - - server_stop_check_task is success - - server_stop_check_task is changed - -- name: Stop it - scaleway_compute: - name: '{{ scaleway_name }}' - state: stopped - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_stop_task - -- debug: var=server_stop_task - -- assert: - that: - - server_stop_task is success - - server_stop_task is changed - -- name: Stop it (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: stopped - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_stop_confirmation_task - -- debug: var=server_stop_confirmation_task - -- assert: - that: - - server_stop_confirmation_task is success - - server_stop_confirmation_task is not changed - -- name: Destroy it (Check mode) - check_mode: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - tags: - - test - - www - register: server_destroy_check_task - -- debug: var=server_destroy_check_task - -- assert: - that: - - server_destroy_check_task is success - - server_destroy_check_task is changed - -- name: Destroy it - scaleway_compute: - name: '{{ scaleway_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_destroy_task - -- debug: var=server_destroy_task - -- assert: - that: - - server_destroy_task is success - - server_destroy_task is changed - -- name: Destroy it (Confirmation) - scaleway_compute: - name: '{{ scaleway_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - tags: - - test - - www - register: server_destroy_confirmation_task - -- debug: var=server_destroy_confirmation_task - -- assert: - that: - - server_destroy_confirmation_task is success - - server_destroy_confirmation_task is not changed - -- name: Testing for unauthorized organization - ignore_errors: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: '{{ scaleway_image_id }}' - organization: this-organization-does-not-exists - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - register: unauthorized_organization_task - -- debug: var=unauthorized_organization_task - -- assert: - that: - - unauthorized_organization_task is not success - - unauthorized_organization_task is not changed - -- name: Testing for unexisting image - ignore_errors: yes - scaleway_compute: - name: '{{ scaleway_name }}' - state: present - image: this-image-does-not-exists - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - register: unexisting_image_check - -- debug: var=unexisting_image_check - -- assert: - that: - - unexisting_image_check is not success - - unexisting_image_check is not changed - - unexisting_image_check.msg == "Error in getting image this-image-does-not-exists on https://cp-{{scaleway_region}}.scaleway.com" diff --git a/test/legacy/roles/scaleway_image_facts/tasks/main.yml b/test/legacy/roles/scaleway_image_facts/tasks/main.yml deleted file mode 100644 index aa5e745c9f..0000000000 --- a/test/legacy/roles/scaleway_image_facts/tasks/main.yml +++ /dev/null @@ -1,30 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_image_facts - - -- name: Get image informations and register it in a variable - scaleway_image_facts: - region: par1 - register: images - -- name: Display images variable - debug: - var: images - -- name: Ensure retrieval of images facts is success - assert: - that: - - images is success - -- name: Get image informations from ams1 and register it in a variable - scaleway_image_facts: - region: ams1 - register: images_ams1 - -- name: Display images variable from ams1 - debug: - var: images_ams1 - -- name: Ensure retrieval of images facts is success - assert: - that: - - images_ams1 is success diff --git a/test/legacy/roles/scaleway_ip/defaults/main.yml b/test/legacy/roles/scaleway_ip/defaults/main.yml deleted file mode 100644 index fe7aa93baf..0000000000 --- a/test/legacy/roles/scaleway_ip/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -scaleway_organization: '{{ scw_org }}' -scaleway_region: ams1 -scaleway_image_id: 89ee4018-f8c3-4dc4-a6b5-bca14f985ebe -scaleway_commerial_type: START1-S -scaleway_server_name: scaleway_ip_test_server -scaleway_reverse_name: scaleway.com diff --git a/test/legacy/roles/scaleway_ip/tasks/main.yml b/test/legacy/roles/scaleway_ip/tasks/main.yml deleted file mode 100644 index 9b639ad027..0000000000 --- a/test/legacy/roles/scaleway_ip/tasks/main.yml +++ /dev/null @@ -1,441 +0,0 @@ -# SCW_API_KEY='XXX' SCW_ORG='YYY' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_ip - -- name: Create IP (Check) - check_mode: yes - scaleway_ip: - state: present - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_creation_check_task - -- debug: var=ip_creation_check_task - -- name: ip_creation_check_task is success - assert: - that: - - ip_creation_check_task is success - -- name: ip_creation_check_task is changed - assert: - that: - - ip_creation_check_task is changed - -- name: Create IP - scaleway_ip: - state: present - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_creation_task - -- debug: var=ip_creation_task - -- name: ip_creation_task is success - assert: - that: - - ip_creation_task is success - -- name: ip_creation_task is changed - assert: - that: - - ip_creation_task is changed - -- name: ip_creation_task.scaleway_ip.server is none - assert: - that: - - '{{ ip_creation_task.scaleway_ip.server is none }}' - -- name: Create IP (Confirmation) - scaleway_ip: - id: '{{ ip_creation_task.scaleway_ip.id }}' - state: present - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_creation_confirmation_task - -- debug: var=ip_creation_confirmation_task - -- name: ip_creation_confirmation_task is success - assert: - that: - - ip_creation_confirmation_task is success - -- name: ip_creation_confirmation_task is not changed - assert: - that: - - ip_creation_confirmation_task is not changed - -- name: ip_creation_confirmation_task.scaleway_ip.server is none - assert: - that: - - '{{ ip_creation_task.scaleway_ip.server is none }}' - -- name: Assign reverse to server (Check) - check_mode: yes - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_reverse_assignation_check_task - -- debug: var=ip_reverse_assignation_check_task - -- name: ip_reverse_assignation_check_task is success - assert: - that: - - ip_reverse_assignation_check_task is success - -- name: ip_reverse_assignation_check_task is success - assert: - that: - - ip_reverse_assignation_check_task is success - -- name: Assign reverse to an IP - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_reverse_assignation_task - -- debug: var=ip_reverse_assignation_task - -- name: ip_reverse_assignation_task is success - assert: - that: - - ip_reverse_assignation_task is success - -- name: ip_reverse_assignation_task is changed - assert: - that: - - ip_reverse_assignation_task is changed - -- name: Assign reverse to an IP (Confirmation) - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_reverse_assignation_confirmation_task - -- debug: var=ip_reverse_assignation_confirmation_task - -- name: ip_reverse_assignation_confirmation_task is success - assert: - that: - - ip_reverse_assignation_confirmation_task is success - -- name: ip_reverse_assignation_confirmation_task is not changed - assert: - that: - - ip_reverse_assignation_confirmation_task is not changed - -- name: Create a server - scaleway_compute: - state: present - name: '{{ scaleway_server_name }}' - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - dynamic_ip_required: false - wait: true - - register: server_creation_task - -- debug: var=server_creation_task - -- name: server_creation_task is success - assert: - that: - - server_creation_task is success - -- name: Assign IP to server (Check) - check_mode: yes - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - server: '{{ server_creation_task.msg.id }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_assignation_check_task - -- debug: var=ip_assignation_check_task - -- name: ip_assignation_check_task is success - assert: - that: - - ip_assignation_check_task is success - -- name: ip_assignation_check_task is success - assert: - that: - - ip_assignation_check_task is success - -- name: Assign IP to server - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - server: '{{ server_creation_task.msg.id }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_assignation_task - -- debug: var=ip_assignation_task - -- name: ip_assignation_task is success - assert: - that: - - ip_assignation_task is success - -- name: ip_assignation_task is changed - assert: - that: - - ip_assignation_task is changed - -- name: Assign IP to server (Confirmation) - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - server: '{{ server_creation_task.msg.id }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_assignation_confirmation_task - -- debug: var=ip_assignation_confirmation_task - -- name: ip_assignation_confirmation_task is success - assert: - that: - - ip_assignation_confirmation_task is success - -- name: ip_assignation_confirmation_task is not changed - assert: - that: - - ip_assignation_confirmation_task is not changed - -- name: Unassign IP to server (Check) - check_mode: yes - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_unassignation_check_task - -- debug: var=ip_unassignation_check_task - -- name: ip_unassignation_check_task is success - assert: - that: - - ip_unassignation_check_task is success - -- name: ip_unassignation_check_task is changed - assert: - that: - - ip_unassignation_check_task is changed - -- name: Unassign IP to server - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_unassignation_task - -- debug: var=ip_unassignation_task - -- name: ip_unassignation_task is success - assert: - that: - - ip_unassignation_task is success - -- name: ip_unassignation_task is changed - assert: - that: - - ip_unassignation_task is changed - -- name: ip_unassignation_task.scaleway_ip.server is none - assert: - that: - - '{{ ip_unassignation_task.scaleway_ip.server is none }}' - -- name: Unassign IP to server (Confirmation) - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - reverse: '{{ scaleway_reverse_name }}' - register: ip_unassignation_confirmation_task - -- debug: var=ip_unassignation_confirmation_task - -- name: ip_unassignation_confirmation_task is success - assert: - that: - - ip_unassignation_confirmation_task is success - -- name: ip_unassignation_confirmation_task is not changed - assert: - that: - - ip_unassignation_confirmation_task is not changed - -- name: ip_unassignation_confirmation_task.scaleway_ip.server is none - assert: - that: - - '{{ ip_unassignation_task.scaleway_ip.server is none }}' - -- name: Unassign reverse to IP (Check) - check_mode: yes - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_reverse_unassignation_check_task - -- debug: var=ip_reverse_unassignation_check_task - -- name: ip_reverse_unassignation_check_task is success - assert: - that: - - ip_reverse_unassignation_check_task is success - -- name: ip_reverse_unassignation_check_task is changed - assert: - that: - - ip_reverse_unassignation_check_task is changed - -- name: Unassign reverse to an IP - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_reverse_unassignation_task - -- debug: var=ip_reverse_unassignation_task - -- name: ip_reverse_unassignation_task is success - assert: - that: - - ip_reverse_unassignation_task is success - -- name: ip_reverse_unassignation_task is changed - assert: - that: - - ip_reverse_unassignation_task is changed - -- name: ip_reverse_unassignation_task.scaleway_ip.reverse is none - assert: - that: - - '{{ ip_reverse_unassignation_task.scaleway_ip.reverse is none }}' - -- name: Unassign reverse to an IP (Confirmation) - scaleway_ip: - state: present - id: '{{ ip_creation_task.scaleway_ip.id }}' - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: ip_reverse_unassignation_confirmation_task - -- debug: var=ip_reverse_unassignation_confirmation_task - -- name: ip_reverse_unassignation_confirmation_task is success - assert: - that: - - ip_reverse_unassignation_confirmation_task is success - -- name: ip_reverse_unassignation_confirmation_task is not changed - assert: - that: - - ip_reverse_unassignation_confirmation_task is not changed - -- name: ip_reverse_unassignation_confirmation_task.scaleway_ip.server is none - assert: - that: - - '{{ ip_reverse_unassignation_confirmation_task.scaleway_ip.reverse is none }}' - -- name: Destroy a server - scaleway_compute: - name: '{{ scaleway_server_name }}' - state: absent - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - register: server_destroy_task - -- debug: var=server_destroy_task - -- name: server_destroy_task is success - assert: - that: - - server_destroy_task is success - -- name: server_destroy_task is changed - assert: - that: - - server_destroy_task is changed - -- name: Delete IP (Check) - check_mode: yes - scaleway_ip: - state: absent - region: '{{ scaleway_region }}' - id: '{{ ip_creation_task.scaleway_ip.id }}' - register: ip_deletion_check_task - -- name: ip_deletion_check_task is success - assert: - that: - - ip_deletion_check_task is success - -- name: ip_deletion_check_task is changed - assert: - that: - - ip_deletion_check_task is changed - -- name: Delete IP - scaleway_ip: - state: absent - region: '{{ scaleway_region }}' - id: '{{ ip_creation_task.scaleway_ip.id }}' - register: ip_deletion_task - -- name: ip_deletion_task is success - assert: - that: - - ip_deletion_task is success - -- name: ip_deletion_task is changed - assert: - that: - - ip_deletion_task is changed - -- name: Delete IP (Confirmation) - scaleway_ip: - state: absent - region: '{{ scaleway_region }}' - id: '{{ ip_creation_task.scaleway_ip.id }}' - register: ip_deletion_confirmation_task - -- name: ip_deletion_confirmation_task is success - assert: - that: - - ip_deletion_confirmation_task is success - -- name: ip_deletion_confirmation_task is not changed - assert: - that: - - ip_deletion_confirmation_task is not changed diff --git a/test/legacy/roles/scaleway_ip_facts/tasks/main.yml b/test/legacy/roles/scaleway_ip_facts/tasks/main.yml deleted file mode 100644 index f68fb84063..0000000000 --- a/test/legacy/roles/scaleway_ip_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_ip_facts - -- name: Get ip informations and register it in a variable - scaleway_ip_facts: - region: par1 - register: ips - -- name: Display ips variable - debug: - var: ips - -- name: Ensure retrieval of ips facts is success - assert: - that: - - ips is success - -- name: Get ip informations and register it in a variable - scaleway_ip_facts: - region: ams1 - register: ips_ams1 - -- name: Display ips variable - debug: - var: ips_ams1 - -- name: Ensure retrieval of ips facts is success - assert: - that: - - ips_ams1 is success diff --git a/test/legacy/roles/scaleway_lb/defaults/main.yml b/test/legacy/roles/scaleway_lb/defaults/main.yml deleted file mode 100644 index 48d56e1089..0000000000 --- a/test/legacy/roles/scaleway_lb/defaults/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -scaleway_region: fr-par -name: lb_ansible_test -description: Load-balancer used for testing scaleway_lb ansible module -updated_description: Load-balancer used for testing scaleway_lb ansible module (Updated description) -tags: - - first_tag - - second_tag diff --git a/test/legacy/roles/scaleway_lb/tasks/main.yml b/test/legacy/roles/scaleway_lb/tasks/main.yml deleted file mode 100644 index 6bbbe0e703..0000000000 --- a/test/legacy/roles/scaleway_lb/tasks/main.yml +++ /dev/null @@ -1,216 +0,0 @@ -# SCW_API_KEY='XXX' SCW_ORG='YYY' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_lb - -- name: Create a load-balancer (Check) - check_mode: yes - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - organization_id: '{{ scw_org }}' - description: '{{ description }}' - tags: '{{ tags }}' - register: lb_creation_check_task - -- debug: var=lb_creation_check_task - -- name: lb_creation_check_task is success - assert: - that: - - lb_creation_check_task is success - -- name: lb_creation_check_task is changed - assert: - that: - - lb_creation_check_task is changed - -- name: Create load-balancer - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - organization_id: '{{ scw_org }}' - description: '{{ description }}' - tags: '{{ tags }}' - wait: true - register: lb_creation_task - -- debug: var=lb_creation_task - -- name: lb_creation_task is success - assert: - that: - - lb_creation_task is success - -- name: lb_creation_task is changed - assert: - that: - - lb_creation_task is changed - -- name: Assert that the load-balancer is in a valid state - assert: - that: - - lb_creation_task.scaleway_lb.status == "ready" - -- name: Create load-balancer (Confirmation) - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - organization_id: '{{ scw_org }}' - tags: '{{ tags }}' - description: '{{ description }}' - register: lb_creation_confirmation_task - -- debug: var=lb_creation_confirmation_task - -- name: lb_creation_confirmation_task is success - assert: - that: - - lb_creation_confirmation_task is success - -- name: lb_creation_confirmation_task is not changed - assert: - that: - - lb_creation_confirmation_task is not changed - -- name: Assert that the load-balancer is in a valid state - assert: - that: - - lb_creation_confirmation_task.scaleway_lb.status == "ready" - -- name: Update load-balancer (Check) - check_mode: yes - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - organization_id: '{{ scw_org }}' - tags: '{{ tags }}' - description: '{{ updated_description }}' - register: lb_update_check_task - -- debug: var=lb_update_check_task - -- name: lb_update_check_task is success - assert: - that: - - lb_update_check_task is success - -- name: lb_update_check_task is changed - assert: - that: - - lb_update_check_task is changed - -- name: Update load-balancer - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - tags: '{{ tags }}' - organization_id: '{{ scw_org }}' - description: '{{ updated_description }}' - wait: true - register: lb_update_task - -- debug: var=lb_update_task - -- name: lb_update_task is success - assert: - that: - - lb_update_task is success - -- name: lb_update_task is changed - assert: - that: - - lb_update_task is changed - -- name: Assert that the load-balancer is in a valid state - assert: - that: - - lb_update_task.scaleway_lb.status == "ready" - -- name: Update load-balancer (Confirmation) - scaleway_lb: - state: present - name: '{{ name }}' - region: '{{ scaleway_region }}' - tags: '{{ tags }}' - organization_id: '{{ scw_org }}' - description: '{{ updated_description }}' - register: lb_update_confirmation_task - -- debug: var=lb_update_confirmation_task - -- name: lb_update_confirmation_task is success - assert: - that: - - lb_update_confirmation_task is success - -- name: lb_update_confirmation_task is not changed - assert: - that: - - lb_update_confirmation_task is not changed - -- name: Assert that the load-balancer is in a valid state - assert: - that: - - lb_update_confirmation_task.scaleway_lb.status == "ready" - -- name: Delete load-balancer (Check) - check_mode: yes - scaleway_lb: - state: absent - name: '{{ name }}' - region: '{{ scaleway_region }}' - description: '{{ description }}' - organization_id: '{{ scw_org }}' - register: lb_deletion_check_task - -- name: lb_deletion_check_task is success - assert: - that: - - lb_deletion_check_task is success - -- name: lb_deletion_check_task is changed - assert: - that: - - lb_deletion_check_task is changed - -- name: Delete load-balancer - scaleway_lb: - state: absent - name: '{{ name }}' - region: '{{ scaleway_region }}' - description: '{{ description }}' - organization_id: '{{ scw_org }}' - wait: true - register: lb_deletion_task - -- name: lb_deletion_task is success - assert: - that: - - lb_deletion_task is success - -- name: lb_deletion_task is changed - assert: - that: - - lb_deletion_task is changed - -- name: Delete load-balancer (Confirmation) - scaleway_lb: - state: absent - name: '{{ name }}' - region: '{{ scaleway_region }}' - description: '{{ description }}' - organization_id: '{{ scw_org }}' - register: lb_deletion_confirmation_task - -- name: lb_deletion_confirmation_task is success - assert: - that: - - lb_deletion_confirmation_task is success - -- name: lb_deletion_confirmation_task is not changed - assert: - that: - - lb_deletion_confirmation_task is not changed diff --git a/test/legacy/roles/scaleway_organization_facts/tasks/main.yml b/test/legacy/roles/scaleway_organization_facts/tasks/main.yml deleted file mode 100644 index 5a2df69e7f..0000000000 --- a/test/legacy/roles/scaleway_organization_facts/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: Get organization informations and register it in a variable - scaleway_organization_facts: - register: organizations - -- name: Display organizations variable - debug: - var: organizations - -- name: Ensure retrieval of organizations facts is success - assert: - that: - - organizations is success diff --git a/test/legacy/roles/scaleway_s3/defaults/main.yml b/test/legacy/roles/scaleway_s3/defaults/main.yml deleted file mode 100644 index b5178923ee..0000000000 --- a/test/legacy/roles/scaleway_s3/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -scaleway_region: nl-ams -endpoint: s3.nl-ams.scw.cloud -s3_url: https://s3.nl-ams.scw.cloud diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3.yml deleted file mode 100644 index 6b6042f58d..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: Create a local file - tempfile: - state: file - suffix: temp - delegate_to: localhost - register: tempfile - -- import_tasks: aws_s3_create.yml - -- import_tasks: aws_s3_put.yml -- import_tasks: aws_s3_get.yml - -- import_tasks: aws_s3_getstr.yml -- import_tasks: aws_s3_geturl.yml -- import_tasks: aws_s3_list.yml - -- import_tasks: aws_s3_delobj.yml - -- import_tasks: aws_s3_delete.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_create.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_create.yml deleted file mode 100644 index b04f7d2c8f..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_create.yml +++ /dev/null @@ -1,69 +0,0 @@ -- name: Create s3 bucket (Check) - check_mode: yes - aws_s3: - bucket: '{{ bucket_name }}' - mode: create - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_creation_check - -- name: Show bucket_creation_check - debug: - var: bucket_creation_check - -- name: bucket_creation_check is success - assert: - that: - - bucket_creation_check is success - -- name: bucket_creation_check is changed - assert: - that: - - bucket_creation_check is changed - -- name: Create s3 bucket - aws_s3: - bucket: '{{ bucket_name }}' - mode: create - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_creation - -- name: Show bucket_creation - debug: - var: bucket_creation - -- name: bucket_creation is success - assert: - that: - - bucket_creation is success - -- name: bucket_creation is changed - assert: - that: - - bucket_creation is changed - -- name: Create s3 bucket (Confirmation) - aws_s3: - bucket: '{{ bucket_name }}' - mode: create - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_creation_confirmation - -- name: Show bucket_creation_confirmation - debug: - var: bucket_creation_confirmation - -- name: bucket_creation_confirmation is success - assert: - that: - - bucket_creation_confirmation is success - -- name: bucket_creation_confirmation is not changed - assert: - that: - - bucket_creation_confirmation is not changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delete.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_delete.yml deleted file mode 100644 index 09229e7a65..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delete.yml +++ /dev/null @@ -1,69 +0,0 @@ -- name: Delete s3 bucket (Check) - check_mode: yes - aws_s3: - bucket: '{{ bucket_name }}' - mode: delete - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_deletion_check - -- name: Show bucket_deletion_check - debug: - var: bucket_deletion_check - -- name: bucket_deletion_check is success - assert: - that: - - bucket_deletion_check is success - -- name: bucket_deletion_check is changed - assert: - that: - - bucket_deletion_check is changed - -- name: Delete s3 bucket - aws_s3: - bucket: '{{ bucket_name }}' - mode: delete - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_creation - -- name: Show bucket_creation - debug: - var: bucket_creation - -- name: bucket_creation is success - assert: - that: - - bucket_creation is success - -- name: bucket_creation is changed - assert: - that: - - bucket_creation is changed - -- name: Delete s3 bucket (Confirmation) - aws_s3: - bucket: '{{ bucket_name }}' - mode: delete - region: '{{ scaleway_region }}' - s3_url: '{{ s3_url }}' - encrypt: false - register: bucket_creation_confirmation - -- name: Show bucket_creation_confirmation - debug: - var: bucket_creation_confirmation - -- name: bucket_creation_confirmation is success - assert: - that: - - bucket_creation_confirmation is success - -- name: bucket_creation_confirmation is not changed - assert: - that: - - bucket_creation_confirmation is not changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delobj.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_delobj.yml deleted file mode 100644 index 72d04a72fa..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_delobj.yml +++ /dev/null @@ -1,73 +0,0 @@ -- name: Delete an object (Check) - check_mode: yes - aws_s3: - mode: delobj - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - object: test.txt - encrypt: false - register: delobj_check_task - -- name: Show delobj_check_task - debug: - var: delobj_check_task - -- name: delobj_check_task is success - assert: - that: - - delobj_check_task is success - -- name: delobj_check_task is changed - assert: - that: - - delobj_check_task is changed - -- name: Delete an object - aws_s3: - mode: delobj - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - object: test.txt - encrypt: false - register: delobj_task - -- name: Show delobj_task - debug: - var: delobj_task - -- name: delobj_task is success - assert: - that: - - delobj_task is success - -- name: delobj_task is changed - assert: - that: - - delobj_task is changed - - -- name: Delete an object (Confirmation) - aws_s3: - mode: delobj - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - object: test.txt - encrypt: false - register: delobj_confirmation_task - -- name: Show delobj_confirmation_task - debug: - var: delobj_confirmation_task - -- name: delobj_confirmation_task is success - assert: - that: - - delobj_confirmation_task is success - -- name: delobj_confirmation_task is changed - assert: - that: - - delobj_confirmation_task is changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_get.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_get.yml deleted file mode 100644 index 5bc95ad9d3..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_get.yml +++ /dev/null @@ -1,31 +0,0 @@ -- name: Create a destination local file - tempfile: - state: file - suffix: temp - delegate_to: localhost - register: tempfile_dst - -- name: Get from bucket - aws_s3: - mode: get - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - object: test.txt - dest: '{{ tempfile_dst.path }}' - encrypt: false - register: get_task - -- name: Show get_task - debug: - var: get_task - -- name: get_task is success - assert: - that: - - get_task is success - -- name: get_task is changed - assert: - that: - - get_task is changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_getstr.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_getstr.yml deleted file mode 100644 index 0555f984d8..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_getstr.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Get str from bucket - aws_s3: - mode: getstr - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - encrypt: false - object: test.txt - register: getstr_task - -- name: Show getstr_task - debug: - var: getstr_task - -- name: getstr_task is success - assert: - that: - - getstr_task is success - -- name: getstr_task is changed - assert: - that: - - getstr_task is changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_geturl.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_geturl.yml deleted file mode 100644 index b1ba4db05f..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_geturl.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Get url from bucket - aws_s3: - mode: geturl - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - object: test.txt - encrypt: false - register: geturl_task - -- name: Show geturl_task - debug: - var: geturl_task - -- name: geturl_task is success - assert: - that: - - geturl_task is success - -- name: geturl_task is changed - assert: - that: - - geturl_task is changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_list.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_list.yml deleted file mode 100644 index 0043e1708b..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_list.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: List bucket - aws_s3: - mode: list - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - encrypt: false - register: list_task - -- name: Show list_task - debug: - var: list_task - -- name: list_task is success - assert: - that: - - list_task is success - -- name: list_task is not changed - assert: - that: - - list_task is not changed diff --git a/test/legacy/roles/scaleway_s3/tasks/aws_s3_put.yml b/test/legacy/roles/scaleway_s3/tasks/aws_s3_put.yml deleted file mode 100644 index 71a5e114fb..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/aws_s3_put.yml +++ /dev/null @@ -1,50 +0,0 @@ -- name: Put an object (Check) - check_mode: yes - aws_s3: - mode: put - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - src: '{{ tempfile.path }}' - object: test.txt - encrypt: false - register: put_check_task - -- name: Show put_check_task - debug: - var: put_check_task - -- name: put_check_task is success - assert: - that: - - put_check_task is success - -- name: put_check_task is changed - assert: - that: - - put_check_task is changed - -- name: Put an object - aws_s3: - mode: put - bucket: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - src: '{{ tempfile.path }}' - object: test.txt - encrypt: false - register: put_task - -- name: Show put_task - debug: - var: put_task - -- name: put_task is success - assert: - that: - - put_task is success - -- name: put_task is changed - assert: - that: - - put_task is changed diff --git a/test/legacy/roles/scaleway_s3/tasks/main.yml b/test/legacy/roles/scaleway_s3/tasks/main.yml deleted file mode 100644 index 9f74582b87..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -# AWS_ACCESS_KEY='XXX' AWS_SECRET_KEY='YYY' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_s3 - -# use a fact instead of a variable, otherwise template is evaluate each time variable is used -- set_fact: - bucket_name: "ansible-s3-test-{{ 99999999 | random | to_uuid }}" - -- name: Show bucket name - debug: - var: bucket_name - -- import_tasks: s3_bucket.yml -- import_tasks: aws_s3.yml diff --git a/test/legacy/roles/scaleway_s3/tasks/s3_bucket.yml b/test/legacy/roles/scaleway_s3/tasks/s3_bucket.yml deleted file mode 100644 index 7d3d59e900..0000000000 --- a/test/legacy/roles/scaleway_s3/tasks/s3_bucket.yml +++ /dev/null @@ -1,90 +0,0 @@ -- name: Bucket Creation - s3_bucket: - name: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - - requester_pays: - register: bucket_creation_task - -- name: Show bucket_creation_task - debug: - var: bucket_creation_task - -- name: bucket_creation_task is success - assert: - that: - - bucket_creation_task is success - -- name: bucket_creation_task is changed - assert: - that: - - bucket_creation_task is changed - -- name: Bucket Creation (Confirmation) - s3_bucket: - name: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - requester_pays: null - register: bucket_creation_confirmation_task - -- name: Show bucket_creation_confirmation_task - debug: - var: bucket_creation_confirmation_task - -- name: bucket_creation_confirmation_task is success - assert: - that: - - bucket_creation_confirmation_task is success - -- name: bucket_creation_confirmation_task is not changed - assert: - that: - - bucket_creation_confirmation_task is not changed - -- name: Bucket Deletion - s3_bucket: - name: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - requester_pays: null - state: absent - register: bucket_deletion_task - -- name: Show bucket_deletion_task - debug: - var: bucket_deletion_task - -- name: bucket_deletion_task is success - assert: - that: - - bucket_deletion_task is success - -- name: bucket_deletion_task is changed - assert: - that: - - bucket_deletion_task is changed - -- name: Bucket Deletion (Confirmation) - s3_bucket: - name: '{{ bucket_name }}' - s3_url: '{{ s3_url }}' - region: '{{ scaleway_region }}' - requester_pays: null - state: absent - register: bucket_deletion_confirmation_task - -- name: Show bucket_deletion_confirmation_task - debug: - var: bucket_deletion_confirmation_task - -- name: bucket_deletion_confirmation_task is success - assert: - that: - - bucket_deletion_confirmation_task is success - -- name: bucket_deletion_confirmation_task is not changed - assert: - that: - - bucket_deletion_confirmation_task is not changed diff --git a/test/legacy/roles/scaleway_security_group/defaults/main.yml b/test/legacy/roles/scaleway_security_group/defaults/main.yml deleted file mode 100644 index 13bbef06af..0000000000 --- a/test/legacy/roles/scaleway_security_group/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -scaleway_organization: '{{ scw_org }}' -scaleway_region: ams1 diff --git a/test/legacy/roles/scaleway_security_group/tasks/main.yml b/test/legacy/roles/scaleway_security_group/tasks/main.yml deleted file mode 100644 index 068bfe8354..0000000000 --- a/test/legacy/roles/scaleway_security_group/tasks/main.yml +++ /dev/null @@ -1,129 +0,0 @@ -- name: Create security group check - check_mode: yes - scaleway_security_group: - state: present - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_creation - -- debug: var=security_group_creation - -- name: Ensure security groups check facts is success - assert: - that: - - security_group_creation is success - - security_group_creation is changed - -- block: - - name: Create security group - scaleway_security_group: - state: present - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_creation - - - debug: var=security_group_creation - - - name: Ensure security groups facts is success - assert: - that: - - security_group_creation is success - - security_group_creation is changed - - - name: Create security group duplicate - scaleway_security_group: - state: present - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_creation - - - debug: var=security_group_creation - - - name: Ensure security groups duplicate facts is success - assert: - that: - - security_group_creation is success - - security_group_creation is not changed - - - name: Delete security group check - check_mode: yes - scaleway_security_group: - state: absent - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_deletion - - - debug: var=security_group_deletion - - - name: Ensure security groups delete check facts is success - assert: - that: - - security_group_deletion is success - - security_group_deletion is changed - - always: - - name: Delete security group - scaleway_security_group: - state: absent - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_deletion - - - debug: var=security_group_deletion - - - name: Ensure security groups delete facts is success - assert: - that: - - security_group_deletion is success - - security_group_deletion is changed - -- name: Delete security group duplicate - scaleway_security_group: - state: absent - region: '{{ scaleway_region }}' - name: security_group - description: 'my security group description' - organization: '{{ scaleway_organization }}' - stateful: false - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group_deletion - -- debug: var=security_group_deletion - -- name: Ensure security groups delete duplicate facts is success - assert: - that: - - security_group_deletion is success - - security_group_deletion is not changed
\ No newline at end of file diff --git a/test/legacy/roles/scaleway_security_group_facts/tasks/main.yml b/test/legacy/roles/scaleway_security_group_facts/tasks/main.yml deleted file mode 100644 index 227b62efa2..0000000000 --- a/test/legacy/roles/scaleway_security_group_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_security_group_facts - -- name: Get security group informations and register it in a variable - scaleway_security_group_facts: - region: par1 - register: security_groups - -- name: Display security_groups variable - debug: - var: security_groups - -- name: Ensure retrieval of security groups facts is success - assert: - that: - - security_groups is success - -- name: Get security group informations and register it in a variable (AMS1) - scaleway_security_group_facts: - region: ams1 - register: ams1_security_groups - -- name: Display security_groups variable (AMS1) - debug: - var: ams1_security_groups - -- name: Ensure retrieval of security groups facts is success (AMS1) - assert: - that: - - ams1_security_groups is success diff --git a/test/legacy/roles/scaleway_security_group_rule/defaults/main.yml b/test/legacy/roles/scaleway_security_group_rule/defaults/main.yml deleted file mode 100644 index 9c56c4db77..0000000000 --- a/test/legacy/roles/scaleway_security_group_rule/defaults/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -scaleway_organization: '{{ scw_org }}' -scaleway_region: par1 -protocol: "TCP" -port: 80 -ip_range: "0.0.0.0/0" -direction: "inbound" -action: "accept" diff --git a/test/legacy/roles/scaleway_security_group_rule/tasks/main.yml b/test/legacy/roles/scaleway_security_group_rule/tasks/main.yml deleted file mode 100644 index 812ef1f506..0000000000 --- a/test/legacy/roles/scaleway_security_group_rule/tasks/main.yml +++ /dev/null @@ -1,245 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_security_group_rule - - -- name: Create a scaleway security_group - scaleway_security_group: - state: present - region: '{{ scaleway_region }}' - name: test_compute - description: test_compute - organization: '{{ scaleway_organization }}' - stateful: true - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false - register: security_group - -- debug: var=security_group - -- name: Create security_group_rule check - check_mode: true - scaleway_security_group_rule: - state: present - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_creation_task - -- debug: var=security_group_rule_creation_task - -- assert: - that: - - security_group_rule_creation_task is success - - security_group_rule_creation_task is changed - -- block: - - name: Create security_group_rule check - scaleway_security_group_rule: - state: present - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_creation_task - - - debug: var=security_group_rule_creation_task - - - assert: - that: - - security_group_rule_creation_task is success - - security_group_rule_creation_task is changed - - - name: Create security_group_rule duplicate - scaleway_security_group_rule: - state: present - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_creation_task - - - debug: var=security_group_rule_creation_task - - - assert: - that: - - security_group_rule_creation_task is success - - security_group_rule_creation_task is not changed - - - name: Delete security_group_rule check - check_mode: true - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - - - debug: var=security_group_rule_deletion_task - - - assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is changed - - always: - - name: Delete security_group_rule check - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - - - debug: var=security_group_rule_deletion_task - - - assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is changed - -- name: Delete security_group_rule check - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: '{{ port }}' - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - -- debug: var=security_group_rule_deletion_task - -- assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is not changed - -- block: - - name: Create security_group_rule with null check - scaleway_security_group_rule: - state: present - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: null - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_creation_task - - - debug: var=security_group_rule_creation_task - - - assert: - that: - - security_group_rule_creation_task is success - - security_group_rule_creation_task is changed - - - name: Create security_group_rule with null duplicate - scaleway_security_group_rule: - state: present - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: null - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_creation_task - - - debug: var=security_group_rule_creation_task - - - assert: - that: - - security_group_rule_creation_task is success - - security_group_rule_creation_task is not changed - - - name: Delete security_group_rule with null check - check_mode: true - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: null - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - - - debug: var=security_group_rule_deletion_task - - - assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is changed - - always: - - name: Delete security_group_rule with null check - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: null - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - - - debug: var=security_group_rule_deletion_task - - - assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is changed - -- name: Delete security_group_rule with null check - scaleway_security_group_rule: - state: absent - region: '{{ scaleway_region }}' - protocol: '{{ protocol }}' - port: null - ip_range: '{{ ip_range }}' - direction: '{{ direction }}' - action: '{{ action }}' - security_group: '{{ security_group.scaleway_security_group.id }}' - register: security_group_rule_deletion_task - -- debug: var=security_group_rule_deletion_task - -- assert: - that: - - security_group_rule_deletion_task is success - - security_group_rule_deletion_task is not changed - -- name: Delete scaleway security_group - scaleway_security_group: - state: absent - region: '{{ scaleway_region }}' - name: test_compute - description: test_compute - organization: '{{ scaleway_organization }}' - stateful: true - inbound_default_policy: accept - outbound_default_policy: accept - organization_default: false
\ No newline at end of file diff --git a/test/legacy/roles/scaleway_server_facts/tasks/main.yml b/test/legacy/roles/scaleway_server_facts/tasks/main.yml deleted file mode 100644 index f906560ae2..0000000000 --- a/test/legacy/roles/scaleway_server_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_server_facts - -- name: Get server informations and register it in a variable - scaleway_server_facts: - region: par1 - register: servers - -- name: Display servers variable - debug: - var: servers - -- name: Ensure retrieval of servers facts is success - assert: - that: - - servers is success - -- name: Get server informations and register it in a variable - scaleway_server_facts: - region: ams1 - register: ams1_servers - -- name: Display servers variable - debug: - var: ams1_servers - -- name: Ensure retrieval of servers facts is success - assert: - that: - - ams1_servers is success diff --git a/test/legacy/roles/scaleway_snapshot_facts/tasks/main.yml b/test/legacy/roles/scaleway_snapshot_facts/tasks/main.yml deleted file mode 100644 index bf7c2eb4dd..0000000000 --- a/test/legacy/roles/scaleway_snapshot_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_snapshot_facts - -- name: Get snapshot informations and register it in a variable - scaleway_snapshot_facts: - region: par1 - register: snapshots - -- name: Display snapshots variable - debug: - var: snapshots - -- name: Ensure retrieval of snapshots facts is success - assert: - that: - - snapshots is success - -- name: Get snapshot informations and register it in a variable (AMS1) - scaleway_snapshot_facts: - region: ams1 - register: ams1_snapshots - -- name: Display snapshots variable (AMS1) - debug: - var: ams1_snapshots - -- name: Ensure retrieval of snapshots facts is success (AMS1) - assert: - that: - - ams1_snapshots is success diff --git a/test/legacy/roles/scaleway_ssh/tasks/main.yml b/test/legacy/roles/scaleway_ssh/tasks/main.yml deleted file mode 100644 index f6ae57890e..0000000000 --- a/test/legacy/roles/scaleway_ssh/tasks/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_ssh - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: present - check_mode: yes - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: present - register: result1 - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: present - register: result2 - -- assert: - that: - - result1 is success and result1 is changed - - result2 is success and result2 is not changed - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: absent - check_mode: yes - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: absent - register: result1 - -- scaleway_sshkey: - ssh_pub_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf29yyommeGyKSIgSmX0ISVXP+3x6RUY4JDGLoAMFh2efkfDaRVdsvkvnFuUywgP2RewrjTyLE8w0NpCBHVS5Fm1BAn3yvxOUtTMxTbsQcw6HQ8swJ02+1tewJYjHPwc4GrBqiDo3Nmlq354Us0zBOJg/bBzuEnVD5eJ3GO3gKaCSUYTVrYwO0U4eJE0D9OJeUP9J48kl4ULbCub976+mTHdBvlzRw0Tzfl2kxgdDwlks0l2NefY/uiTdz2oMt092bAY3wZHxjto/DXoChxvaf5s2k8Zb+J7CjimUYnzPlH+zA9F6ROjP5AUu6ZWPd0jOIBl1nDWWb2j/qfNLYM43l sieben@sieben-macbook.local" - state: absent - register: result2 - -- assert: - that: - - result1 is success and result1 is changed - - result2 is success and result2 is not changed diff --git a/test/legacy/roles/scaleway_user_data/defaults/main.yml b/test/legacy/roles/scaleway_user_data/defaults/main.yml deleted file mode 100644 index 69396fccaa..0000000000 --- a/test/legacy/roles/scaleway_user_data/defaults/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- - -cloud_init_script: ''' -#cloud-config - -# final_message -# default: cloud-init boot finished at $TIMESTAMP. Up $UPTIME seconds -# this message is written by cloud-final when the system is finished -# its first boot -final_message: "The system is finally up, after $UPTIME seconds" -''' -scaleway_image_id: 89ee4018-f8c3-4dc4-a6b5-bca14f985ebe -scaleway_organization: '{{ scw_org }}' -scaleway_region: ams1 -scaleway_commerial_type: START1-S diff --git a/test/legacy/roles/scaleway_user_data/tasks/main.yml b/test/legacy/roles/scaleway_user_data/tasks/main.yml deleted file mode 100644 index ee62b35003..0000000000 --- a/test/legacy/roles/scaleway_user_data/tasks/main.yml +++ /dev/null @@ -1,79 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_user_data - -- name: Create a server - scaleway_compute: - name: foobar - state: present - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - region: '{{ scaleway_region }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - - register: server_creation_task - -- debug: var=server_creation_task - -- set_fact: - server_id: "{{ server_creation_task.msg.id }}" - -- debug: var=server_id - -- name: Patch user_data cloud-init configuration (Check) - check_mode: yes - scaleway_user_data: - region: '{{ scaleway_region }}' - server_id: "{{ server_id }}" - user_data: - cloud-init: "{{ cloud_init_script }}" - register: user_data_check_task - -- debug: var=user_data_check_task - -- assert: - that: - - user_data_check_task is success - - user_data_check_task is changed - -- name: Patch user_data cloud-init configuration - scaleway_user_data: - region: '{{ scaleway_region }}' - server_id: "{{ server_id }}" - user_data: - cloud-init: "{{ cloud_init_script }}" - register: user_data_task - -- debug: var=user_data_task - -- assert: - that: - - user_data_task is success - - user_data_task is changed - -- name: Patch user_data cloud-init configuration (Confirmation) - scaleway_user_data: - region: '{{ scaleway_region }}' - server_id: "{{ server_id }}" - user_data: - cloud-init: "{{ cloud_init_script }}" - register: user_data_confirmation_task - -- debug: var=user_data_confirmation_task - -- assert: - that: - - user_data_confirmation_task is success - - user_data_confirmation_task is not changed - -- name: Destroy it - scaleway_compute: - name: foobar - state: absent - region: '{{ scaleway_region }}' - image: '{{ scaleway_image_id }}' - organization: '{{ scaleway_organization }}' - commercial_type: '{{ scaleway_commerial_type }}' - wait: true - register: server_destroy_task - -- debug: var=server_destroy_task diff --git a/test/legacy/roles/scaleway_volume/defaults/main.yml b/test/legacy/roles/scaleway_volume/defaults/main.yml deleted file mode 100644 index 13bbef06af..0000000000 --- a/test/legacy/roles/scaleway_volume/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -scaleway_organization: '{{ scw_org }}' -scaleway_region: ams1 diff --git a/test/legacy/roles/scaleway_volume/tasks/main.yml b/test/legacy/roles/scaleway_volume/tasks/main.yml deleted file mode 100644 index 0546dabe0f..0000000000 --- a/test/legacy/roles/scaleway_volume/tasks/main.yml +++ /dev/null @@ -1,43 +0,0 @@ -# SCW_API_KEY='XXX' SCW_ORG='YYY' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_volume - -- name: Make sure volume is not there before tests - scaleway_volume: - name: ansible-test-volume - state: absent - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: server_creation_check_task - -- assert: - that: - - server_creation_check_task is success - -- name: Create volume - scaleway_volume: - name: ansible-test-volume - state: present - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - "size": 10000000000 - volume_type: l_ssd - register: server_creation_check_task - -- debug: var=server_creation_check_task - -- assert: - that: - - server_creation_check_task is success - - server_creation_check_task is changed - -- name: Make sure volume is deleted - scaleway_volume: - name: ansible-test-volume - state: absent - region: '{{ scaleway_region }}' - organization: '{{ scaleway_organization }}' - register: server_creation_check_task - -- assert: - that: - - server_creation_check_task is success - - server_creation_check_task is changed diff --git a/test/legacy/roles/scaleway_volume_facts/tasks/main.yml b/test/legacy/roles/scaleway_volume_facts/tasks/main.yml deleted file mode 100644 index b157e127ad..0000000000 --- a/test/legacy/roles/scaleway_volume_facts/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# SCW_API_KEY='XXX' ansible-playbook ./test/legacy/scaleway.yml --tags test_scaleway_volume_facts - -- name: Get volume informations and register it in a variable - scaleway_volume_facts: - region: par1 - register: volumes - -- name: Display volumes variable - debug: - var: volumes - -- name: Ensure retrieval of volumes facts is success - assert: - that: - - volumes is success - -- name: Get volume informations and register it in a variable (AMS1) - scaleway_volume_facts: - region: ams1 - register: ams1_volumes - -- name: Display volumes variable - debug: - var: ams1_volumes - -- name: Ensure retrieval of volumes facts is success - assert: - that: - - ams1_volumes is success diff --git a/test/legacy/scaleway.yml b/test/legacy/scaleway.yml deleted file mode 100644 index f65a059048..0000000000 --- a/test/legacy/scaleway.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- hosts: localhost - gather_facts: no - connection: local - vars: - scw_org: "{{ lookup('env', 'SCW_ORG') }}" - - roles: - - { role: scaleway_compute, tags: test_scaleway_compute } - - { role: scaleway_image_facts, tags: test_scaleway_image_facts } - - { role: scaleway_ip, tags: test_scaleway_ip } - - { role: scaleway_ip_facts, tags: test_scaleway_ip_facts } - - { role: scaleway_lb, tags: test_scaleway_lb } - - { role: scaleway_organization_facts, tags: test_scaleway_organization_facts } - - { role: scaleway_s3, tags: test_scaleway_s3 } - - { role: scaleway_security_group_facts, tags: test_scaleway_security_group_facts } - - { role: scaleway_server_facts, tags: test_scaleway_server_facts } - - { role: scaleway_snapshot_facts, tags: test_scaleway_snapshot_facts } - - { role: scaleway_ssh, tags: test_scaleway_ssh } - - { role: scaleway_user_data, tags: test_scaleway_user_data } - - { role: scaleway_volume, tags: test_scaleway_volume } - - { role: scaleway_volume_facts, tags: test_scaleway_volume_facts } - - { role: scaleway_security_group, tags: test_scaleway_security_group } - - { role: scaleway_security_group_rule, tags: test_scaleway_security_group_rule } |