Ansible_workstation/roles/samba_server/tasks/main.yml

33 lines
701 B
YAML

---
# tasks file for nfs_server
- name: Install os-specific packages
include_tasks: "{{ ansible_os_family | lower }}.yml"
- name: Ensure directories to export exist
file:
path: "{{ item.path }}"
state: directory
with_items: "{{ samba_exports }}"
- name: Include smb_share.conf
lineinfile:
dest: /etc/samba/smb.conf
backup: yes
line: "include = /etc/samba/smb_share.conf"
- name: Copy exports file.
template:
src: smb_share.conf.j2
dest: /etc/samba/smb_share.conf
owner: root
group: root
mode: 0644
notify: restart smbd
- name: Ensure samba is running.
service:
name: smbd
state: started
enabled: yes
when: samba_exports|length