2016-03-14 02:00:12 +01:00
|
|
|
---
|
2016-07-10 05:07:44 +02:00
|
|
|
|
2016-03-14 02:00:12 +01:00
|
|
|
# SAMBA and ibays
|
|
|
|
|
|
|
|
- name: Installing SAMBA and ibays packages
|
|
|
|
yum:
|
2018-11-11 05:59:13 +01:00
|
|
|
name:
|
|
|
|
- "@nethserver-file-server"
|
|
|
|
- nethserver-samba-audit
|
2016-03-14 02:00:12 +01:00
|
|
|
state: present
|
|
|
|
|
|
|
|
# SAMBA
|
|
|
|
|
2018-11-28 00:40:50 +01:00
|
|
|
- name: Checking for default SAMBA behaviour
|
|
|
|
shell: /sbin/e-smith/db configuration getprop smb HomeAdmStatus
|
|
|
|
register: check_smbbehavior
|
|
|
|
changed_when: "'enabled' not in check_smbbehavior"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Configuring standard SAMBA behaviour on shared folders
|
|
|
|
shell: /sbin/e-smith/db configuration setprop smb HomeAdmStatus enabled InheritOwner yes ShareAdmStatus enabled
|
|
|
|
when: check_smbbehavior|changed
|
|
|
|
|
|
|
|
- name: Activating default SAMBA behaviour
|
|
|
|
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
|
|
|
when: check_smbbehavior|changed
|
|
|
|
|
2017-01-12 23:33:48 +01:00
|
|
|
- name: "Create directory structure for templates-custom"
|
|
|
|
file:
|
2017-10-25 00:03:10 +02:00
|
|
|
path: "/etc/e-smith/templates-custom/etc/samba/smb.conf"
|
2017-01-12 23:33:48 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
2018-11-28 00:40:50 +01:00
|
|
|
register: check_tempcust
|
2017-01-12 23:33:48 +01:00
|
|
|
|
|
|
|
- name: "Copying settings from default."
|
|
|
|
copy:
|
|
|
|
src: /etc/e-smith/templates/etc/samba/smb.conf/10global
|
|
|
|
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
|
|
|
remote_src: true
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2017-01-17 22:53:43 +01:00
|
|
|
when: check_tempcust|changed
|
2017-01-12 23:33:48 +01:00
|
|
|
|
2016-03-14 02:00:12 +01:00
|
|
|
- name: "Enabling unix extensions on SAMBA"
|
2016-07-10 05:07:44 +02:00
|
|
|
lineinfile:
|
2017-01-12 23:33:48 +01:00
|
|
|
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
2018-11-11 05:59:13 +01:00
|
|
|
line: 'unix extensions = yes'
|
2016-07-10 05:07:44 +02:00
|
|
|
state: present
|
2018-11-11 05:59:13 +01:00
|
|
|
insertafter: EOF
|
2017-01-17 22:53:43 +01:00
|
|
|
when: check_tempcust|changed
|
|
|
|
|
2018-11-28 00:40:50 +01:00
|
|
|
- name: Adding server signing as mandatory
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
|
|
|
line: "server signing = mandatory"
|
|
|
|
state: present
|
|
|
|
insertafter: EOF
|
|
|
|
when: check_tempcust|changed
|
2018-11-11 05:59:13 +01:00
|
|
|
|
2018-11-28 00:40:50 +01:00
|
|
|
- name: Applying custom configurations to running SAMBA
|
|
|
|
shell: /sbin/e-smith/signal-event nethserver-samba-save
|
|
|
|
become: yes
|
|
|
|
when: check_tempcust|changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
# ibays
|
|
|
|
|
|
|
|
- name: Checking for shared ibay
|
|
|
|
shell: /sbin/e-smith/db accounts show shared
|
|
|
|
ignore_errors: true
|
|
|
|
register: chk_shared
|
|
|
|
|
2018-11-11 05:59:13 +01:00
|
|
|
#- name: Copying default templates for shared template type
|
|
|
|
# shell: cp -r /etc/e-smith/templates/etc/samba/smb.conf/ibay-default /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed
|
|
|
|
#
|
|
|
|
#- name: Configuring ibay-shared template structure (directory mask)
|
|
|
|
# lineinfile:
|
|
|
|
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
|
|
|
# line: 'directory mask = 0775'
|
|
|
|
# insertafter: '^create mask'
|
|
|
|
# state: present
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed
|
|
|
|
#
|
|
|
|
#- name: Configuring force create mode
|
|
|
|
# lineinfile:
|
|
|
|
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
|
|
|
# line: 'force create mode = 0664'
|
|
|
|
# insertafter: '^directory mask'
|
|
|
|
# state: present
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed
|
|
|
|
#
|
|
|
|
#- name: Configuring force directory mode
|
|
|
|
# lineinfile:
|
|
|
|
# dest: /etc/e-smith/templates/etc/samba/smb.conf/ibay-shared/20profile_default
|
|
|
|
# line: 'force directory mode = 0775'
|
|
|
|
# insertafter: '^force create mode'
|
|
|
|
# state: present
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Configuring shared ibay
|
2018-11-28 00:40:50 +01:00
|
|
|
shell: /sbin/e-smith/db accounts set shared ibay AclRead "" AclWrite "" Description "Cartella condivisa" GroupAccess rw OtherAccess "" OwningGroup "domain users@{{ ansible_local.domain.domainfull }}" SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus enabled SmbShareBrowseable enabled
|
2016-03-14 02:00:12 +01:00
|
|
|
when: chk_shared|failed
|
|
|
|
|
|
|
|
- name: Activating shared ibay
|
|
|
|
shell: /sbin/e-smith/signal-event ibay-create shared
|
|
|
|
become: yes
|
|
|
|
when: chk_shared|failed
|
|
|
|
|
2018-11-11 05:59:13 +01:00
|
|
|
#- name: Changing ibay profile for shared
|
|
|
|
# shell: /sbin/e-smith/db accounts setprop shared SmbProfileType shared
|
|
|
|
# become: yes
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed
|
|
|
|
|
|
|
|
#- name: Forcing regeneration of smb.conf
|
|
|
|
# shell: /sbin/e-smith/signal-event nethserver-samba-update
|
|
|
|
# become: yes
|
|
|
|
# when: force_ibay_shared|bool or chk_shared|failed or check_tempcust|changed
|
2016-11-08 22:11:06 +01:00
|
|
|
|
|
|
|
# Fixing issue #3 - Configure sudo access for admin on server for operator
|
2017-02-21 23:00:58 +01:00
|
|
|
# access
|
2016-11-08 22:11:06 +01:00
|
|
|
# https://github.com/bglug-it/server-config/issues/3
|
|
|
|
- name: Configuring sudo access for admin account
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/sudoers.d/admin
|
2018-11-11 05:59:13 +01:00
|
|
|
line: 'admin@{{ ansible_local.domain.domainfull }} ALL=(ALL) NOPASSWD: ALL'
|
2016-11-08 22:11:06 +01:00
|
|
|
create: yes
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0440
|
|
|
|
validate: 'visudo -cf %s'
|