-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
we will create a system ldap role which can be used to bind vms to active directory and sftp role and/or playbook can incorporate this role
- Loading branch information
Showing
19 changed files
with
166 additions
and
448 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,30 @@ | ||
Role Name | ||
========= | ||
# Ansible Role: sssd_ad | ||
|
||
Configures an endpoint to use [SSSD](https://ubuntu.com/server/docs/service-sssd) to connect to Princeton Active Directory | ||
This Ansible role configures an Ubuntu Jammy (22.04) machine to authenticate against an Active Directory domain using SSSD (System Security Services Daemon). | ||
|
||
Requirements | ||
------------ | ||
## Requirements | ||
|
||
One will need access to [OIT AD Machine Registration Tool](https://tools.princeton.edu/Dept/) This allows you to register a new name for AD | ||
- Ansible 2.9 or higher | ||
- An Ubuntu Jammy (22.04) target machine | ||
- Access to an Active Directory domain controller | ||
- An AD user with permissions to join machines to the domain | ||
|
||
When the playbook is run the first time, it will fail until you add the following manual steps. | ||
## Role Variables | ||
|
||
```zsh | ||
sudo realm discover pu.win.princeton.edu | ||
sudo realm join -U doas-libsftp pu.win.princeton.edu | ||
``` | ||
| Variable | Description | | ||
|---|---| | ||
| `ad_domain` | The name of your Active Directory domain (e.g., example.com) | | ||
| `ad_domain_controller` | The hostname or IP address of your domain controller | | ||
| `ad_admin_user` | An Active Directory user with permissions to join machines to the domain | | ||
| `ad_test_user` | A test user in your Active Directory domain | | ||
|
||
The password for the step above can be found by looking in the LastPass Vault: | ||
## Dependencies | ||
|
||
```zsh | ||
lpass ls | grep doas-libsftp | ||
lpass show <results_from_above> --password | pbcopy | ||
None | ||
|
||
``` | ||
## Example Playbook | ||
|
||
Enable mkhomedir with the steps below: | ||
|
||
```zsh | ||
sudo bash -c "cat > /usr/share/pam-configs/mkhomedir" <<EOF | ||
Name: activate mkhomedir | ||
Default: yes | ||
Priority: 900 | ||
Session-Type: Additional | ||
Session: | ||
required pam_mkhomedir.so umask=0022 skel=/etc/skel | ||
EOF | ||
``` | ||
Then activate with | ||
|
||
```zsh | ||
sudo pam-auth-update | ||
``` | ||
|
||
|
||
Role Variables | ||
-------------- | ||
|
||
|
||
Dependencies | ||
------------ | ||
|
||
- [roles/common](roles/common) | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
To allow a new user to log in run | ||
|
||
```zsh | ||
ansible-playbook -v playbooks/lib_sftp.yml -e [email protected] -t add_sftp_user | ||
``` | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
|
||
Author Information | ||
------------------ | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). | ||
```yaml | ||
- hosts: your_ubuntu_servers | ||
roles: | ||
- sssd_ad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
--- | ||
# defaults file for system_ldap | ||
# | ||
sssd_pkg_state: "latest" | ||
sssd__unwanted_packages_state: "absent" | ||
sssd__deploy_state: "present" | ||
|
||
# Configuration | ||
sssd_mkhomedir: true | ||
sssd_home_path: "/home" | ||
sssd_shell: "/bin/bash" | ||
sssd_shell_override: false | ||
|
||
auth_rule_one: "{{ omit }}" | ||
auth_rule_two: "{{ omit }}" | ||
auth_rule_three: "{{ omit }}" | ||
auth_rule_dev: "{{ omit }}" | ||
|
||
sssd_sudoers_ldap: false | ||
|
||
# Service | ||
sssd_service_name: "sssd" | ||
sssd_flush_handlers: false | ||
|
||
# user | ||
almasftp_user_password: "$6$gfh/f8sNL6WvgI.R$Jwk1s.2sWeItL54G7oz7Qp2C.qvLknMLeWBhzycZXaGLFd6Q/bxkSIbv/Hp8qmkJw.WI/gVzzpziuaSl5KRal." | ||
ad_domain: "pu.win.princeton.edu" | ||
ad_test_user: "{{ omit }}" | ||
ad_domain_controller: "pu.win.princeton.edu" | ||
ad_admin_user: "{{ omit }}" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
--- | ||
# handlers file for system_ldap | ||
# | ||
- name: restart sssd | ||
service: | ||
name: "{{ sssd_service_name }}" | ||
state: restarted | ||
|
||
- name: restart sshd | ||
service: | ||
name: sshd | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.