36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
|
---
|
||
|
# tasks file for sambadc
|
||
|
- name: Install sambadc
|
||
|
apt_rpm:
|
||
|
pkg: task-samba-dc
|
||
|
|
||
|
- name: set hostname
|
||
|
shell: hostnamectl set-hostname "{{ hostsamba }}"
|
||
|
|
||
|
- name: prepare sambadc
|
||
|
shell: for service in smb nmb krb5kdc slapd bind; do chkconfig $service off; service $service stop; done && rm -f /etc/samba/smb.conf && echo "name_servers=127.0.0.1" >> /etc/resolvconf.conf && resolvconf -u
|
||
|
|
||
|
- name: prepare sambadc
|
||
|
shell: samba-tool domain provision --realm="{{ realmsamba }}" --domain "{{ domainsamba }}" --adminpass='Pa$$word' --dns-backend=SAMBA_INTERNAL --server-role=dc --use-rfc2307
|
||
|
|
||
|
- name: Start sambadc
|
||
|
service:
|
||
|
name: samba
|
||
|
state: started
|
||
|
enabled: yes
|
||
|
|
||
|
- name: create user1
|
||
|
shell: samba-tool user create ivanov 'Pa$$word' --given-name='Иван Иванов' --mail-address='ivanov@testkl.testbg'
|
||
|
|
||
|
- name: create user2
|
||
|
shell: samba-tool user create pupkin 'Pa$$word' --given-name='Петя Пупкин' --mail-address='pupkin@testkl.testbg'
|
||
|
|
||
|
- name: ldap server require strong auth = NO
|
||
|
shell: sed -i '/global/a ldap server require strong auth = No' /etc/samba/smb.conf
|
||
|
|
||
|
- name: restart sambadc
|
||
|
service:
|
||
|
name: samba
|
||
|
state: restarted
|
||
|
enabled: yes
|