Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
696cf4c8fe |
3 changed files with 27 additions and 0 deletions
10
create-client-host.yml
Normal file
10
create-client-host.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
- name: Set up NFS client host (server side)
|
||||||
|
hosts: server
|
||||||
|
tasks:
|
||||||
|
- name: Create kerberos principal for client host
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "kadmin.local add_principal -nokey {{ nfs_client_host }}"
|
||||||
|
failed_when: _task.result.rc != 0 and _task.result.rc != 1
|
||||||
|
changed_when: _task.result.rc == 0
|
||||||
|
|
||||||
|
|
@ -5,4 +5,5 @@
|
||||||
- chrony
|
- chrony
|
||||||
- kerberos
|
- kerberos
|
||||||
- nfs
|
- nfs
|
||||||
|
- kerberos_nfs
|
||||||
- vault
|
- vault
|
||||||
|
|
|
||||||
16
roles/kerberos_nfs/tasks/main.yml
Normal file
16
roles/kerberos_nfs/tasks/main.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
- name: Create nfs kerberos principal
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "kadmin.local add_principal -nokey nfs/{{ ansible_facts['hostname'] }}"
|
||||||
|
failed_when: _task.result.rc != 0 and _task.result.rc != 1
|
||||||
|
changed_when: _task.result.rc == 0
|
||||||
|
|
||||||
|
- name: Check keytab
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "k5srvutil list"
|
||||||
|
register: keytab
|
||||||
|
|
||||||
|
- name: Add nfs kerberos to keytab
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "kadmin.local ktadd nfs/{{ kerberos_realm}}"
|
||||||
|
when: keytab.stdout is not search("nfs/" ~ ansible_facts['hostname'])
|
||||||
Loading…
Add table
Add a link
Reference in a new issue