kerberos/keytab: Rename to just keytab

This commit is contained in:
Timo Makinen 2021-09-01 15:38:24 +00:00
parent 29c6fd3205
commit 6522cc20ba
12 changed files with 11 additions and 11 deletions

View file

@ -0,0 +1,31 @@
---
- name: check if keytab exists
stat:
path: "{{ keytab }}"
register: keytab_status
check_mode: false
- block:
- block:
- name: "add principal to keytab"
command: "kadmin.local ktadd -k /tmp/{{ inventory_hostname }}.kt \
{{ item }}"
with_items: "{{ principals }}"
- name: get keytab
command: "base64 /tmp/{{ inventory_hostname }}.kt"
register: keytab_data
- name: delete temporary file
file:
path: "/tmp/{{ inventory_hostname }}.kt"
state: absent
delegate_to: ldap01.home.foo.sh
- name: deploy keytab file
shell: "umask 077 && echo '{{ keytab_data.stdout }}' | base64 -d > {{keytab }}"
when: not keytab_status.stat.exists
- name: check keytab permissions
file:
path: "{{ keytab }}"
mode: "{% if group == ansible_wheel %}0600{% else %}0640{% endif %}"
owner: root
group: "{{ group }}"