-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-samba.yaml
41 lines (36 loc) · 987 Bytes
/
install-samba.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: setup samba
hosts: samba
become: true
tasks:
- name: create directory
file:
path: /home/ubuntu/share01
state: directory
mode: '2770'
- name: samba install
ansible.builtin.apt:
name: samba
update_cache: true
state: latest
- name: change permissions of share01 directory
file:
path: /home/ubuntu/share01
owner: "ubuntu"
group: "sambashare"
- name: set smbpasswd
shell: "printf 'ubuntu\nubuntu\n' | smbpasswd -a ubuntu"
- name: adding lines to smb.conf
ansible.builtin.blockinfile:
path: /etc/samba/smb.conf
block: |
[share01]
comment = Samba share directory
path = /home/ubuntu/share01
read only = no
writable = yes
browseable = yes
guest ok = no
valid users = @ubuntu
- name: enable smbd service
command: systemctl enable --now smbd