update forkpull/206/head
@@ -11,13 +11,6 @@ | |||
{%- if group.enabled %} | |||
{%- set requires = [] %} | |||
{%- for user in group.get('addusers', []) %} | |||
{%- if user in system.get('user', {}).keys() %} | |||
{%- do requires.append({'user': 'system_user_'+user}) %} | |||
{%- endif %} | |||
{%- endfor %} | |||
system_group_{{ group_name }}: | |||
group.present: | |||
- name: {{ group.get('name', group_name) }} | |||
@@ -27,10 +20,19 @@ system_group_{{ group_name }}: | |||
{%- if group.gid is defined and group.gid %} | |||
- gid: {{ group.gid }} | |||
{%- endif %} | |||
{%- if group.members is defined %} | |||
- members: {{ group.members|json }} | |||
{%- else %} | |||
{%- set requires = [] %} | |||
{%- for user in group.get('addusers', []) %} | |||
{%- if user in system.get('user', {}).keys() %} | |||
{%- do requires.append({'user': 'system_user_'+user}) %} | |||
{%- endif %} | |||
{%- endfor %} | |||
- require: {{ requires|yaml }} | |||
{{ set_p('addusers', group)|indent(2, True) }} | |||
{{ set_p('delusers', group)|indent(2, True) }} | |||
{% endif %} | |||
{%- else %} | |||
system_group_{{ group_name }}: |
@@ -1,18 +1,38 @@ | |||
{%- from "linux/map.jinja" import system with context %} | |||
{%- if system.selinux is defined %} | |||
{%- if system.enabled %} | |||
include: | |||
- linux.system.repo | |||
{%- if grains.os_family == 'RedHat' %} | |||
{%- set mode = system.selinux %} | |||
{%- if system.selinux == 'disabled' %} | |||
{{ mode }}: | |||
selinux_config: | |||
cmd.run: | |||
- names: | |||
- "sed -i 's/enforcing/disabled/g' /etc/selinux/config" | |||
- "sed -i 's/permissive/disabled/g' /etc/selinux/config" | |||
- unless: cat '/etc/selinux/config' | grep 'SELINUX=disabled' | |||
selinux_setenforce: | |||
cmd.run: | |||
- name: "setenforce 0" | |||
- unless: getenforce | grep 'Disabled' | |||
{%- else %} | |||
selinux_config: | |||
selinux.mode: | |||
- name: {{ system.get('selinux', 'permissive') }} | |||
- require: | |||
- pkg: linux_repo_prereq_pkgs | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} | |||
{%- endif %} |
@@ -79,6 +79,9 @@ system_user_{{ name }}: | |||
- inactdays: {{ user.inactdays }} | |||
{%- endif %} | |||
- require: {{ requires|yaml }} | |||
{%- if user.allow_uid_change is defined and user.allow_uid_change %} | |||
- allow_uid_change: true | |||
{%- endif %} | |||
system_user_home_{{ user.home }}: | |||
file.directory: |