Checking the permissions and other stuff on SAMBA setup.

This commit is contained in:
Emiliano Vavassori 2018-11-28 00:40:50 +01:00
parent c8bba8f0a0
commit b411d4d96c

View File

@ -11,6 +11,20 @@
# SAMBA # SAMBA
- 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
- name: "Create directory structure for templates-custom" - name: "Create directory structure for templates-custom"
file: file:
path: "/etc/e-smith/templates-custom/etc/samba/smb.conf" path: "/etc/e-smith/templates-custom/etc/samba/smb.conf"
@ -18,7 +32,7 @@
group: root group: root
mode: 0755 mode: 0755
state: directory state: directory
when: check_tempcust|changed register: check_tempcust
- name: "Copying settings from default." - name: "Copying settings from default."
copy: copy:
@ -38,41 +52,21 @@
insertafter: EOF insertafter: EOF
when: check_tempcust|changed when: check_tempcust|changed
#- name: Adding server signing as mandatory - name: Adding server signing as mandatory
# lineinfile: lineinfile:
# dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
# line: "server signing = mandatory" line: "server signing = mandatory"
# insertafter: "^workgroup = " state: present
# state: present insertafter: EOF
# when: check_tempcust|changed when: check_tempcust|changed
#- name: Checking SMB configuration - name: Applying custom configurations to running SAMBA
# shell: /sbin/e-smith/db configuration printprop smb RoamingProfiles shell: /sbin/e-smith/signal-event nethserver-samba-save
# register: chk_smb become: yes
# changed_when: "'RoamingProfiles=yes' not in chk_smb.stdout" when: check_tempcust|changed
# ignore_errors: true
#- name: Configuring SMB
# shell: /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup "{{ ansible_local.domain.domainshort }}" status enabled
# when: chk_smb|changed
#
#- name: Activating SMB
# shell: /sbin/e-smith/signal-event nethserver-samba-save
# when: chk_smb|changed
# ibays # ibays
#- name: Enabling SMB services restart when managing ibays
# file:
# src: reload
# dest: "{{ item }}/smb"
# state: link
# force: yes
# with_items:
# - /etc/e-smith/events/ibay-delete/services2adjust
# - /etc/e-smith/events/ibay-create/services2adjust
# - /etc/e-smith/events/ibay-modify/services2adjust
- name: Checking for shared ibay - name: Checking for shared ibay
shell: /sbin/e-smith/db accounts show shared shell: /sbin/e-smith/db accounts show shared
ignore_errors: true ignore_errors: true
@ -107,7 +101,7 @@
# when: force_ibay_shared|bool or chk_shared|failed # when: force_ibay_shared|bool or chk_shared|failed
- name: Configuring shared ibay - name: Configuring shared ibay
shell: /sbin/e-smith/db accounts set shared ibay AclRead "domain users@{{ ansible_local.domain.domainfull }}" AclWrite "domain users@{{ ansible_local.domain.domainfull }}" Description "Cartella condivisa" GroupAccess rw OtherAccess "" OwningGroup "domain admins@{{ ansible_local.domain.domainfull }}" SmbAuditStatus enabled SmbGuestAccessType none SmbRecycleBinStatus enabled SmbRecycleBinVersionsStatus enabled SmbShareBrowseable enabled 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
when: chk_shared|failed when: chk_shared|failed
- name: Activating shared ibay - name: Activating shared ibay
@ -119,11 +113,6 @@
# shell: /sbin/e-smith/db accounts setprop shared SmbProfileType shared # shell: /sbin/e-smith/db accounts setprop shared SmbProfileType shared
# become: yes # become: yes
# when: force_ibay_shared|bool or chk_shared|failed # when: force_ibay_shared|bool or chk_shared|failed
#
#- name: Saving new version of smb.conf
# shell: /sbin/e-smith/signal-event nethserver-samba-save
# become: yes
# when: check_tempcust|changed
#- name: Forcing regeneration of smb.conf #- name: Forcing regeneration of smb.conf
# shell: /sbin/e-smith/signal-event nethserver-samba-update # shell: /sbin/e-smith/signal-event nethserver-samba-update