forked from LibreSchool/server-config
Much more idempotenced fixes for issue 10.
This commit is contained in:
parent
df515691a3
commit
5a6c50a870
@ -13,22 +13,20 @@
|
|||||||
|
|
||||||
# SAMBA
|
# SAMBA
|
||||||
|
|
||||||
- name: Checking SMB configuration
|
- name: "Verifying modifications on templates-custom."
|
||||||
shell: /sbin/e-smith/db configuration printprop smb RoamingProfiles
|
shell: grep -q 'server signing = mandatory' /etc/e-smith/templates-custom/etc/templates-custom/etc/samba/smb.conf/10global
|
||||||
register: chk_smb
|
register: check_tempcust
|
||||||
changed_when: "'RoamingProfiles=yes' not in chk_smb.stdout"
|
changed_when: check_tempcust.rc != 0
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: "Create directory structure for templates-custom"
|
- name: "Create directory structure for templates-custom"
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "/etc/e-smith/templates-custom/etc/samba/smb.conf"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
with_items:
|
when: check_tempcust|changed
|
||||||
- /etc/e-smith/templates-custom/etc/samba/smb.conf
|
|
||||||
- /etc/e-smith/templates-custom/etc/samba/smb.conf
|
|
||||||
|
|
||||||
- name: "Copying settings from default."
|
- name: "Copying settings from default."
|
||||||
copy:
|
copy:
|
||||||
@ -38,12 +36,14 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
when: check_tempcust|changed
|
||||||
|
|
||||||
- name: "Enabling unix extensions on SAMBA"
|
- name: "Enabling unix extensions on SAMBA"
|
||||||
replace:
|
replace:
|
||||||
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
dest: /etc/e-smith/templates-custom/etc/samba/smb.conf/10global
|
||||||
regexp: '^unix extensions = no$'
|
regexp: '^unix extensions = no$'
|
||||||
replace: 'unix extensions = yes'
|
replace: 'unix extensions = yes'
|
||||||
|
when: check_tempcust|changed
|
||||||
|
|
||||||
- name: Adding server signing as mandatory
|
- name: Adding server signing as mandatory
|
||||||
lineinfile:
|
lineinfile:
|
||||||
@ -51,6 +51,13 @@
|
|||||||
line: "server signing = mandatory"
|
line: "server signing = mandatory"
|
||||||
insertafter: "^workgroup = "
|
insertafter: "^workgroup = "
|
||||||
state: present
|
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
|
- name: Configuring SMB
|
||||||
shell: /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup "{{ ansible_local.domain.domainshort }}" status enabled
|
shell: /sbin/e-smith/db configuration setprop smb RoamingProfiles yes ServerRole PDC Workgroup "{{ ansible_local.domain.domainshort }}" status enabled
|
||||||
@ -120,10 +127,15 @@
|
|||||||
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
|
||||||
become: yes
|
become: yes
|
||||||
when: force_ibay_shared|bool or chk_shared|failed
|
when: force_ibay_shared|bool or chk_shared|failed or check_tempcust|changed
|
||||||
|
|
||||||
# Fixing issue #3 - Configure sudo access for admin on server for operator
|
# Fixing issue #3 - Configure sudo access for admin on server for operator
|
||||||
# access
|
# access
|
||||||
|
Loading…
x
Reference in New Issue
Block a user