From c5e1b2ce8f63ffe16822bc36a018cf96ad883a1c Mon Sep 17 00:00:00 2001 From: Aleksandr Chudinov Date: Thu, 11 Jul 2024 13:14:41 +0300 Subject: [PATCH] fix: creating instances with ipv6 public address --- ansible_collections/serverscom/sc_api/galaxy.yml | 2 +- .../serverscom/sc_api/plugins/module_utils/sc_api.py | 2 +- .../targets/sc_cloud_computing_instance/tasks/main.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible_collections/serverscom/sc_api/galaxy.yml b/ansible_collections/serverscom/sc_api/galaxy.yml index 97d0baf..d146beb 100644 --- a/ansible_collections/serverscom/sc_api/galaxy.yml +++ b/ansible_collections/serverscom/sc_api/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: serverscom name: sc_api -version: 0.1.0 +version: 0.1.1 readme: README.md authors: - George Shuklin diff --git a/ansible_collections/serverscom/sc_api/plugins/module_utils/sc_api.py b/ansible_collections/serverscom/sc_api/plugins/module_utils/sc_api.py index 7005e77..75d1355 100644 --- a/ansible_collections/serverscom/sc_api/plugins/module_utils/sc_api.py +++ b/ansible_collections/serverscom/sc_api/plugins/module_utils/sc_api.py @@ -416,7 +416,7 @@ def post_instance( if not ipv4_enabled: body["ipv4_enabled"] = False if ipv6_enabled: - body["ipv6_enabled"] = False + body["ipv6_enabled"] = True if ssh_key_fingerprint: body["ssh_key_fingerprint"] = ssh_key_fingerprint if backup_copies is not None: diff --git a/ansible_collections/serverscom/sc_api/tests/integration/targets/sc_cloud_computing_instance/tasks/main.yaml b/ansible_collections/serverscom/sc_api/tests/integration/targets/sc_cloud_computing_instance/tasks/main.yaml index 0eb8b11..dbe89d9 100644 --- a/ansible_collections/serverscom/sc_api/tests/integration/targets/sc_cloud_computing_instance/tasks/main.yaml +++ b/ansible_collections/serverscom/sc_api/tests/integration/targets/sc_cloud_computing_instance/tasks/main.yaml @@ -153,6 +153,7 @@ - "'52310c60-7446-482d-a30e-2bedeb515878' in test6_instances|to_json" - test6.status == 'ACTIVE' - test6.name == '52310c60-7446-482d-a30e-2bedeb515878' + - test6.public_ipv6_address - name: Test6, create the same instance second time sc_cloud_computing_instance: