mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
ipavault: Allow execution of plugin in client host.
Update vault README file and add tests for executing plugin with
`ipaapi_context` set to `client`.
A new test playbook can be found at:
tests/vault/test_vault_client_context.yml
As `ipavault` only works in client context, an error is raised if it
is explicitly executed in a server context.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
- name: Ensure test users do not exist.
|
||||
ipauser:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||
name:
|
||||
- user01
|
||||
- user02
|
||||
@@ -35,6 +36,7 @@
|
||||
- name: Ensure test groups do not exist.
|
||||
ipagroup:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||
name: vaultgroup
|
||||
state: absent
|
||||
|
||||
|
||||
@@ -35,11 +35,13 @@
|
||||
- name: Ensure vaultgroup exists.
|
||||
ipagroup:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||
name: vaultgroup
|
||||
|
||||
- name: Ensure testing users exist.
|
||||
ipauser:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: "{{ ipa_context | default(omit) }}"
|
||||
users:
|
||||
- name: user01
|
||||
first: First
|
||||
|
||||
25
tests/vault/test_vault_client_context.yml
Normal file
25
tests/vault/test_vault_client_context.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Test vault
|
||||
hosts: ipaserver
|
||||
become: no
|
||||
# Need to gather facts for ansible_env.
|
||||
gather_facts: yes
|
||||
|
||||
tasks:
|
||||
- name: Setup testing environment.
|
||||
import_tasks: env_setup.yml
|
||||
|
||||
# vault requires 'ipaapi_context: client', and uses this
|
||||
# context by defoult, so we test only for the case where
|
||||
# 'ipaapi_context: server' is explicitly set.
|
||||
- name: Execute with server context.
|
||||
ipavault:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
ipaapi_context: server
|
||||
name: ThisShouldNotWork
|
||||
vault_type: standard
|
||||
register: result
|
||||
failed_when: not (result.failed and result.msg is regex("Context 'server' for ipavault not yet supported."))
|
||||
|
||||
- name: Cleanup testing environment.
|
||||
import_tasks: env_cleanup.yml
|
||||
Reference in New Issue
Block a user