mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
refactor(libsaltcli): use the opts
dict throughout [skip ci]
* Automated using https://github.com/myii/ssf-formula/pull/139
This commit is contained in:
parent
1aa8458928
commit
69b632fbe6
1 changed files with 8 additions and 8 deletions
|
@ -1,15 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=jinja
|
||||
|
||||
{#- Determine the type of command being run #}
|
||||
{%- if salt['config.get']('__cli') == 'salt-minion' %}
|
||||
{#- Get the relevant values from the `opts` dict #}
|
||||
{%- set opts_cli = opts.get('__cli', '') %}
|
||||
{%- set opts_masteropts_cli = opts | traverse('__master_opts__:__cli', '') %}
|
||||
|
||||
{#- Determine the type of salt command being run #}
|
||||
{%- if opts_cli == 'salt-minion' %}
|
||||
{%- set cli = 'minion' %}
|
||||
{%- elif salt['config.get']('__cli') == 'salt-call' %}
|
||||
{%- if salt['config.get']('root_dir').endswith('/running_data') %}
|
||||
{%- set cli = 'ssh' %}
|
||||
{%- else %}
|
||||
{%- set cli = 'local' %}
|
||||
{%- endif %}
|
||||
{%- elif opts_cli == 'salt-call' %}
|
||||
{%- set cli = 'ssh' if opts_masteropts_cli == 'salt-ssh' else 'local' %}
|
||||
{%- else %}
|
||||
{%- set cli = 'unknown' %}
|
||||
{%- endif %}
|
||||
|
|
Loading…
Add table
Reference in a new issue