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

feat(ad): Add support for Ubuntu #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
name: dbus
enabled: yes
state: restarted
when: ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat' or ansible_distribution == 'Ubuntu'

- name: restart oddjob
service:
Expand All @@ -58,5 +58,12 @@
state: restarted
when: ansible_os_family == 'RedHat'

- name: restart ssh
service:
name: ssh
enabled: yes
state: restarted
when: ansible_distribution == 'Ubuntu'

- name: pam-auth-update
command: /usr/sbin/pam-auth-update --package
4 changes: 4 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ galaxy_info:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
- xenial
galaxy_tags:
- ad
- activedirectory
10 changes: 10 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
- import_tasks: redhat.yml
when: ansible_os_family == 'RedHat'

- import_tasks: ubuntu.yml
when: ansible_distribution == 'Ubuntu'

# Common files between the dists
- name: krb5.conf
template:
Expand Down Expand Up @@ -89,3 +92,10 @@
- aad_sssd

- meta: flush_handlers

- name: Update sudoers to give AD group access
lineinfile:
path: /etc/sudoers
state: present
regexp: '^%domain\s'
line: '%domain\ [email protected]'
31 changes: 31 additions & 0 deletions tasks/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: auth packages
apt:
name: "{{ item }}"
update_cache: true
with_items: "{{ authconfig_packages }}"

#- name: nsswitch conf
# template:
# src: nsswitch.conf.j2
# dest: /etc/nsswitch.conf

# PAM module to auto-create home directories
- name: mkhomedir
template:
dest: '/usr/share/pam-configs/mkhomedir'
src: 'mkhomedir.j2'
owner: 'root'
group: 'root'
mode: 0644
notify: pam-auth-update

# PAM module to restrict access to specific users/groups
#- name: enable access restrictions
# template:
# dest: /usr/share/pam-configs/access
# src: pam_config_access.j2
# owner: 'root'
# group: 'root'
# mode: 0644
# notify: pam-auth-update
2 changes: 1 addition & 1 deletion vars/RedHat-7.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Cent/EL 7
# CentOS / RHEL
authconfig_packages:
- 'sssd'
- 'adcli'
Expand Down
14 changes: 14 additions & 0 deletions vars/Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# Ubuntu packages
authconfig_packages:
- realmd
- adcli
- packagekit
- ldap-utils
- krb5-user
- libpam-krb5
- sssd
- sssd-tools
- libpam-sss
- libnss-sss
- openssh-server