2022-02-21 11:02:02 +01:00
|
|
|
{#- -*- coding: utf-8 -*- #}
|
|
|
|
{#- vim: ft=jinja #}
|
2020-07-31 10:54:40 +02:00
|
|
|
|
|
|
|
{#- 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 opts_cli == 'salt-call' %}
|
|
|
|
{%- set cli = 'ssh' if opts_masteropts_cli in ('salt-ssh', 'salt-master') else 'local' %}
|
2022-02-03 14:08:37 +01:00
|
|
|
{%- elif opts_cli %}
|
|
|
|
{%- set cli = 'api' %}
|
2020-07-31 10:54:40 +02:00
|
|
|
{%- else %}
|
|
|
|
{%- set cli = 'unknown' %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- do salt['log.debug']('[libsaltcli] the salt command type has been identified to be: ' ~ cli) %}
|