mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Added support for hiding in templates for autofs
This commit is contained in:
parent
dda3ca452b
commit
bb0beb4a92
@ -133,9 +133,9 @@ class cifs_applier_user(applier_frontend):
|
||||
|
||||
self.home = get_homedir(username)
|
||||
conf_file = '{}.conf'.format(sid)
|
||||
conf_hide_file = '{}.conf'.format(sid)
|
||||
conf_hide_file = '{}_hide.conf'.format(sid)
|
||||
autofs_file = '{}.autofs'.format(sid)
|
||||
autofs_hide_file = '{}.autofs'.format(sid)
|
||||
autofs_hide_file = '{}_hide.autofs'.format(sid)
|
||||
cred_file = '{}.creds'.format(sid)
|
||||
|
||||
self.auto_master_d = Path(self.__auto_dir)
|
||||
@ -235,7 +235,7 @@ class cifs_applier_user(applier_frontend):
|
||||
f.flush()
|
||||
|
||||
autofs_settings['mount_file'] = self.user_config_hide.resolve()
|
||||
autofs_text = self.template_auto.render(**autofs_settings)
|
||||
autofs_text = self.template_auto_hide.render(**autofs_settings)
|
||||
with open(self.user_autofs_hide.resolve(), 'w') as f:
|
||||
f.truncate()
|
||||
f.write(autofs_text)
|
||||
|
20
gpoa/templates/autofs_auto_hide.j2
Normal file
20
gpoa/templates/autofs_auto_hide.j2
Normal file
@ -0,0 +1,20 @@
|
||||
{#
|
||||
# GPOA - GPO Applier for Linux
|
||||
#
|
||||
# Copyright (C) 2019-2022 BaseALT Ltd.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
{{ home_dir }}/.net {{ mount_file }} -t 120
|
||||
|
@ -17,7 +17,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
{%- for drv in drives %}
|
||||
{% if (drv.action == 'C' or drv.action == 'U' or drv.action == 'R') %}
|
||||
{% if (drv.thisDrive != 'HIDE') %}
|
||||
{{ drv.dir }} -fstype=cifs,cruid=$USER,sec=krb5,noperm :{{ drv.path }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
23
gpoa/templates/autofs_mountpoints_hide.j2
Normal file
23
gpoa/templates/autofs_mountpoints_hide.j2
Normal file
@ -0,0 +1,23 @@
|
||||
{#
|
||||
# GPOA - GPO Applier for Linux
|
||||
#
|
||||
# Copyright (C) 2019-2022 BaseALT Ltd.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
{%- for drv in drives %}
|
||||
{% if (drv.thisDrive == 'HIDE') %}
|
||||
{{ drv.dir }} -fstype=cifs,cruid=$USER,sec=krb5,noperm :{{ drv.path }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user