Skip to content

Commit

Permalink
feat(cron.env): add env option in cron-formula
Browse files Browse the repository at this point in the history
  • Loading branch information
genaumann committed Nov 3, 2019
1 parent f9c61a9 commit 12cee12
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cron/config/file.sls
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,16 @@ cron.{{ task }}:
{%- endif %}
{%- endfor %}
{%- for env, env_options in cron.get('env', {}). items() %}
{%- set env_type = env_options.type|d('present') %}
cron.{{ env }}:
cron.env_{{ env_type }}:
- name: {{ env_options.name }}
{%- if env_type == 'present' %}
- value: {{ env_options.value }}
{%- endif %}
- user: {{ env_options.user|d('root') }}
{%- endfor %}
16 changes: 16 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ cron:
minute: '*/5'
hour: '*'
comment: comment4
env:
env1:
type: present # Default
name: PATH
value: /usr/local/bin:/usr/bin:/bin:/usr/games
user: root # Default
env2:
type: absent
name: MAILTO
value: [email protected] # not needed
user: root # Default
env3:
type: absent
name: LANG
value: en_GB.UTF-8
user: root

0 comments on commit 12cee12

Please sign in to comment.