# Setting up kerberos

**URL:** <https://forum.ansible.com/t/setting-up-kerberos/27478>\
**Category:** Ansible Project\
**Created:** [May 8, 2018, 2:22am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478 "2018-05-08T02:22:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [May 8, 2018, 2:22am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/1 "2018-05-08T02:22:12Z")

</div>

I must be looking at the wrong places. I would like to see an  
example of setting up kerberos using a task file, but all I find is  
how to make ansible authenticate using kerberos. Suggestions?

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [May 8, 2018, 2:26am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/2 "2018-05-08T02:26:32Z")

</div>

This is a very vague question, what exactly are you wanting to do when you say “setting up kerberos” and someone might be able to help.

---

<div class="post-metadata">

**Author:** ![Michael\_Pechner](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Michael\_Pechner](https://forum.ansible.com/u/Michael_Pechner)\
**Post date:** [May 8, 2018, 3:57am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/3 "2018-05-08T03:57:18Z")

</div>

Are you looking to setup a KDC?  
Install client packages?  
Setup the config files?

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [May 13, 2018, 1:08am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/4 "2018-05-13T01:08:54Z")

</div>

> Are you looking to setup a KDC?  
> Install client packages?  
> Setup the config files?

Oops. I meant deploy a client from package to config.

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [May 13, 2018, 1:37am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/5 "2018-05-13T01:37:22Z")

</div>

> > Are you looking to setup a KDC?  
> > Install client packages?  
> > Setup the config files?
> 
> Oops. I meant deploy a client from package to config.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Let me elaborate: I think getting the packages for centos would  
go something like this

&nbsp;&nbsp;- name: Install kerberos  
&nbsp;&nbsp;&nbsp;&nbsp;yum:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: {{ item }}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update\_cache: yes  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: latest  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- krb5-workstation  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- krb5-libs  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- krb5-auth-dialog

Then we have the client config side of the show

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [May 14, 2018, 4:01am UTC](https://forum.ansible.com/t/setting-up-kerberos/27478/6 "2018-05-14T04:01:26Z")

</div>

I’ve created a role that can do what you are looking for but it includes things outside of Kerberos and more specific for that task at hand [https://github.com/jborean93/ansible-windows/tree/master/vagrant-linux/roles/kerberos](https://github.com/jborean93/ansible-windows/tree/master/vagrant-linux/roles/kerberos). What you really need is 2 tasks;

1. Install the kerb/gssapi packages using the package tool you require (yum/apt/dnf…)
2. Template out a copy of the krb5.conf file with the configuration on your environment  
The 1st step is easy, the 2nd step is really up to what your krb5.conf file looks like. The documentation around this file and what each option/section does can be found here [https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf\_files/krb5\_conf.html](https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html).

Thanks

Jordan
