Skip to content

Commit

Permalink
Add an inherit_kerberos role
Browse files Browse the repository at this point in the history
The role installs kerberos client packages
and optionally copies the configuration
and credential cache from the host machine.
  • Loading branch information
wbclark committed Sep 5, 2022
1 parent 12c6385 commit c7c2d93
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/inherit_kerberos/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
inherit_kerberos_config: '/etc/krb5.conf'
inherit_kerberos_ccache: False
32 changes: 32 additions & 0 deletions roles/inherit_kerberos/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: "Install client packages on Red Hat based distributions"
ansible.builtin.dnf:
name:
- "krb5-workstation"
- "krb5-libs"
state: present
when: ansible_os_family == "RedHat"

- name: "Install client packages on Debian based distributions"
ansible.builtin.apt:
name: "krb5-user"
state: present
when: ansible_os_family == "Debian"

- name: "Copy Kerberos client configuration from Host"
ansible.builtin.copy:
src: "{{ inherit_kerberos_config }}"
dest: /etc/krb5.conf
owner: root
group: root
mode: '0644'
when: inherit_kerberos_config

- name: "Copy Kerberos credential cache from Host"
ansible.builtin.copy:
src: "{{ inherit_kerberos_ccache }}"
dest: "{{ inherit_kerberos_ccache }}"
owner: "{{ inherit_kerberos_local_user_name }}"
group: "{{ inherit_kerberos_local_user_groupname | default(inherit_kerberos_local_user_name) }}"
mode: '0600'
when: inherit_kerberos_ccache

0 comments on commit c7c2d93

Please sign in to comment.