76 lines
1.3 KiB
YAML
76 lines
1.3 KiB
YAML
---
|
|
- name: Install samba and required tools
|
|
apt:
|
|
name={{ item }}
|
|
state=present
|
|
with_items:
|
|
- heimdal-clients
|
|
- libnss-winbind
|
|
- libpam-winbind
|
|
- ntp
|
|
- ntpdate
|
|
- samba
|
|
- winbind
|
|
tags:
|
|
- samba
|
|
|
|
- name: Install nsswitch passwd config
|
|
lineinfile:
|
|
dest=/etc/nsswitch.conf
|
|
regexp="^passwd:"
|
|
line="passwd{{ ':' }} files winbind"
|
|
notify: restart samba
|
|
tags:
|
|
- samba
|
|
- nsswitch
|
|
|
|
- name: Install nsswitch group config
|
|
lineinfile:
|
|
dest=/etc/nsswitch.conf
|
|
regexp="^group:"
|
|
line="group{{ ':' }} files winbind"
|
|
notify: restart samba
|
|
tags:
|
|
- samba
|
|
- nsswitch
|
|
|
|
- name: Install nsswitch shadow config
|
|
lineinfile:
|
|
dest=/etc/nsswitch.conf
|
|
regexp="^shadow:"
|
|
line="shadow{{ ':' }} files winbind"
|
|
notify: restart samba
|
|
tags:
|
|
- samba
|
|
- nsswitch
|
|
|
|
- name: Install samba configuration
|
|
template:
|
|
src=smb.conf.j2
|
|
dest=/etc/samba/smb.conf
|
|
mode=0644
|
|
owner=root
|
|
group=root
|
|
notify: restart samba
|
|
tags:
|
|
- samba
|
|
- smbconf
|
|
|
|
- name: Enable samba services
|
|
service:
|
|
name={{ item }}
|
|
enabled=yes
|
|
with_items:
|
|
- smbd
|
|
- nmbd
|
|
- winbind
|
|
tags:
|
|
- samba
|
|
|
|
- name: Join domain
|
|
shell: net ads join -U {{ ad_admin_username }}%{{ ad_admin_password }}
|
|
notify: restart samba
|
|
register: join_domain
|
|
tags: samba
|
|
|