FAQ
hi, i'm new to the saltstack. i want to dispatch multi files to minons. now
my way to solve this is i write a bash script to generate the sls. like
this:
#!/bin/bash

rm -rf init.sls && touch init.sls
for file in vhost/*.conf; do
     cat <<EOS >> init.sls
/opt/tengine/conf/$file:
   file.managed:
     - source: salt://prepare/tengine/$file
     - user: root
     - group: root
     - mode: 644
EOS
done

i want to know what's the best practice to solve this.

thx in advance.

--
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 Mar 24, 2015 at 9:09 pm
    Try file.recurse: http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.recurse

    --
    Colton Myers
    Platform Engineer, SaltStack
    @basepi on Github/Twitter/IRC
    On Mar 18, 2015, at 12:40 AM, 杨秉武 wrote:

    hi, i'm new to the saltstack. i want to dispatch multi files to minons. now my way to solve this is i write a bash script to generate the sls. like this:
    #!/bin/bash

    rm -rf init.sls && touch init.sls
    for file in vhost/*.conf; do
    cat <<EOS >> init.sls
    /opt/tengine/conf/$file:
    file.managed:
    - source: salt://prepare/tengine/$file
    - user: root
    - group: root
    - mode: 644
    EOS
    done

    i want to know what's the best practice to solve this.

    thx in advance.

    --
    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.
  • 杨秉武 at Mar 25, 2015 at 2:43 am
    thx guy:) now i know how to do:)

    在 2015年3月25日星期三 UTC+8上午5:09:31,basepi写道:
    Try file.recurse:
    http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.recurse

    --
    Colton Myers
    Platform Engineer, SaltStack
    @basepi on Github/Twitter/IRC
    On Mar 18, 2015, at 12:40 AM, 杨秉武 <detai...@gmail.com <javascript:>> wrote:
    hi, i'm new to the saltstack. i want to dispatch multi files to minons.
    now my way to solve this is i write a bash script to generate the sls. like
    this:
    #!/bin/bash

    rm -rf init.sls && touch init.sls
    for file in vhost/*.conf; do
    cat <<EOS >> init.sls
    /opt/tengine/conf/$file:
    file.managed:
    - source: salt://prepare/tengine/$file
    - user: root
    - group: root
    - mode: 644
    EOS
    done

    i want to know what's the best practice to solve this.

    thx in advance.

    --
    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:>.
    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 @
postedMar 18, '15 at 6:40a
activeMar 25, '15 at 2:43a
posts3
users2

2 users in discussion

杨秉武: 2 posts Colton Myers: 1 post

People

Translate

site design / logo © 2022 Grokbase