FAQ
/etc/postfix/main.cf:
   file.copy:
     - source: /etc/postfix/main.cf
     - name: /tmp/main.cf.`date +%Y%m%d`


I am not able to see its taking the date command instead its creating like
this file name.

main.cf.`date +%Y%m%d`

can some one help me with this ?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Colton Myers at Aug 29, 2014 at 10:36 pm
    Try using jinja instead:

    /etc/postfix/main.cf:
       file.copy:
         - source: /etc/postfix/main.cf
         - name: /tmp/main.cf.{{ salt['cmd.run']('date +%Y%m%d') }}

    If that creates messy output or newlines or anything like that, I would
    recommend a quick custom module instead, perhaps using Python's own
    datetime module.

    --
    Colton Myers

    On Thu, Jul 31, 2014 at 1:23 PM, Mano Nathan wrote:

    /etc/postfix/main.cf:
    file.copy:
    - source: /etc/postfix/main.cf
    - name: /tmp/main.cf.`date +%Y%m%d`


    I am not able to see its taking the date command instead its creating like
    this file name.

    main.cf.`date +%Y%m%d`

    can some one help me with this ?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJul 31, '14 at 7:23p
activeAug 29, '14 at 10:36p
posts2
users2

2 users in discussion

Colton Myers: 1 post Mano Nathan: 1 post

People

Translate

site design / logo © 2022 Grokbase