Skip to content

Commit

Permalink
samba server
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinbui committed Oct 28, 2020
1 parent 9365c30 commit 01ba996
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions smb.yml
@@ -0,0 +1,44 @@
---

- hosts: homelab
become: true
pre_tasks:
- name: Update apt cache
apt:
update_cache: true
cache_valid_time: 600
changed_when: false
when: ansible_distribution == 'Ubuntu'
handlers:
- name: "Restart Samba"
service:
name: samba
state: restarted
tasks:
- name: "Install Samba"
apt:
name: samba
state: present
- name: "Enable Samba service"
service:
name: smbd
state: started
enabled: true
- name: "Configure Samba"
copy:
content: |
[files]
comment = ZFS - files
path = {{ common_directory_storage }}
read only = no
browseable = yes
dest: /etc/samba/smb.conf
validate: "testparm --suppress-prompt"
notify: Restart Samba
- name: "Allow Samba in firewall"
ufw:
name: samba
rule: allow
- name: "Reminder"
debug:
msg: Create an smb password using `sudo smbpasswd calvin`

0 comments on commit 01ba996

Please sign in to comment.