145 lines
4.7 KiB
YAML
Raw Normal View History

---
# SAMBA and ibays
- name: Installing SAMBA and ibays packages
yum:
name:
- "@nethserver-file-server"
- nethserver-samba-audit
state: present
# SAMBA
2017-01-12 23:33:48 +01:00
- name: "Create directory structure for templates-custom"
file:
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
when: check_tempcust|changed
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
when: check_tempcust|changed
2017-01-12 23:33:48 +01:00
- name: "Enabling unix extensions on SAMBA"
lineinfile:
2017-01-12 23:33:48 +01:00
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
line: 'unix extensions = yes'
state: present
insertafter: EOF
when: check_tempcust|changed
#- name: Adding server signing as mandatory
# lineinfile:
# dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
# line: "server signing = mandatory"
# insertafter: "^workgroup = "
# state: present
# when: check_tempcust|changed
#- name: Checking SMB configuration
# shell: /sbin/e-smith/db configuration printprop smb RoamingProfiles
# register: chk_smb
# changed_when: "'RoamingProfiles=yes' not in chk_smb.stdout"
# 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
#- 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
shell: /sbin/e-smith/db accounts show shared
ignore_errors: true
register: chk_shared
#- 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
- 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
when: chk_shared|failed
- name: Activating shared ibay
shell: /sbin/e-smith/signal-event ibay-create shared
become: yes
when: chk_shared|failed
#- 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: 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
# 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
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'