Ansible - Kerberos

Install dependencies:

sudo apt-get install python-dev libkrb5-dev krb5-user python3-pip
pip3 install pywinrm[kerberos]

Edit /etc/krb5.conf:

[libdefaults]
        default_realm = X.X
[realms]
        X.X = {
                kdc = x.x.x
                kdc = y.y.y
        }
[domain_realm]
        .x.x = X.X
        x.x = X.X

Get a Kerberos ticket:

List Kerberos tickets:

klist

Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]

Valid starting       Expires              Service principal
06/26/2019 13:46:17  06/26/2019 23:46:17  krbtgt/[email protected]
        renew until 06/27/2019 13:46:15

Removes existing Kerberos tickets:

kdestroy -A