diff options
author | Egor Tensin <egor@tensin.name> | 2024-12-17 02:21:03 +0100 |
---|---|---|
committer | Egor Tensin <egor@tensin.name> | 2024-12-17 04:19:53 +0100 |
commit | 61401c36051f7b097f80a22de6d6d84cc78b69ad (patch) | |
tree | f8996b155fcd6a614bb6586f5e4a42e61ec45d12 /roles/samba/tasks | |
parent | v4.0.2 (diff) | |
download | infra-ansible-61401c36051f7b097f80a22de6d6d84cc78b69ad.tar.gz infra-ansible-61401c36051f7b097f80a22de6d6d84cc78b69ad.zip |
add samba role
Diffstat (limited to '')
-rw-r--r-- | roles/samba/tasks/main.yml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/roles/samba/tasks/main.yml b/roles/samba/tasks/main.yml new file mode 100644 index 0000000..97aff98 --- /dev/null +++ b/roles/samba/tasks/main.yml @@ -0,0 +1,49 @@ +- name: Install Samba + become: true + ansible.builtin.package: + name: samba + state: present + +- name: Create /etc/samba + become: true + ansible.builtin.file: + path: /etc/samba + state: directory + owner: root + group: root + mode: '755' + +- name: Format smb.conf + become: true + ansible.builtin.template: + src: smb.conf.j2 + dest: /etc/samba/smb.conf + owner: root + group: root + mode: '644' + validate: '/usr/bin/testparm --suppress-prompt %s' + notify: samba_configured + +- name: Enable & start Samba + become: true + ansible.builtin.systemd_service: + name: smbd + enabled: true + state: started + +- name: Restart Samba service if necessary + ansible.builtin.meta: flush_handlers + +# Enable network discovery on Windows. +- name: Install wsdd + become: true + ansible.builtin.package: + name: wsdd + state: present + +- name: Enable & start wsdd + become: true + ansible.builtin.systemd_service: + name: wsdd + enabled: true + state: started |