Skip to content

Commit

Permalink
This is fix for salt-formulas#182 - Dependency problem in linux/syste…
Browse files Browse the repository at this point in the history
…m/selinux.sls.

- This change will remove dependecy from linux/system/repo.sls in linux/system/selinux.sls.
- It also change structure from pillars selinux

old:
linux:
  system:
    ...
    selinux: permissive

new:
linux:
  system:
    ...
    selinux:
      pkgs: ['policycoreutils', 'policycoreutils-python'],
      mode: permissive
  • Loading branch information
Nick Metz authored and Nick Metz committed Nov 21, 2018
1 parent 122b9dc commit 9d259d4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
20 changes: 15 additions & 5 deletions linux/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
'package': {},
'autoupdates': {
'pkgs': []
},
'selinux': 'permissive',
},
'selinux': {
'pkgs': [],
'mode': 'permissive',
},
'ca_certs_dir': '/usr/local/share/ca-certificates',
'ca_certs_bin': 'update-ca-certificates',
'atop': {
Expand All @@ -25,7 +28,7 @@
'autostart': true,
'logpath': '/var/log/atop',
'outfile': '/var/log/atop/daily.log'
},
},
'at': {
'pkgs': [],
'services': []
Expand All @@ -52,7 +55,10 @@
'autoupdates': {
'pkgs': ['unattended-upgrades']
},
'selinux': 'permissive',
'selinux': {
'pkgs': [],
'mode': 'permissive',
},
'ca_certs_dir': '/usr/local/share/ca-certificates',
'ca_certs_bin': 'update-ca-certificates',
'atop': {
Expand Down Expand Up @@ -90,7 +96,10 @@
'autoupdates': {
'pkgs': []
},
'selinux': 'permissive',
'selinux': {
'pkgs': ['policycoreutils','policycoreutils-python'],
'mode': 'permissive',
},
'ca_certs_dir': '/etc/pki/ca-trust/source/anchors',
'ca_certs_bin': 'update-ca-trust extract',
'atop': {
Expand Down Expand Up @@ -381,6 +390,7 @@ Debian:
'pkgs': [],
'service': 'multipath'
},
'lvm_pkgs': ['lvm2'],
},
}, merge=salt['grains.filter_by']({
'trusty': {
Expand Down
17 changes: 9 additions & 8 deletions linux/system/selinux.sls
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.selinux is defined %}
include:
- linux.system.repo
{% if system.selinux.pkgs %}
linux_system_selinux_pkgs:
pkg.installed:
- pkgs: {{ system.selinux.pkgs }}
{%- endif %}
{%- if grains.os_family == 'RedHat' %}
{%- set mode = system.selinux %}
{%- if grains.os_family == 'RedHat' %}
{{ mode }}:
{{ system.selinux.mode }}:
selinux.mode:
- require:
- pkg: linux_repo_prereq_pkgs
{%- endif %}
- pkg: linux_system_selinux_pkgs
{%- endif %}
{%- endif %}

0 comments on commit 9d259d4

Please sign in to comment.