Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an inherit_kerberos role #1574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Comment on lines +2 to +14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you culd use ansible.builtin.package which works across distros, and load the correct list of packages using a vars file.

include_vars: "{{ ansible_os_family }}.yml"

bats_packages:

Not saying you have to, but something to consider :)


- 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 is defined

- name: "Copy Kerberos credential cache from Host"
ansible.builtin.copy:
src: "{{ inherit_kerberos_ccache }}"
dest: "{{ inherit_kerberos_ccache }}"
owner: "{{ inherit_kerberos_local_user_name }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does inherit_kerberos_local_user_name come from? I don't see it defined anywhere.

Copy link
Contributor Author

@wbclark wbclark Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally written to be part of the unprivileged_user role and the value of unprivileged_user_username was passed for the owner. The approach was to give unprivileged_user additional features to have more general user creation/setup powers, while leaving its default behavior essentially the same in setting up the vagrant user for images that don't already have it; therefore the assumption at that time was that this block does not run by default, so an user passing the extra stuff required to run these extra bits would be doing it to setup their personal or devel user and not the default vagrant user in that role.

So with the request to split this out into more of a standalone role, instead I assume that the value will be provided by whatever role or playbook I create in the future that includes this role.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it!

group: "{{ inherit_kerberos_local_user_groupname | default(inherit_kerberos_local_user_name) }}"
mode: '0600'
when: inherit_kerberos_ccache is defined