keytab: Prefix variable names with keytab_
This commit is contained in:
parent
4fb04065f9
commit
e2c59bc220
11 changed files with 24 additions and 24 deletions
|
@ -28,7 +28,7 @@
|
|||
- ansible_host
|
||||
- certbot
|
||||
- role: keytab
|
||||
principals:
|
||||
keytab_principals:
|
||||
- "host/{{ inventory_hostname }}@{{ kerberos_realm }}"
|
||||
- nfs_client
|
||||
- sssd
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
- collab
|
||||
- mod_auth_gssapi
|
||||
- role: keytab
|
||||
keytab: /etc/httpd/httpd.keytab
|
||||
principals: HTTP/collab.foo.sh@FOO.SH
|
||||
group: apache
|
||||
keytab_path: /etc/httpd/httpd.keytab
|
||||
keytab_principals: HTTP/collab.foo.sh@FOO.SH
|
||||
keytab_group: apache
|
||||
- ldap
|
||||
|
||||
tasks:
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
roles:
|
||||
- base
|
||||
- role: keytab
|
||||
principals:
|
||||
keytab_principals:
|
||||
- "host/{{ inventory_hostname }}@{{ kerberos_realm }}"
|
||||
- "smtp/{{ mail_server }}@{{ kerberos_realm }}"
|
||||
- nfs_client
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
- sssd
|
||||
- nfs_server
|
||||
- role: keytab
|
||||
principals: "nfs/{{ inventory_hostname }}@FOO.SH"
|
||||
keytab_principals: "nfs/{{ inventory_hostname }}@FOO.SH"
|
||||
|
||||
tasks:
|
||||
- name: Copy exports file
|
||||
|
|
|
@ -50,5 +50,5 @@
|
|||
ansible.builtin.import_role:
|
||||
name: keytab
|
||||
vars:
|
||||
keytab: /etc/cups/cups.keytab
|
||||
principals: "HTTP/print.foo.sh@{{ kerberos_realm }}"
|
||||
keytab_path: /etc/cups/cups.keytab
|
||||
keytab_principals: "HTTP/print.foo.sh@{{ kerberos_realm }}"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
roles:
|
||||
- base
|
||||
- role: keytab
|
||||
principals:
|
||||
keytab_principals:
|
||||
- "host/{{ inventory_hostname }}@{{ kerberos_realm }}"
|
||||
- "nfs/{{ inventory_hostname }}@{{ kerberos_realm }}"
|
||||
- nfs_client
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
roles:
|
||||
- base
|
||||
- role: keytab
|
||||
principals:
|
||||
keytab_principals:
|
||||
- "host/{{ inventory_hostname }}@FOO.SH"
|
||||
- "nfs/{{ inventory_hostname }}@FOO.SH"
|
||||
- nfs_client
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
- base
|
||||
- mod_auth_gssapi
|
||||
- role: keytab
|
||||
keytab: /etc/httpd/httpd.keytab
|
||||
principals: HTTP/zm.foo.sh@FOO.SH
|
||||
group: apache
|
||||
keytab_path: /etc/httpd/httpd.keytab
|
||||
keytab_principals: HTTP/zm.foo.sh@FOO.SH
|
||||
keytab_group: apache
|
||||
|
||||
tasks:
|
||||
- name: Run handlers to get interfaces configured
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
ansible.builtin.include_role:
|
||||
name: keytab
|
||||
vars:
|
||||
keytab: /etc/dovecot/dovecot.keytab
|
||||
principals:
|
||||
keytab_path: /etc/dovecot/dovecot.keytab
|
||||
keytab_principals:
|
||||
- "imap/{{ mail_server }}@{{ kerberos_realm }}"
|
||||
group: dovecot
|
||||
keytab_group: dovecot
|
||||
|
||||
- name: Install privatekey
|
||||
ansible.builtin.copy:
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
keytab: /etc/krb5.keytab
|
||||
group: "{{ ansible_wheel }}"
|
||||
keytab_path: /etc/krb5.keytab
|
||||
keytab_group: "{{ ansible_wheel }}"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
- name: Check if keytab exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ keytab }}"
|
||||
path: "{{ keytab_path }}"
|
||||
register: keytab_status
|
||||
check_mode: false
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
- -k
|
||||
- "/tmp/{{ inventory_hostname }}.kt"
|
||||
- "{{ item }}"
|
||||
with_items: "{{ principals }}"
|
||||
with_items: "{{ keytab_principals }}"
|
||||
delegate_to: ldap01.home.foo.sh
|
||||
when: not keytab_status.stat.exists
|
||||
|
||||
|
@ -39,12 +39,12 @@
|
|||
ansible.builtin.shell: >-
|
||||
set -o pipefail &&
|
||||
umask 077 &&
|
||||
echo '{{ keytab_data.stdout }}' | base64 -d > "{{ keytab }}"
|
||||
echo '{{ keytab_data.stdout }}' | base64 -d > "{{ keytab_path }}"
|
||||
when: not keytab_status.stat.exists
|
||||
|
||||
- name: Check keytab permissions
|
||||
ansible.builtin.file:
|
||||
path: "{{ keytab }}"
|
||||
mode: "{% if group == ansible_wheel %}0600{% else %}0640{% endif %}"
|
||||
path: "{{ keytab_path }}"
|
||||
mode: "{% if keytab_group == ansible_wheel %}0600{% else %}0640{% endif %}"
|
||||
owner: root
|
||||
group: "{{ group }}"
|
||||
group: "{{ keytab_group }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue