92 lines
2.5 KiB
YAML
92 lines
2.5 KiB
YAML
---
|
|
# Title: ansible-role-samba4-ad-member
|
|
#
|
|
# Author: Bitfinity-NL
|
|
# File: tasks/ubt-1804-amd64.yml
|
|
#
|
|
# Description:
|
|
# Samba is the standard Windows interoperability
|
|
# suite of programs for Linux and Unix.
|
|
#
|
|
- name: update hosts file
|
|
become: true
|
|
blockinfile:
|
|
dest: /etc/hosts
|
|
content: "{{ lookup('template', '{{ role_path }}/templates/hosts.j2') }}"
|
|
state: present
|
|
tags: update_hosts
|
|
- name: set hostname
|
|
become: true
|
|
hostname:
|
|
name: '{{ inventory_hostname }}'
|
|
tags: set_hostname
|
|
- name: "IFor OS: Ubuntu 20.04LTS, Arch: amd64"
|
|
import_tasks: ubt-2004-amd64.yml
|
|
when:
|
|
- ansible_distribution_version == "20.04"
|
|
- ansible_architecture == "x86_64"
|
|
|
|
- name: "For OS: Ubuntu 16.04LTS, Arch: amd64"
|
|
import_tasks: ubt-1604-amd64.yml
|
|
when:
|
|
- ansible_distribution_version == "16.04"
|
|
- ansible_architecture == "x86_64"
|
|
|
|
- name: "IFor OS: Ubuntu 18.04LTS, Arch: amd64"
|
|
import_tasks: ubt-1804-amd64.yml
|
|
when:
|
|
- ansible_distribution_version == "18.04"
|
|
- ansible_architecture == "x86_64"
|
|
|
|
- name: "Check that {{ public_share_path }} exist"
|
|
stat:
|
|
path: "{{ public_share_path }}"
|
|
register: public_dir_exists
|
|
|
|
- name: "Create {{ public_share_path }} directory"
|
|
become: yes
|
|
file:
|
|
state: directory
|
|
path: "{{ public_share_path }}"
|
|
owner: nobody
|
|
group: nogroup
|
|
mode: 0755
|
|
recurse: yes
|
|
when: public_dir_exists.stat.exists == False
|
|
|
|
- name: "Check that {{ private_share_path }} exist"
|
|
stat:
|
|
path: "{{ private_share_path }}"
|
|
register: private_dir_exists
|
|
|
|
- name: "Create {{ private_share_path }} directory"
|
|
become: yes
|
|
file:
|
|
state: directory
|
|
path: "{{ private_share_path }}"
|
|
owner: root
|
|
group: "{{ samba_group_name }}"
|
|
mode: 1770
|
|
when: private_dir_exists.stat.exists == False
|
|
- name: set acl's on public share
|
|
ansible.posix.acl:
|
|
path: "{{ public_share_path }}"
|
|
entry: "{{ item.entry }}"
|
|
state: present
|
|
with_items:
|
|
- { entry: "user::rwx" }
|
|
- { entry: "user:nobody:rwx" }
|
|
- { entry: "group::r-x" }
|
|
- { entry: "group:domain\ users:rwx" }
|
|
- { entry: "mask::rwx" }
|
|
- { entry: "other::r-x" }
|
|
- { entry: "default:user::rwx" }
|
|
- { entry: "default:user:administrator:rwx" }
|
|
- { entry: "default:group::r-x" }
|
|
- { entry: "default:group:domain\ users:rwx" }
|
|
- { entry: "default:group:nogroup:r-x" }
|
|
- { entry: "default:mask::rwx" }
|
|
- { entry: "default:other::r-x" }
|
|
|
|
|