Linux technical support - [email protected]


saltstack example manifest

top.sls

base:
    'os:CentOS':
        - match: grain
        - environment.environment
        - repo.repo
        - ssh.ssh
        - sudo.sudo
        - vim.vim

    '^((?!nis-server).)*$ and G@os:CentOS':
        - match: compound
        - apcupsd.apcupsd

    '^web[0-9]+.alexlinux.lan$':
        - match: pcre
        - php.core

    'osfinger:CentOS Linux-7':
        - match: grain
        - latest-centos7.latest-centos7
        - ssh.sshd_sssd

ssh/sshd_sssd.sls

{% if grains['osrelease'] != '7.0.1406' %}
/etc/ssh/sshd_config:
  file:
      - managed
      - source: salt://ssh/files/sshd_sssd_centos_6.conf
      - mode: 600
      - user: root
      - group: root
{% endif %}

{% if grains['osrelease'] == '7.0.1406' %}
/etc/ssh/sshd_config:
  file:
      - managed
      - source: salt://ssh/files/sshd_sssd_centos_7.conf
      - mode: 600
      - user: root
      - group: root
{% endif %}

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>