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:
TuDatTr
2022-12-27 21:51:41 +01:00
parent 1fdeaf2ded
commit 9851a25ea6
7 changed files with 312 additions and 6 deletions

View 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

View 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

View File

@@ -0,0 +1,3 @@
---
- include_tasks: install.yaml
- include_tasks: config.yaml