@@ -50,6 +50,9 @@ include:
5050 - users.sudo
5151{%- endif % }
5252{%- if used_googleauth % }
53+ {%- if grains[' os_family' ] == ' RedHat' % }
54+ - epel
55+ {%- endif % }
5356 - users.googleauth
5457{%- endif % }
5558{%- if used_user_files % }
@@ -506,7 +509,28 @@ users_{{ users.sudoers_dir }}/{{ sudoers_d_filename }}:
506509 - name: {{ users.sudoers_dir }}/ {{ sudoers_d_filename }}
507510{% endif % }
508511
509- {%- if not grains[' os_family' ] in [' RedHat' , ' Suse' ] % }
512+ {%- if grains[' os_family' ] == ' RedHat' % }
513+ policycoreutils- package:
514+ pkg.installed:
515+ - pkgs:
516+ - policycoreutils
517+ {%- if grains[' osmajorrelease' ]| int <= 7 % }
518+ - policycoreutils- python
519+ {%- else % }
520+ - policycoreutils- python- utils
521+ {%- endif % }
522+ users_googleauth_selinux_present:
523+ selinux.fcontext_policy_present:
524+ - name: " {{ users.googleauth_dir }} (/.*)?"
525+ - filetype: ' a'
526+ - sel_user: unconfined_u
527+ - sel_type: ssh_home_t
528+ - sel_level: s0
529+ - require:
530+ - pkg: policycoreutils- package
531+ {%- endif % }
532+
533+ {%- if not grains[' os_family' ] in [' Suse' ] % }
510534{%- if ' google_auth' in user % }
511535{%- for svc in user[' google_auth' ] % }
512536users_googleauth- {{ svc }}- {{ name }}:
@@ -518,11 +542,20 @@ users_googleauth-{{ svc }}-{{ name }}:
518542 - group: {{ users.root_group }}
519543 - mode: ' 0600'
520544 - require:
545+ {%- if grains[' os_family' ] == ' RedHat' % }
546+ - pkg: epel_release
547+ {%- endif % }
521548 - pkg: users_googleauth- package
522549{%- endfor % }
523550{%- endif % }
524551{%- endif % }
525552
553+ {%- if grains[' os_family' ] == ' RedHat' % }
554+ users_googleauth_selinux_applied:
555+ selinux.fcontext_policy_applied:
556+ - name: {{ users.googleauth_dir }}
557+ {%- endif % }
558+
526559# this doesn't work (Salt bug), therefore need to run state.apply twice
527560# include:
528561# - users
0 commit comments