infra/roles/samba/tasks/samba.yml

85 lines
1.4 KiB
YAML

---
- name: create dirs for drivers
file:
state: directory
path: /srv/samba/{{ item.path }}
owner: root
group: root
mode: 0775
loop_control:
label: "{{ item.path }}"
when:
- samba_cups == true
with_items:
- path: ""
- path: drivers
- path: drivers/hp1010
- name: copy windows driver for hp1010
copy:
src: "{{ item }}"
dest: /srv/samba/drivers/hp1010/{{ item }}
owner: root
group: root
mode: 0755
force: false
loop_control:
label: "{{ item }}"
when:
- samba_cups == true
with_items:
- lj1010serieshb-vista64.zip
- lj1010series/
- name: install samba
apt:
state: present
name:
- samba
- smbclient
tags:
- packages
- name: template smb.conf file
template:
src: smb.conf.j2
dest: /etc/samba/smb.conf
owner: root
group: root
mode: 0644
#validate: /usr/bin/testparm -s %s
notify: restart samba
tags:
- smb.conf
- name: disable nmbd
service:
name: nmbd
state: stopped
enabled: false
tags:
- samba-nmbd
- samba smbd
when:
- samba_nmbd == false
- name: smbd service
service:
name: smbd
state: >-
{%- if samba_smbd -%}
started
{%- else -%}
stopped
{%- endif -%}
enabled: >-
{%- if samba_smbd -%}
true
{%- else -%}
false
{%- endif -%}
tags:
- sambda-smbd
- samba-nmbd