- name:Skip explicit auth tests on FreeBSD as Heimdal there does not have gss_acquire_cred_with_password
- name:test Negotiate auth over HTTP with explicit credentials
when:ansible_facts.os_family != 'FreeBSD'
block:
- name:test Negotiate auth over HTTP with explicit credentials
get_url:
url:http://{{ httpbin_host }}/gssapi
dest:'{{ remote_tmp_dir }}/gssapi_explicit.txt'
use_gssapi:yes
url_username:'{{ krb5_username }}'
url_password:'{{ krb5_password }}'
register:http_explicit
- name:get result of test Negotiate auth over HTTP with explicit credentials
slurp:
path:'{{ remote_tmp_dir }}/gssapi_explicit.txt'
register:http_explicit_actual
- name:assert test Negotiate auth with implicit credentials
assert:
that:
- http_explicit.status_code == 200
- http_explicit_actual.content | b64decode | trim == 'Microsoft Rulz'
- name:FreeBSD - verify it fails with explicit credential
get_url:
get_url:
url:http://{{ httpbin_host }}/gssapi
url:http://{{ httpbin_host }}/gssapi
dest:'{{ remote_tmp_dir }}/gssapi_explicit.txt'
dest:'{{ remote_tmp_dir }}/gssapi_explicit.txt'
use_gssapi:yes
use_gssapi:yes
url_username:'{{ krb5_username }}'
url_username:'{{ krb5_username }}'
url_password:'{{ krb5_password }}'
url_password:'{{ krb5_password }}'
register:explicit_failure
register:http_explicit
when:ansible_facts.os_family == 'FreeBSD'
failed_when:
- name:get result of test Negotiate auth over HTTP with explicit credentials
- '"Platform GSSAPI library does not support gss_acquire_cred_with_password, cannot acquire GSSAPI credential with explicit username and password" not in explicit_failure.msg'
slurp:
path:'{{ remote_tmp_dir }}/gssapi_explicit.txt'
register:http_explicit_actual
- name:assert test Negotiate auth with implicit credentials
assert:
that:
- http_explicit.status_code == 200
- http_explicit_actual.content | b64decode | trim == 'Microsoft Rulz'
- name:skip tests on macOS, I cannot seem to get it to read a credential from a custom ccache
- name:skip tests on macOS, I cannot seem to get it to read a credential from a custom ccache
- name:Skip explicit auth tests on FreeBSD as Heimdal there does not have gss_acquire_cred_with_password
- name:test Negotiate auth over HTTP with explicit credentials
when:ansible_facts.os_family != 'FreeBSD'
uri:
block:
url:http://{{ httpbin_host }}/gssapi
- name:test Negotiate auth over HTTP with explicit credentials
use_gssapi:yes
uri:
url_username:'{{ krb5_username }}'
url:http://{{ httpbin_host }}/gssapi
url_password:'{{ krb5_password }}'
use_gssapi:yes
return_content:yes
url_username:'{{ krb5_username }}'
register:http_explicit
url_password:'{{ krb5_password }}'
return_content:yes
register:http_explicit
- name:test Negotiate auth over HTTPS with explicit credentials
uri:
url:https://{{ httpbin_host }}/gssapi
use_gssapi:yes
url_username:'{{ krb5_username }}'
url_password:'{{ krb5_password }}'
return_content:yes
register:https_explicit
- name:assert test Negotiate auth with implicit credentials
assert:
that:
- http_explicit.status == 200
- http_explicit.content | trim == 'Microsoft Rulz'
- https_explicit.status == 200
- https_explicit.content | trim == 'Microsoft Rulz'
- name:FreeBSD - verify it fails with explicit credential
- name:test Negotiate auth over HTTPS with explicit credentials
uri:
uri:
url:https://{{ httpbin_host }}/gssapi
url:https://{{ httpbin_host }}/gssapi
use_gssapi:yes
use_gssapi:yes
url_username:'{{ krb5_username }}'
url_username:'{{ krb5_username }}'
url_password:'{{ krb5_password }}'
url_password:'{{ krb5_password }}'
register:explicit_failure
return_content:yes
when:ansible_facts.os_family == 'FreeBSD'
register:https_explicit
failed_when:
- '"Platform GSSAPI library does not support gss_acquire_cred_with_password, cannot acquire GSSAPI credential with explicit username and password" not in explicit_failure.msg'
- name:assert test Negotiate auth with implicit credentials
assert:
that:
- http_explicit.status == 200
- http_explicit.content | trim == 'Microsoft Rulz'
- https_explicit.status == 200
- https_explicit.content | trim == 'Microsoft Rulz'
- name:skip tests on macOS, I cannot seem to get it to read a credential from a custom ccache
- name:skip tests on macOS, I cannot seem to get it to read a credential from a custom ccache