ansible-gnu-corporate-works.../roles/samba/tasks/main.yml

62 lines
1.2 KiB
YAML
Raw Normal View History

---
2017-08-31 21:22:57 +02:00
- name: Install samba and required tools
apt:
2020-04-26 19:30:39 +02:00
name: "{{ item }}"
state: present
loop: "{{ samba_packages }}"
tags: samba
2017-08-31 21:22:57 +02:00
- name: Install nsswitch passwd config
lineinfile:
2020-04-26 19:30:39 +02:00
dest: /etc/nsswitch.conf
regexp: "^passwd:"
line: "passwd{{ ':' }} files winbind"
notify: Restart samba
tags:
- samba
- nsswitch
2017-08-31 21:22:57 +02:00
- name: Install nsswitch group config
lineinfile:
2020-04-26 19:30:39 +02:00
dest: /etc/nsswitch.conf
regexp: "^group:"
line: "group{{ ':' }} files winbind"
notify: Restart samba
tags:
- samba
- nsswitch
2017-08-31 21:22:57 +02:00
- name: Install nsswitch shadow config
lineinfile:
2020-04-26 19:30:39 +02:00
dest: /etc/nsswitch.conf
regexp: "^shadow:"
line: "shadow{{ ':' }} files winbind"
notify: Restart samba
tags:
- samba
- nsswitch
2017-08-31 21:22:57 +02:00
- name: Install samba configuration
template:
2020-04-26 19:30:39 +02:00
src: smb.conf.j2
dest: /etc/samba/smb.conf
mode: 0644
owner: root
group: root
notify: Restart samba
tags:
- samba
- smbconf
2017-08-31 21:22:57 +02:00
- name: Enable samba services
service:
2020-04-26 19:30:39 +02:00
name: "{{ item }}"
enabled: yes
loop: "{{ samba_daemons }}"
tags: samba
2017-08-31 21:22:57 +02:00
- name: Join domain
2020-04-26 19:30:39 +02:00
shell: "net ads join -U {{ ad_admin_username }}%{{ ad_admin_password }}"
notify: Restart samba
register: join_domain
2020-04-26 19:30:39 +02:00
tags: samba