There is no 'names' arg for cmd.run. Change to 'name':
...
output:
cmd.run:
- name: echo "Rollback directory {{ app_name }}"
- cwd: /root
...
error_output:
cmd.run:
- name: "This is the last directory. Can't remove {{ app_name }}"
- cwd: /root
...
--
Dave
On 2/26/14, 6:57 AM, Vlad wrote:
> I have tried different approaches, with {{ app_name }} and 'app_name'
> ....
> not working example:
>
> test.sls
> {% set app_name = 'ad-center-tools' %}
> {% if salt['cmd.run']("ls -lt /home/app_name-user/app_name
> 2>/dev/null| wc -l") != "0" %}
>
> output:
> cmd.run:
> - names:
> - echo "Rollback directory {{ app_name }}"
> - cwd: /root
>
> {% else %}
>
> error_output:
> cmd.run:
> - names:
> - echo "This is the last directory. Can't remove {{ app_name }}"
> - cwd: /root
>
> {% endif %}
>
>
>
>
> вторник, 18 февраля 2014 г., 3:28:54 UTC-5 пользователь Raul
> Hormazabal написал:
>
> Did you try this?
>
> /{% if grains['id'] == *syslog_server* %}/
>
>
> On Tue, Feb 18, 2014 at 7:13 PM, Brian <
lim.bri...@gmail.com
> <javascript:>> wrote:
>
> Hi,
>
> This thing has been bugging for quite sometime. I am not able
> to use a variable in my if statement in a state file. if
> statement can't seem to see the value of the variable '{{
> syslog_server }}'
>
> Example:
>
> /## syslog.sls ##/
> /
> /
> /{% set syslog_server = '<minion id>' %}/
> /
> /
> /{% if grains['id'] == '*{{ syslog_server }}*' %}
> /
> /
> /
> /rsyslog:/
> / pkg.latest:/
> / - skip_verify: True/
> / service.running:/
> / - enable: True/
> /
> /
> /{% else %}/
> /
> /
> /syslog-ng:/
> / pkg.latest:/
> / - skip_verify: True/
> / service.running:/
> / - enable: True/
> /
> /
> /{% endif %}/
>
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
salt-users+...@googlegroups.com
> <javascript:>.
> <
https://groups.google.com/groups/opt_out>.