Browse Source

Allow Skipping of service manipulation via pillar (+PR comments)

master
Noel McLoughin 7 years ago
parent
commit
77a7cbf228
2 changed files with 19 additions and 0 deletions
  1. +16
    -0
      apache/init.sls
  2. +3
    -0
      pillar.example

+ 16
- 0
apache/init.sls View File

- name: {{ apache.user }} - name: {{ apache.user }}
- gid: {{ apache.group }} - gid: {{ apache.group }}
- system: True - system: True
{# By default run apache service states (unless pillar is false) #}
{% if salt['pillar.get']('apache:manage_service_states', True) %}
service.running: service.running:
- name: {{ apache.service }} - name: {{ apache.service }}
- enable: True - enable: True
module.wait: module.wait:
- name: service.restart - name: service.restart
- m_name: {{ apache.service }} - m_name: {{ apache.service }}

{% else %}

apache-reload:
test.show_notification:
- name: Skipping reload per user request
- text: Pillar manage_service_states is False

apache-restart:
test.show_notification:
- name: Skipping restart per user request
- text: Pillar manage_service_states is False

{% endif %}

+ 3
- 0
pillar.example View File

# ``apache`` formula configuration: # ``apache`` formula configuration:
apache: apache:


# By default apache restart/reload states run (false skips)
manage_service_states: True

# lookup section overrides ``map.jinja`` values # lookup section overrides ``map.jinja`` values
lookup: lookup:
server: apache2 server: apache2

Loading…
Cancel
Save