Skip to content

Instantly share code, notes, and snippets.

@willwh
Created February 28, 2019 18:03
Show Gist options
  • Save willwh/563a57fb9ae75d12f48b53eac9b1d871 to your computer and use it in GitHub Desktop.
Save willwh/563a57fb9ae75d12f48b53eac9b1d871 to your computer and use it in GitHub Desktop.
hashi_vault_v2_token_test
ansible on  hashi_vault-v2-tests [!]
➜ test/runner/ansible-test integration lookup_hashi_vault --docker centos7
Running lookup_hashi_vault integration test script
+ ANSIBLE_ROLES_PATH=../
+ ANSIBLE_CONFIG=../../integration.cfg
+ ansible-playbook -e@../../integration_config.yml playbooks/install_dependencies.yml -v
Using /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/integration.cfg as config file
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [setup_openssl : Incluse OS-specific variables] ***************************
ok: [localhost] => {"ansible_facts": {"pyopenssl_package_name": "pyOpenSSL", "pyopenssl_package_name_python3": "python3-pyOpenSSL"}, "ansible_included_var_files": ["/root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/setup_openssl/vars/RedHat.yml"], "changed": false}
TASK [setup_openssl : Install pyOpenSSL] ***************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [setup_openssl : Install pyOpenSSL] ***************************************
changed: [localhost] => {"changed": true, "changes": {"installed": ["pyOpenSSL"]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: mirror.it.ubc.ca\n * epel: mirror.layeronline.com\n * extras: mirror.it.ubc.ca\n * updates: mirror.it.ubc.ca\nResolving Dependencies\n--> Running transaction check\n---> Package pyOpenSSL.x86_64 0:0.13.1-4.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n pyOpenSSL x86_64 0.13.1-4.el7 base 135 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package\n\nTotal download size: 135 k\nInstalled size: 630 k\nDownloading packages:\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Installing : pyOpenSSL-0.13.1-4.el7.x86_64 1/1 \n Verifying : pyOpenSSL-0.13.1-4.el7.x86_64 1/1 \n\nInstalled:\n pyOpenSSL.x86_64 0:0.13.1-4.el7 \n\nComplete!\n"]}
TASK [setup_openssl : Install pyOpenSSL] ***************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [setup_openssl : register pyOpenSSL version] ******************************
changed: [localhost] => {"changed": true, "cmd": ["/usr/bin/python", "-c", "import OpenSSL; print(OpenSSL.__version__)"], "delta": "0:00:00.012083", "end": "2019-02-28 18:00:48.189056", "rc": 0, "start": "2019-02-28 18:00:48.176973", "stderr": "", "stderr_lines": [], "stdout": "0.13.1", "stdout_lines": ["0.13.1"]}
TASK [setup_openssl : register openssl version] ********************************
changed: [localhost] => {"changed": true, "cmd": "openssl version | cut -d' ' -f2", "delta": "0:00:00.005069", "end": "2019-02-28 18:00:48.318031", "rc": 0, "start": "2019-02-28 18:00:48.312962", "stderr": "", "stderr_lines": [], "stdout": "1.0.2k-fips", "stdout_lines": ["1.0.2k-fips"]}
TASK [setup_openssl : register cryptography version] ***************************
changed: [localhost] => {"changed": true, "cmd": ["/usr/bin/python", "-c", "import cryptography; print(cryptography.__version__)"], "delta": "0:00:00.008705", "end": "2019-02-28 18:00:48.455330", "rc": 0, "start": "2019-02-28 18:00:48.446625", "stderr": "", "stderr_lines": [], "stdout": "1.7.2", "stdout_lines": ["1.7.2"]}
TASK [RedHat <= 7, select last version compatible with request 2.6.0 (this version doesn't support approle auth)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [CentOS < 7, select last version compatible with Python 2.6] **************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [Install hvac Python package] *********************************************
changed: [localhost] => {"changed": true, "cmd": ["/usr/bin/pip2", "install", "-c", "/root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/playbooks/../../../../runner/requirements/constraints.txt", "hvac"], "name": ["hvac"], "requirements": null, "state": "present", "stderr": "Ignoring cryptography: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring urllib3: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring sphinx: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring wheel: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring yamllint: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring paramiko: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring pytest: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring pytest-forked: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring requests: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring virtualenv: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring pyopenssl: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring pycparser: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring xmltodict: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring lxml: markers u\"python_version < '2.7'\" don't match your environment\nIgnoring pyvmomi: markers u\"python_version < '2.7'\" don't match your environment\nYou are using pip version 8.1.2, however version 19.0.3 is available.\nYou should consider upgrading via the 'pip install --upgrade pip' command.\n", "stderr_lines": ["Ignoring cryptography: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring urllib3: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring sphinx: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring wheel: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring yamllint: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring paramiko: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring pytest: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring pytest-forked: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring requests: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring virtualenv: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring pyopenssl: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring pycparser: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring xmltodict: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring lxml: markers u\"python_version < '2.7'\" don't match your environment", "Ignoring pyvmomi: markers u\"python_version < '2.7'\" don't match your environment", "You are using pip version 8.1.2, however version 19.0.3 is available.", "You should consider upgrading via the 'pip install --upgrade pip' command."], "stdout": "Collecting hvac\n Downloading https://files.pythonhosted.org/packages/88/dd/49f4e316369e492d728983a1774367fddc5bb9975d32661247466cfea67c/hvac-0.7.2-py2.py3-none-any.whl (167kB)\nCollecting requests>=2.21.0 (from hvac)\n Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)\nCollecting urllib3<1.25,>=1.21.1 (from requests>=2.21.0->hvac)\n Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)\nCollecting chardet<3.1.0,>=3.0.2 (from requests>=2.21.0->hvac)\n Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)\nRequirement already satisfied (use --upgrade to upgrade): idna<2.6 in /usr/lib/python2.7/site-packages (from -c /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/playbooks/../../../../runner/requirements/constraints.txt (line 11))\nCollecting certifi>=2017.4.17 (from requests>=2.21.0->hvac)\n Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)\nInstalling collected packages: urllib3, chardet, certifi, requests, hvac\n Found existing installation: chardet 2.2.1\n Uninstalling chardet-2.2.1:\n Successfully uninstalled chardet-2.2.1\nSuccessfully installed certifi-2018.11.29 chardet-3.0.4 hvac-0.7.2 requests-2.21.0 urllib3-1.24.1\n", "stdout_lines": ["Collecting hvac", " Downloading https://files.pythonhosted.org/packages/88/dd/49f4e316369e492d728983a1774367fddc5bb9975d32661247466cfea67c/hvac-0.7.2-py2.py3-none-any.whl (167kB)", "Collecting requests>=2.21.0 (from hvac)", " Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)", "Collecting urllib3<1.25,>=1.21.1 (from requests>=2.21.0->hvac)", " Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)", "Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.21.0->hvac)", " Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)", "Requirement already satisfied (use --upgrade to upgrade): idna<2.6 in /usr/lib/python2.7/site-packages (from -c /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/playbooks/../../../../runner/requirements/constraints.txt (line 11))", "Collecting certifi>=2017.4.17 (from requests>=2.21.0->hvac)", " Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)", "Installing collected packages: urllib3, chardet, certifi, requests, hvac", " Found existing installation: chardet 2.2.1", " Uninstalling chardet-2.2.1:", " Successfully uninstalled chardet-2.2.1", "Successfully installed certifi-2018.11.29 chardet-3.0.4 hvac-0.7.2 requests-2.21.0 urllib3-1.24.1"], "version": null, "virtualenv": null}
PLAY RECAP *********************************************************************
localhost : ok=7 changed=5 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0
+ ANSIBLE_ROLES_PATH=../
+ ANSIBLE_CONFIG=../../integration.cfg
+ ansible-playbook -e@../../integration_config.yml playbooks/test_lookup_hashi_vault.yml -v
Using /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/integration.cfg as config file
PLAY [localhost] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [register pyOpenSSL version] **********************************************
changed: [localhost] => {"changed": true, "cmd": ["/usr/bin/python", "-c", "import OpenSSL; print(OpenSSL.__version__)"], "delta": "0:00:00.011637", "end": "2019-02-28 18:00:52.472527", "rc": 0, "start": "2019-02-28 18:00:52.460890", "stderr": "", "stderr_lines": [], "stdout": "0.13.1", "stdout_lines": ["0.13.1"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create a local temporary directory] ***
changed: [localhost] => {"changed": true, "gid": 0, "group": "root", "mode": "0700", "owner": "root", "path": "/tmp/ansible.kPx8m3", "size": 4096, "state": "directory", "uid": 0}
TASK [lookup_hashi_vault/lookup_hashi_vault : set_fact] ************************
ok: [localhost] => {"ansible_facts": {"local_temp_dir": "/tmp/ansible.kPx8m3"}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Generate privatekey] *************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Generate CSR] ********************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Generate selfsigned certificate] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Install unzip] *******************
ok: [localhost] => {"changed": false, "msg": "", "rc": 0, "results": ["unzip-6.0-19.el7.x86_64 providing unzip is already installed"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : assert] **************************
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [lookup_hashi_vault/lookup_hashi_vault : set_fact] ************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : set_fact] ************************
ok: [localhost] => {"ansible_facts": {"vault_arch": "amd64"}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Download vault binary] ***********
changed: [localhost] => {"changed": true, "dest": "/tmp/ansible.kPx8m3", "extract_results": {"cmd": ["/usr/bin/unzip", "-o", "/root/.ansible/tmp/ansible-tmp-1551376853.39-195897151154470/vault_0.11.0_linux_amd64tl5Apa.zip", "-d", "/tmp/ansible.kPx8m3"], "err": "", "out": "Archive: /root/.ansible/tmp/ansible-tmp-1551376853.39-195897151154470/vault_0.11.0_linux_amd64tl5Apa.zip\n inflating: /tmp/ansible.kPx8m3/vault \n", "rc": 0}, "gid": 0, "group": "root", "handler": "ZipArchive", "mode": "0700", "owner": "root", "size": 4096, "src": "/root/.ansible/tmp/ansible-tmp-1551376853.39-195897151154470/vault_0.11.0_linux_amd64tl5Apa.zip", "state": "directory", "uid": 0}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create configuration file] *******
changed: [localhost] => {"changed": true, "checksum": "7448aa1b2374ae108d6e2ead1997d2a4c59022b5", "dest": "/tmp/ansible.kPx8m3/vault_config.hcl", "gid": 0, "group": "root", "md5sum": "d41f92874f5f9349545acf951dd89cfe", "mode": "0644", "owner": "root", "size": 61, "src": "/root/.ansible/tmp/ansible-tmp-1551376859.41-172339315409478/source", "state": "file", "uid": 0}
TASK [lookup_hashi_vault/lookup_hashi_vault : Start vault server (dev mode enabled)] ***
changed: [localhost] => {"changed": true, "cmd": "nohup /tmp/ansible.kPx8m3/vault server -dev -config /tmp/ansible.kPx8m3/vault_config.hcl </dev/null >/dev/null 2>&1 &", "delta": "0:00:00.002154", "end": "2019-02-28 18:00:59.874594", "rc": 0, "start": "2019-02-28 18:00:59.872440", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create a test policy] ************
changed: [localhost] => {"changed": true, "cmd": "echo 'path \"secret/data/testproject/secret1\" {\n capabilities = [\"read\"]\n}\npath \"secret/data/testproject/secret2\" {\n capabilities = [\"read\", \"update\"]\n}\npath \"secret/data/testproject/secret3\" {\n capabilities = [\"deny\"]\n}\n' | /tmp/ansible.kPx8m3/vault policy write test-policy -", "delta": "0:00:00.019317", "end": "2019-02-28 18:01:00.022344", "rc": 0, "start": "2019-02-28 18:01:00.003027", "stderr": "", "stderr_lines": [], "stdout": "Success! Uploaded policy: test-policy", "stdout_lines": ["Success! Uploaded policy: test-policy"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create secrets] ******************
changed: [localhost] => (item=1) => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "kv", "put", "secret/testproject/secret1", "value=foo1"], "delta": "0:00:00.020563", "end": "2019-02-28 18:01:00.168228", "item": 1, "rc": 0, "start": "2019-02-28 18:01:00.147665", "stderr": "", "stderr_lines": [], "stdout": "Key Value\n--- -----\ncreated_time 2019-02-28T18:01:00.166366329Z\ndeletion_time n/a\ndestroyed false\nversion 1", "stdout_lines": ["Key Value", "--- -----", "created_time 2019-02-28T18:01:00.166366329Z", "deletion_time n/a", "destroyed false", "version 1"]}
changed: [localhost] => (item=2) => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "kv", "put", "secret/testproject/secret2", "value=foo2"], "delta": "0:00:00.019161", "end": "2019-02-28 18:01:00.296203", "item": 2, "rc": 0, "start": "2019-02-28 18:01:00.277042", "stderr": "", "stderr_lines": [], "stdout": "Key Value\n--- -----\ncreated_time 2019-02-28T18:01:00.294999164Z\ndeletion_time n/a\ndestroyed false\nversion 1", "stdout_lines": ["Key Value", "--- -----", "created_time 2019-02-28T18:01:00.294999164Z", "deletion_time n/a", "destroyed false", "version 1"]}
changed: [localhost] => (item=3) => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "kv", "put", "secret/testproject/secret3", "value=foo3"], "delta": "0:00:00.019930", "end": "2019-02-28 18:01:00.424402", "item": 3, "rc": 0, "start": "2019-02-28 18:01:00.404472", "stderr": "", "stderr_lines": [], "stdout": "Key Value\n--- -----\ncreated_time 2019-02-28T18:01:00.42303396Z\ndeletion_time n/a\ndestroyed false\nversion 1", "stdout_lines": ["Key Value", "--- -----", "created_time 2019-02-28T18:01:00.42303396Z", "deletion_time n/a", "destroyed false", "version 1"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create an approle policy] ********
changed: [localhost] => {"changed": true, "cmd": "echo 'path \"auth/approle/login\" {\n capabilities = [ \"create\", \"read\" ]\n}\n' | /tmp/ansible.kPx8m3/vault policy write approle-policy -", "delta": "0:00:00.019072", "end": "2019-02-28 18:01:00.570058", "rc": 0, "start": "2019-02-28 18:01:00.550986", "stderr": "", "stderr_lines": [], "stdout": "Success! Uploaded policy: approle-policy", "stdout_lines": ["Success! Uploaded policy: approle-policy"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Enable the AppRole auth method] ***
changed: [localhost] => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "auth", "enable", "approle"], "delta": "0:00:00.020272", "end": "2019-02-28 18:01:00.718491", "rc": 0, "start": "2019-02-28 18:01:00.698219", "stderr": "", "stderr_lines": [], "stdout": "Success! Enabled approle auth method at: approle/", "stdout_lines": ["Success! Enabled approle auth method at: approle/"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create a named role] *************
changed: [localhost] => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "write", "auth/approle/role/test-role", "policies=test-policy,approle-policy"], "delta": "0:00:00.017816", "end": "2019-02-28 18:01:00.875867", "rc": 0, "start": "2019-02-28 18:01:00.858051", "stderr": "", "stderr_lines": [], "stdout": "Success! Data written to: auth/approle/role/test-role", "stdout_lines": ["Success! Data written to: auth/approle/role/test-role"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Fetch the RoleID of the AppRole] ***
changed: [localhost] => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "read", "-field=role_id", "auth/approle/role/test-role/role-id"], "delta": "0:00:00.018804", "end": "2019-02-28 18:01:01.022303", "rc": 0, "start": "2019-02-28 18:01:01.003499", "stderr": "", "stderr_lines": [], "stdout": "957ab583-acae-b327-ff15-ea8d94a45aab", "stdout_lines": ["957ab583-acae-b327-ff15-ea8d94a45aab"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Get a SecretID issued against the AppRole] ***
changed: [localhost] => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "write", "-field=secret_id", "-f", "auth/approle/role/test-role/secret-id"], "delta": "0:00:00.019152", "end": "2019-02-28 18:01:01.170318", "rc": 0, "start": "2019-02-28 18:01:01.151166", "stderr": "", "stderr_lines": [], "stdout": "48594f81-c7af-d0e3-4341-525ef11d795b", "stdout_lines": ["48594f81-c7af-d0e3-4341-525ef11d795b"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : Create a test credentials (token)] ***
changed: [localhost] => {"changed": true, "cmd": ["/tmp/ansible.kPx8m3/vault", "token", "create", "-policy", "test-policy", "-field", "token"], "delta": "0:00:00.018698", "end": "2019-02-28 18:01:01.316296", "rc": 0, "start": "2019-02-28 18:01:01.297598", "stderr": "", "stderr_lines": [], "stdout": "18c62ba2-2bb6-7bea-438b-5091be63fc7f", "stdout_lines": ["18c62ba2-2bb6-7bea-438b-5091be63fc7f"]}
TASK [lookup_hashi_vault/lookup_hashi_vault : test approle auth without SSL (lookup parameters)] ***
included: /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/lookup_hashi_vault/tasks/approle_test.yml for localhost
TASK [lookup_hashi_vault/lookup_hashi_vault : Fetch secrets using "hashi_vault" lookup] ***
ok: [localhost] => {"ansible_facts": {"secret1": {"value": "foo1"}, "secret2": {"value": "foo2"}}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Check secret values] *************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when erroneous credentials are used] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.InvalidRequest'>, original message: invalid secret id"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when unauthorized secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when inexistent secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Check expected failures] *********
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [lookup_hashi_vault/lookup_hashi_vault : test approle auth without SSL (environment variable)] ***
included: /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/lookup_hashi_vault/tasks/approle_test.yml for localhost
TASK [lookup_hashi_vault/lookup_hashi_vault : Fetch secrets using "hashi_vault" lookup] ***
ok: [localhost] => {"ansible_facts": {"secret1": {"value": "foo1"}, "secret2": {"value": "foo2"}}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Check secret values] *************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when erroneous credentials are used] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.InvalidRequest'>, original message: invalid secret id"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when unauthorized secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when inexistent secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Check expected failures] *********
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [lookup_hashi_vault/lookup_hashi_vault : test approle auth with certs (validation enabled, lookup parameters)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : test approle auth with certs (validation enabled, environment variables)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : test approle auth with certs (validation disabled, lookup parameters)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : test token auth without SSL (lookup parameters)] ***
included: /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/lookup_hashi_vault/tasks/token_test.yml for localhost
TASK [lookup_hashi_vault/lookup_hashi_vault : Fetch secrets using "hashi_vault" lookup] ***
ok: [localhost] => {"ansible_facts": {"secret1": {"value": "foo1"}, "secret2": {"value": "foo2"}, "secret3": {"value": "foo2"}}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Check secret values] *************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when erroneous credentials are used] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Invalid Hashicorp Vault Token Specified for hashi_vault lookup"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when unauthorized secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when inexistent secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Check expected failures] *********
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [lookup_hashi_vault/lookup_hashi_vault : test token auth without SSL (environment variable)] ***
included: /root/.ansible/test/tmp/lookup_hashi_vault-HpO6e8-ÅÑŚÌβŁÈ/test/integration/targets/lookup_hashi_vault/lookup_hashi_vault/tasks/token_test.yml for localhost
TASK [lookup_hashi_vault/lookup_hashi_vault : Fetch secrets using "hashi_vault" lookup] ***
ok: [localhost] => {"ansible_facts": {"secret1": {"value": "foo1"}, "secret2": {"value": "foo2"}, "secret3": {"value": "foo2"}}, "changed": false}
TASK [lookup_hashi_vault/lookup_hashi_vault : Check secret values] *************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when erroneous credentials are used] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'ansible.errors.AnsibleError'>, original message: Invalid Hashicorp Vault Token Specified for hashi_vault lookup"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when unauthorized secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Failure expected when inexistent secret is read] ***
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'hashi_vault'. Error was a <class 'hvac.exceptions.Forbidden'>, original message: 1 error occurred:\n\n* permission denied"}
...ignoring
TASK [lookup_hashi_vault/lookup_hashi_vault : Check expected failures] *********
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [lookup_hashi_vault/lookup_hashi_vault : test token auth with certs (validation enabled, lookup parameters)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : test token auth with certs (validation enabled, environment variables)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : test token auth with certs (validation disabled, lookup parameters)] ***
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}
TASK [lookup_hashi_vault/lookup_hashi_vault : Kill vault process] **************
changed: [localhost] => {"changed": true, "cmd": "kill $(cat /tmp/ansible.kPx8m3/vault.pid)", "delta": "0:00:00.003000", "end": "2019-02-28 18:01:02.686999", "rc": 0, "start": "2019-02-28 18:01:02.683999", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
TASK [lookup_hashi_vault/lookup_hashi_vault : Delete temp dir] *****************
changed: [localhost] => {"changed": true, "path": "/tmp/ansible.kPx8m3", "state": "absent"}
PLAY RECAP *********************************************************************
localhost : ok=44 changed=15 unreachable=0 failed=0 skipped=14 rescued=0 ignored=12
ansible on  hashi_vault-v2-tests [!] took 39s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment