Add tags to every main task
fixed aya01s fstab with new raid added samba to aya01 Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
12
roles/samba/tasks/config.yaml
Normal file
12
roles/samba/tasks/config.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: Copy "{{ smb_config }}"
|
||||
template:
|
||||
src: "{{ smb_config }}"
|
||||
dest: /etc/samba/smb.conf
|
||||
become: true
|
||||
|
||||
- name: Restart nmbd.service
|
||||
systemd:
|
||||
name: nmbd
|
||||
state: restarted
|
||||
become: true
|
||||
41
roles/samba/tasks/install.yaml
Normal file
41
roles/samba/tasks/install.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
- name: Update and upgrade packages
|
||||
apt:
|
||||
update_cache: true
|
||||
upgrade: true
|
||||
autoremove: true
|
||||
become: true
|
||||
|
||||
- name: Install Samba dependencies
|
||||
apt:
|
||||
name: "{{ smb_deps }}"
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Add group "{{smb_group}}"
|
||||
group:
|
||||
name: "{{smb_group}}"
|
||||
state: present
|
||||
become: true
|
||||
|
||||
- name: Change permission on share
|
||||
file:
|
||||
path: "{{ smb_media_dir }}"
|
||||
group: "{{smb_group}}"
|
||||
mode: "2770"
|
||||
become: true
|
||||
|
||||
- name: Add user "{{ smb_user }}"
|
||||
user:
|
||||
name: "{{ smb_user }}"
|
||||
shell: "/sbin/nologin"
|
||||
groups: "{{ smb_group }}"
|
||||
append: true
|
||||
become: true
|
||||
|
||||
- name: Add password to "{{ smb_user }}"
|
||||
shell:
|
||||
cmd: smbpasswd -a "{{ smb_user }}"
|
||||
stdin: "{{ vault_smb_user_password }}\n{{ vault_smb_user_password }}"
|
||||
become: true
|
||||
|
||||
3
roles/samba/tasks/main.yaml
Normal file
3
roles/samba/tasks/main.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- include_tasks: install.yaml
|
||||
- include_tasks: config.yaml
|
||||
Reference in New Issue
Block a user