From 0ea8236f88b52e25c6d72afe4885e22718db199c Mon Sep 17 00:00:00 2001 From: Tomas Karasek Date: Tue, 13 Feb 2024 11:33:10 +0100 Subject: [PATCH 1/3] ci: setup semantic release GHA --- .github/workflows/release.yml | 34 ++++++++++++++++++---------- .releaserc.json | 42 +++++++++++++++++++++++++++++++++++ Makefile | 3 ++- requirements-dev.txt | 2 +- template/galaxy.template.yml | 2 +- version | 1 + 6 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 .releaserc.json create mode 100644 version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df7836d..35105f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,23 +1,18 @@ -# This GitHub action can publish assets for release when a tag is created. -# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). +# This GitHub action creates new release and uploads new collection version to +# Ansible Galaxy -name: release +name: Semantic Release to GitHub and Ansible Galaxy on: workflow_dispatch: null - release: - types: [ published ] + jobs: - galaxyrelease: + build: runs-on: ubuntu-latest - defaults: - run: - working-directory: .ansible/collections/ansible_collections/equinix/cloud - environment: 'METAL_API_TOKEN' steps: - name: checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - path: .ansible/collections/ansible_collections/equinix/cloud + fetch-depth: 0 - name: update packages run: sudo apt-get update -y @@ -33,6 +28,21 @@ jobs: - name: install dependencies run: pip3 install -r requirements-dev.txt -r requirements.txt + - name: Do GitHub release + uses: cycjimmy/semantic-release-action@v4 + with: + semantic_version: 19.0.5 + extra_plugins: | + @semantic-release/exec@6.0.3 + @semantic-release/git@10.0.0 + conventional-changelog-conventionalcommits@4.6.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_AUTHOR_NAME: equinix-labs@auto-commit-workflow + GIT_AUTHOR_EMAIL: bot@equinix.noreply.github.com + GIT_COMMITTER_NAME: equinix-labs@auto-commit-workflow + GIT_COMMITTER_EMAIL: bot@equinix.noreply.github.com + - name: publish the collection run: make publish env: diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..130a166 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,42 @@ +{ + "branches": [ + "main" + ], + "ci": false, + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits" + } + ], + [ + "@semantic-release/github", + { + "successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:", + "labels": false, + "releasedLabels": false + } + ], + [ + "@semantic-release/exec", + { + "prepareCmd": "echo -n '${nextRelease.version}' > version" + } + ], + [ + "@semantic-release/git", + { + "message": "ci: regenerate code for version ${nextRelease.version} triggered by ${process.env.RELEASE_REQUESTER}", + "assets": ["."] + } + ] + ] + } + diff --git a/Makefile b/Makefile index 93ca24c..44f6e6e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ SHELL := /bin/bash COLLECTIONS_PATH ?= ~/.ansible/collections DOCS_PATH ?= docs -COLLECTION_VERSION ?= +VERSION_FILE=version +COLLECTION_VERSION := $(shell cat ${VERSION_FILE}) TEST_ARGS := -v ${test_target} INTEGRATION_CONFIG := tests/integration/integration_config.yml diff --git a/requirements-dev.txt b/requirements-dev.txt index 3576251..e907b49 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ botocore==1.20.23 pylint==2.15.5 ansible-doc-extractor==0.1.8 mypy==0.991 -ansible==6.7.0 +ansible>=7.5.0 Jinja2==3.0.1 black>=23.1.0 isort>=5.12.0 diff --git a/template/galaxy.template.yml b/template/galaxy.template.yml index 284d7e9..c873eb8 100644 --- a/template/galaxy.template.yml +++ b/template/galaxy.template.yml @@ -10,7 +10,7 @@ tags: - equinix - cloud repository: https://github.com/equinix-labs/ansible-collection-equinix -documentation: https://github.com/equinix-labs/ansible-collection-metal/blob/v{{ collection_version }}/README.md +documentation: https://github.com/equinix-labs/ansible-collection-equinix/blob/v{{ collection_version }}/README.md homepage: https://github.com/equinix-labs/ansible-collection-equinix issues: https://github.com/equinix-labs/ansible-collection-equinix/issues build_ignore: diff --git a/version b/version new file mode 100644 index 0000000..0d91a54 --- /dev/null +++ b/version @@ -0,0 +1 @@ +0.3.0 From 48d6acd3c169c96d03cf15aaff0278d77259bf4d Mon Sep 17 00:00:00 2001 From: Tomas Karasek Date: Tue, 13 Feb 2024 17:33:41 +0100 Subject: [PATCH 2/3] ci: fix python to 3.10 in release gha --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35105f5..c90f502 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: setup python 3 uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: '3.10' - name: install dependencies run: pip3 install -r requirements-dev.txt -r requirements.txt From 8aae9921b51c3a91105bcafbf3398b80e7e71be7 Mon Sep 17 00:00:00 2001 From: Tomas Karasek Date: Wed, 14 Feb 2024 17:44:48 +0100 Subject: [PATCH 3/3] fix: removing curly braces from ansible test asserts, it's considered unsafe in Ansible 7.5.0 https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_9.html#playbook --- .../targets/metal_connection/tasks/main.yml | 8 ++--- .../targets/metal_gateway/tasks/main.yml | 2 +- .../tasks/main.yml | 8 ++--- .../metal_ip_assignment/tasks/main.yml | 8 ++--- .../targets/metal_project/tasks/main.yml | 21 +++++++++----- .../metal_project_ssh_key/tasks/main.yml | 29 ++++++++++--------- .../metal_reserved_ip_block/tasks/main.yml | 4 --- .../targets/metal_ssh_key/tasks/main.yml | 26 ++++++++++------- .../targets/metal_vlan/tasks/main.yml | 8 ++--- .../targets/metal_vrf/tasks/main.yml | 2 +- 10 files changed, 60 insertions(+), 56 deletions(-) diff --git a/tests/integration/targets/metal_connection/tasks/main.yml b/tests/integration/targets/metal_connection/tasks/main.yml index 5d95420..2e4935c 100755 --- a/tests/integration/targets/metal_connection/tasks/main.yml +++ b/tests/integration/targets/metal_connection/tasks/main.yml @@ -96,9 +96,9 @@ - assert: that: - - test_connection.name == "{{ test_name }}" - - test_connection.id == "{{ test_connection_fetched.id }}" - - test_connection.id == "{{ test_connection_fetched_with_id.id }}" + - test_connection.name == test_name + - test_connection.id == test_connection_fetched.id + - test_connection.id == test_connection_fetched_with_id.id - name: list test connections equinix.cloud.metal_connection_info: @@ -108,7 +108,7 @@ - assert: that: - "test_connections_list.resources | length >= 1" - - "test_connection.id in {{ test_connections_list.resources | map(attribute='id') | list }} " + - "test_connection.id in test_connections_list.resources | map(attribute='id') | list" - name: delete connection equinix.cloud.metal_connection: diff --git a/tests/integration/targets/metal_gateway/tasks/main.yml b/tests/integration/targets/metal_gateway/tasks/main.yml index c76af82..87e4937 100644 --- a/tests/integration/targets/metal_gateway/tasks/main.yml +++ b/tests/integration/targets/metal_gateway/tasks/main.yml @@ -56,7 +56,7 @@ - assert: that: - - fetched_gateway.id == "{{ gateway.id }}" + - fetched_gateway.id == gateway.id - name: list gateways equinix.cloud.metal_gateway_info: diff --git a/tests/integration/targets/metal_gateway_ip_reservation/tasks/main.yml b/tests/integration/targets/metal_gateway_ip_reservation/tasks/main.yml index 953e52d..d3efccd 100644 --- a/tests/integration/targets/metal_gateway_ip_reservation/tasks/main.yml +++ b/tests/integration/targets/metal_gateway_ip_reservation/tasks/main.yml @@ -59,7 +59,7 @@ - assert: that: - - gateway_again.id == "{{ gateway.id }}" + - gateway_again.id == gateway.id - gateway_again.changed == false - name: fetch gateway by id @@ -69,9 +69,9 @@ - assert: that: - - fetched_gateway.id == "{{ gateway.id }}" - - fetched_gateway.ip_reservation_id == "{{ ip_reservation.id }}" - - fetched_gateway.virtual_network_id == "{{ vlan.id }}" + - fetched_gateway.id == gateway.id + - fetched_gateway.ip_reservation_id == ip_reservation.id + - fetched_gateway.virtual_network_id == vlan.id - name: delete gateway equinix.cloud.metal_gateway: diff --git a/tests/integration/targets/metal_ip_assignment/tasks/main.yml b/tests/integration/targets/metal_ip_assignment/tasks/main.yml index 39e5603..4c35163 100644 --- a/tests/integration/targets/metal_ip_assignment/tasks/main.yml +++ b/tests/integration/targets/metal_ip_assignment/tasks/main.yml @@ -35,10 +35,6 @@ name: "{{ test_prefix }}-project" register: project - - assert: - that: - - project.name == '{{ test_prefix }}-project' - - name: request ip reservation equinix.cloud.metal_reserved_ip_block: type: "public_ipv4" @@ -77,8 +73,8 @@ - assert: that: - - assignment.device_id == "{{ device.id }}" - - assignment.address == "{{ available_ips.available[0] }}" + - assignment.device_id == device.id + - assignment.address == available_ips.available[0] - name: assignment info test equinix.cloud.metal_ip_assignment_info: diff --git a/tests/integration/targets/metal_project/tasks/main.yml b/tests/integration/targets/metal_project/tasks/main.yml index dc78a74..315fad1 100644 --- a/tests/integration/targets/metal_project/tasks/main.yml +++ b/tests/integration/targets/metal_project/tasks/main.yml @@ -13,29 +13,36 @@ unique_id: "{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=8') }}" - set_fact: test_prefix: "{{ test_resource_name_prefix }}-{{ unique_id }}" + - set_fact: + test_project_name1: '{{ test_prefix }}-project1' + - set_fact: + test_project_renamed: '{{ test_prefix }}-project1_renamed' + - set_fact: + test_project_name2: '{{ test_prefix }}-project2' + - name: create first project for test equinix.cloud.metal_project: - name: "{{ test_prefix }}-project1" + name: "{{ test_project_name1 }}" backend_transfer_enabled: true register: first_project - name: create first project for test again, to check idempotence equinix.cloud.metal_project: - name: "{{ test_prefix }}-project1" + name: "{{ test_project_name1 }}" backend_transfer_enabled: true register: first_project_2 - assert: that: - - first_project.name == '{{ test_prefix }}-project1' + - first_project.name == test_project_name1 - first_project.backend_transfer_enabled == true - first_project_2.changed == false - name: update project name equinix.cloud.metal_project: id: "{{ first_project.id }}" - name: "{{ test_prefix }}-project1_renamed" + name: "{{ test_project_renamed }}" backend_transfer_enabled: false - name: fetch updated project @@ -45,17 +52,17 @@ - assert: that: - - first_project_updated.name == '{{ test_prefix }}-project1_renamed' + - first_project_updated.name == test_project_renamed - first_project_updated.backend_transfer_enabled == false - name: create second project for test equinix.cloud.metal_project: - name: "{{ test_prefix }}-project2" + name: "{{ test_project_name2 }}" register: second_project - name: list second project equinix.cloud.metal_project_info: - name: "{{ test_prefix }}-project2" + name: "{{ test_project_name2 }}" register: second_project_listed - assert: diff --git a/tests/integration/targets/metal_project_ssh_key/tasks/main.yml b/tests/integration/targets/metal_project_ssh_key/tasks/main.yml index 0aa475e..4a4a913 100644 --- a/tests/integration/targets/metal_project_ssh_key/tasks/main.yml +++ b/tests/integration/targets/metal_project_ssh_key/tasks/main.yml @@ -22,16 +22,18 @@ test_key: "ssh-dss AAAAB3NzaC1kc3MAAACBAOpXVtmc0Bla98bt0o5/Zj7sb4mHIukgVFZu7F32R3VK1cEKB4rEE8uS0oLS/qMRLue45TWVJwRMYGlPjt3p/VyraelxoyJZLuITIsqa5hBc9w0oTlB5Bmbkn16umW96WCaWEoq/aitpocbRChTiP5biI6FyQTQlIHDaYzBDOi11AAAAFQDUXy7cmuzphDpJSYYTiudiUhVokwAAAIEAyUQ9m8qL/1HPkFe6jbXAvtSSmW27F4c+G2xR5HizaHQzXgBOxPcsOsY17KTU+Ddbg+OF9soWNwSpm9pyVjVmNGqH3S8R1pwvuJF/O2Asy1m6wpWhbPw8JdEBW7WHoptBpfuzJoS2LOzJUEmUu4Eb+xS237KG1d1BVny/49KAoH0AAACBAJKBSsm9Xey0fUN6vYtTQgoYeGxxj/LqAIAOs/TpCxZDntly860y/SzHYai8x48k4t7whENY1CJ41fpMcPlz8xIsrNP3326Wbr0ExwOIvJKAVN1YLYqF8NXWzaVrjo5WbSeI8PiWTYemvLAujVxZssIrApTZBhp55nnwge6K1zTG tomk@air" - set_fact: test_key2: "ssh-dss AAAAB3NzaC1kc3MAAACBAPWcHWkA06LxBQ67WmNsp1+aZMwNNz9v67pftePlQg94Z1cU4s/5j5S/Fknj7gapWw/ouiOYqXhC2p/hC9/1ARY15t0aHYqLjRhWzs3j8miL1YyXYjqLPLDtgNpX9E09We5ogjbYCB8CCtZrujm/MB6NWvX+T4uG8C/g66I4/bGdAAAAFQDa4SS+q9aQK/XwiqnWpFpAEY74TQAAAIEAklEfXCf1qbUvTquHhtNVKTiKm+qGRsqxnLnu7aduzU81JDFzveF/agkE5x30olTvKECb1PAziDmt63z/obO3Da8TUz0QVdqv81pNWU5JUNiTB8d3rDJU3B66DA6GI305W8qyt0AGUNGR3rDIzNpZY958faBg+TaILRg8ZFNh0PAAAACAdUhJS6bl5M5sQr6XNilHa0nOTk/PB54faGWWMq7zQvxUKJKsDklNTc0MCPjRppyuokbQ6297tq8pEEFqUAyllMvAf75X7DsBQivLzbNuzp41NqFdS/Oka+T1ypRD7mT6g0Kg8yCVYD2ti874wyTpV9riUUaoItveEF3AdC9AzmI= tomk@air" + - set_fact: + test_key_label: "{{ test_prefix }}-ssh_key1" + - set_fact: + test_key_renamed: "{{ test_prefix }}-ssh_key1_renamed" + - set_fact: + test_key_label2: "{{ test_prefix }}-ssh_key2" - name: create project for test equinix.cloud.metal_project: name: "{{ test_prefix }}-project" register: project - - assert: - that: - - project.name == '{{ test_prefix }}-project' - - name: create first project ssh_key for test equinix.cloud.metal_project_ssh_key: label: "{{ test_prefix }}-ssh_key1" @@ -39,17 +41,18 @@ project_id: "{{ project.id }}" register: first_ssh_key + - name: create first ssh_key for test again, to check idempotence equinix.cloud.metal_project_ssh_key: - label: "{{ test_prefix }}-ssh_key1" + label: "{{ test_key_label }}" key: "{{ test_key }}" project_id: "{{ project.id }}" register: first_ssh_key_2 - + - assert: that: - - first_ssh_key.label == '{{ test_prefix }}-ssh_key1' - - first_ssh_key.key == "{{ test_key }}" + - first_ssh_key.label == test_key_label + - first_ssh_key.key == test_key - first_ssh_key_2.changed == false - name: update ssh_key label @@ -65,12 +68,12 @@ - assert: that: - - first_ssh_key_updated.label == '{{ test_prefix }}-ssh_key1_renamed' - - first_ssh_key.key == "{{ test_key }}" + - first_ssh_key_updated.label == test_key_renamed + - first_ssh_key.key == test_key - name: create second ssh_key for test equinix.cloud.metal_project_ssh_key: - label: "{{ test_prefix }}-ssh_key2" + label: "{{ test_key_label2 }}" key: "{{ test_key2 }}" project_id: "{{ project.id }}" register: second_ssh_key @@ -84,11 +87,11 @@ msg: "{{ ssh_keys_listed.resources }}" - debug: - msg: 'ssh_keys_listed.resources | selectattr("label", "equalto", "{{ test_prefix }}-ssh_key2")' + msg: 'ssh_keys_listed.resources | selectattr("label", "equalto", test_key_label2)' - assert: that: - - 'ssh_keys_listed.resources | selectattr("label", "equalto", "{{ test_prefix }}-ssh_key2") | length == 1' + - 'ssh_keys_listed.resources | selectattr("label", "equalto", test_key_label2) | length == 1' - name: list test ssh keys set_fact: diff --git a/tests/integration/targets/metal_reserved_ip_block/tasks/main.yml b/tests/integration/targets/metal_reserved_ip_block/tasks/main.yml index 677785a..8684144 100644 --- a/tests/integration/targets/metal_reserved_ip_block/tasks/main.yml +++ b/tests/integration/targets/metal_reserved_ip_block/tasks/main.yml @@ -19,10 +19,6 @@ name: "{{ test_prefix }}-project" register: project - - assert: - that: - - project.name == '{{ test_prefix }}-project' - - name: request ip reservation equinix.cloud.metal_reserved_ip_block: type: "public_ipv4" diff --git a/tests/integration/targets/metal_ssh_key/tasks/main.yml b/tests/integration/targets/metal_ssh_key/tasks/main.yml index 17cc251..05df6f8 100644 --- a/tests/integration/targets/metal_ssh_key/tasks/main.yml +++ b/tests/integration/targets/metal_ssh_key/tasks/main.yml @@ -17,30 +17,36 @@ test_key: "ssh-dss AAAAB3NzaC1kc3MAAACBAOpXVtmc0Bla98bt0o5/Zj7sb4mHIukgVFZu7F32R3VK1cEKB4rEE8uS0oLS/qMRLue45TWVJwRMYGlPjt3p/VyraelxoyJZLuITIsqa5hBc9w0oTlB5Bmbkn16umW96WCaWEoq/aitpocbRChTiP5biI6FyQTQlIHDaYzBDOi11AAAAFQDUXy7cmuzphDpJSYYTiudiUhVokwAAAIEAyUQ9m8qL/1HPkFe6jbXAvtSSmW27F4c+G2xR5HizaHQzXgBOxPcsOsY17KTU+Ddbg+OF9soWNwSpm9pyVjVmNGqH3S8R1pwvuJF/O2Asy1m6wpWhbPw8JdEBW7WHoptBpfuzJoS2LOzJUEmUu4Eb+xS237KG1d1BVny/49KAoH0AAACBAJKBSsm9Xey0fUN6vYtTQgoYeGxxj/LqAIAOs/TpCxZDntly860y/SzHYai8x48k4t7whENY1CJ41fpMcPlz8xIsrNP3326Wbr0ExwOIvJKAVN1YLYqF8NXWzaVrjo5WbSeI8PiWTYemvLAujVxZssIrApTZBhp55nnwge6K1zTG tomk@air" - set_fact: test_key2: "ssh-dss AAAAB3NzaC1kc3MAAACBAPWcHWkA06LxBQ67WmNsp1+aZMwNNz9v67pftePlQg94Z1cU4s/5j5S/Fknj7gapWw/ouiOYqXhC2p/hC9/1ARY15t0aHYqLjRhWzs3j8miL1YyXYjqLPLDtgNpX9E09We5ogjbYCB8CCtZrujm/MB6NWvX+T4uG8C/g66I4/bGdAAAAFQDa4SS+q9aQK/XwiqnWpFpAEY74TQAAAIEAklEfXCf1qbUvTquHhtNVKTiKm+qGRsqxnLnu7aduzU81JDFzveF/agkE5x30olTvKECb1PAziDmt63z/obO3Da8TUz0QVdqv81pNWU5JUNiTB8d3rDJU3B66DA6GI305W8qyt0AGUNGR3rDIzNpZY958faBg+TaILRg8ZFNh0PAAAACAdUhJS6bl5M5sQr6XNilHa0nOTk/PB54faGWWMq7zQvxUKJKsDklNTc0MCPjRppyuokbQ6297tq8pEEFqUAyllMvAf75X7DsBQivLzbNuzp41NqFdS/Oka+T1ypRD7mT6g0Kg8yCVYD2ti874wyTpV9riUUaoItveEF3AdC9AzmI= tomk@air" + - set_fact: + test_key_label: "{{ test_prefix }}-ssh_key1" + - set_fact: + test_key_label2: "{{ test_prefix }}-ssh_key2" + - set_fact: + test_key_renamed: "{{ test_prefix }}-ssh_key1_renamed" - name: create first ssh_key for test equinix.cloud.metal_ssh_key: - label: "{{ test_prefix }}-ssh_key1" + label: "{{ test_key_label }}" key: "{{ test_key }}" register: first_ssh_key - name: create first ssh_key for test again, to check idempotence equinix.cloud.metal_ssh_key: - label: "{{ test_prefix }}-ssh_key1" + label: "{{ test_key_label }}" key: "{{ test_key }}" register: first_ssh_key_2 - assert: that: - - first_ssh_key.label == '{{ test_prefix }}-ssh_key1' - - first_ssh_key.key == "{{ test_key }}" + - first_ssh_key.label == test_key_label + - first_ssh_key.key == test_key - first_ssh_key_2.changed == false - name: update ssh_key name equinix.cloud.metal_ssh_key: id: "{{ first_ssh_key.id }}" key: "{{ test_key }}" - label: "{{ test_prefix }}-ssh_key1_renamed" + label: "{{ test_key_renamed }}" - name: fetch updated ssh_key equinix.cloud.metal_ssh_key: @@ -49,12 +55,12 @@ - assert: that: - - first_ssh_key_updated.label == '{{ test_prefix }}-ssh_key1_renamed' - - first_ssh_key.key == "{{ test_key }}" + - first_ssh_key_updated.label == test_key_renamed + - first_ssh_key.key == test_key - name: create second ssh_key for test equinix.cloud.metal_ssh_key: - label: "{{ test_prefix }}-ssh_key2" + label: "{{ test_key_label2 }}" key: "{{ test_key2 }}" register: second_ssh_key @@ -66,11 +72,11 @@ msg: "{{ ssh_keys_listed.resources }}" - debug: - msg: 'ssh_keys_listed.resources | selectattr("label", "equalto", "{{ test_prefix }}-ssh_key2")' + msg: 'ssh_keys_listed.resources | selectattr("label", "equalto", test_key_label2)' - assert: that: - - 'ssh_keys_listed.resources | selectattr("label", "equalto", "{{ test_prefix }}-ssh_key2") | length == 1' + - 'ssh_keys_listed.resources | selectattr("label", "equalto", test_key_label2) | length == 1' - name: list test ssh keys set_fact: diff --git a/tests/integration/targets/metal_vlan/tasks/main.yml b/tests/integration/targets/metal_vlan/tasks/main.yml index e894407..ff67756 100644 --- a/tests/integration/targets/metal_vlan/tasks/main.yml +++ b/tests/integration/targets/metal_vlan/tasks/main.yml @@ -28,10 +28,6 @@ name: "{{ test_prefix }}-project" register: project - - assert: - that: - - project.name == '{{ test_prefix }}-project' - - name: create first vlan for test equinix.cloud.metal_vlan: project_id: "{{ project.id }}" @@ -42,7 +38,7 @@ - assert: that: - - first_vlan.vxlan == {{ test_vxlan }} + - first_vlan.vxlan == test_vxlan - name: get vlan info equinix.cloud.metal_vlan_info: @@ -52,7 +48,7 @@ - assert: that: - "vlan_info_listed.resources | length == 1" - - vlan_info_listed.resources[0].id == "{{ first_vlan.id }}" + - vlan_info_listed.resources[0].id == first_vlan.id - name: fetch existing vlan equinix.cloud.metal_vlan: diff --git a/tests/integration/targets/metal_vrf/tasks/main.yml b/tests/integration/targets/metal_vrf/tasks/main.yml index 48bbe11..d18fbf2 100644 --- a/tests/integration/targets/metal_vrf/tasks/main.yml +++ b/tests/integration/targets/metal_vrf/tasks/main.yml @@ -60,7 +60,7 @@ assert: that: - "vrf_list.resources|length == 1" - - "vrf_list.resources[0].id == '{{ test_vrf.id }}'" + - "vrf_list.resources[0].id == test_vrf.id" - name: delete test VRF equinix.cloud.metal_vrf: