Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(master): enable option to set master scheduler #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ salt:
type: runner
cmd: jobs.list_jobs

# Define a master scheduler
schedule:
- update_winrepo:
- function: winrepo.update_git_repos
- hours: 6
Comment on lines +163 to +164
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# optional: these reactors will be configured on the master
# They override reactors configured in
# 'salt:reactors' or the old 'salt:reactor' parameters
Expand Down
19 changes: 19 additions & 0 deletions salt/files/master.d/f_defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ module_dirs:
# job cache and executes the scheduler.
{{ get_config('loop_interval', '60') }}

# When using the scheduler at least one schedule needs to be
# defined. The user running the salt master will need read access to the repo.
{% if 'schedule' in cfg_master -%}
{%- do default_keys.append('schedule') %}
schedule:
{%- for schedule in cfg_master['schedule'] %}
{%- if schedule is iterable and schedule is not string %}
{%- for name, children in schedule.items() %}
{{ name }}:
{%- for child in children %}
{%- for key, value in child.items() %}
{{ key }}: {{ value }}
{%- endfor -%}
{%- endfor -%}
Comment on lines +136 to +140
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this for loop should be indented?

{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endif %}

# Set the default outputter used by the salt command. The default is "nested".
{{ get_config('output', 'nested') }}

Expand Down