Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c117f65009bf07346786 to your computer and use it in GitHub Desktop.
Save anonymous/c117f65009bf07346786 to your computer and use it in GitHub Desktop.
[root@salt salt]# cat cssd.sls
{% if grains["os"] == "RedHat" and grains["osmajorrelease"] == "6" %}
/etc/sysconfig/network:
file.managed:
- name: /etc/sysconfig/network
- user: root
- group: root
- mode: 644
- makedirs: True
file.append:
- text:
- "NETWORKING_IPv6=\"no\""
{% endif %}
[root@salt salt]#
[root@salt salt]#
[root@salt salt]#
[root@salt salt]# salt nagios.sam.example.edu state.sls cssd
nagios.sam.example.edu:
Data failed to compile:
----------
ID '/etc/sysconfig/network' in SLS 'cssd' contains multiple state declarations of the same type
@gravyboat
Copy link

{% if grains["os"] == "RedHat" and grains["osmajorrelease"] == "6" %}

manage_sysconfig_network:
  file.managed:
    - name: /etc/sysconfig/network
    - user: root
    - group: root
    - mode: 644
    - makedirs: True

update_sysconfig_network:
  file.append:
    - name: /etc/sysconfig/network
    - text:
      - "NETWORKING_IPv6=\"no\""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment