From 6c0c2d6bce2e630188ab61cb5026621ae4935567 Mon Sep 17 00:00:00 2001 From: Isaac Wagner Date: Thu, 6 Oct 2022 19:43:42 -0400 Subject: [PATCH] Move setup to test specific setup Moves the setup for vault_kv2_delete into a test specific setup instead of the general setup. --- .../tasks/module_vault_kv2_delete_setup.yml | 20 +++++++++++++++++++ .../setup_vault_configure/tasks/configure.yml | 9 --------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/tests/integration/targets/module_vault_kv2_delete/tasks/module_vault_kv2_delete_setup.yml b/tests/integration/targets/module_vault_kv2_delete/tasks/module_vault_kv2_delete_setup.yml index 012b300f1..8b9c98707 100644 --- a/tests/integration/targets/module_vault_kv2_delete/tasks/module_vault_kv2_delete_setup.yml +++ b/tests/integration/targets/module_vault_kv2_delete/tasks/module_vault_kv2_delete_setup.yml @@ -7,3 +7,23 @@ vault_ci_token_create: policies: [test-policy] register: user_token_cmd + +- name: Configuration tasks + module_defaults: + vault_ci_kv2_destroy_all: '{{ vault_plugins_module_defaults_common }}' + vault_ci_kv_put: '{{ vault_plugins_module_defaults_common }}' + block: + + - name: Remove existing multi-version secret + vault_ci_kv2_destroy_all: + mount_point: '{{ vault_kv2_mount_point }}' + path: '{{ vault_kv2_versioned_path }}/secret6' + + - name: Set up a multi versioned secret for delete (v2) + vault_ci_kv_put: + version: 2 + mount_point: '{{ vault_kv2_mount_point }}' + path: '{{ vault_kv2_versioned_path }}/secret6' + secret: + v: value{{item}} + loop: ["1", "2", "3", "4", "5"] diff --git a/tests/integration/targets/setup_vault_configure/tasks/configure.yml b/tests/integration/targets/setup_vault_configure/tasks/configure.yml index f68c1973c..3d7bc5f61 100644 --- a/tests/integration/targets/setup_vault_configure/tasks/configure.yml +++ b/tests/integration/targets/setup_vault_configure/tasks/configure.yml @@ -97,15 +97,6 @@ a: two v: 2 -- name: Set up a multi versioned secret for delete (v2) - vault_ci_kv_put: - version: 2 - mount_point: '{{ vault_kv2_mount_point }}' - path: '{{ vault_kv2_versioned_path }}/secret6' - secret: - v: value{{item}} - loop: ["1", "2", "3", "4", "5"] - - name: 'Write Canary' vault_ci_write: path: '{{ vault_configure_canary.path }}'