FAQ
Hi, folks,

I just started studying Salt and it is great so far. I just can't get to know what is the best way to run several SQL queries on the minions and store these information and maybe INSERT them into a DB on the master?

I began trying to make it work using salt_mine.

It looks like this on the /etc/salt/minion file

mine_functions:
     mysql.query:
       database: db
       query: "etc"

     mysql.query:
       database: db
       query: "etc"

     mysql.query:
       database: db
       query: "etc"

     mysql.query:
       database: db
       query: "etc"

     mysql.query:
       database: db
       query: "etc"


The problem is: it only keeps the last defined mysql.query entry. Now it seems that I could solve this using the 'alias' feature documented.

It did not.

Whenever I defined something like

mine_functions:
    my_function:
       mine_function: mysql.query
       database: db
       query: "etc"

Salt would print an error telling me that he doesn't know 'my_function' .


Is this task really best accomplished this way? Why didn't the alias technique work? How could I extract the information from the mine on the master and maybe pass ir to a method that could insert into a DB?




Regards,

--
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

  • Gabriel Galvão at Sep 23, 2014 at 11:23 am
    Oops,

    Subject was supposed to be 'Best Way*'.

    I saw that the alias feature is only supported on the latest Release
    Candidate 2014.7. That was my fault not paying enough attention to this.

    I also researched into the 'returner' attribute of the job scheduler. What
    is not clear is if this returner will only work on each minion or if this
    can be called all the way to the master, centralizing information. Anyone?
    On Monday, September 22, 2014 5:22:32 PM UTC-3, Gabriel Galvão wrote:

    Hi, folks,

    I just started studying Salt and it is great so far. I just can’t get to
    know what is the best way to run several SQL queries on the minions and
    store these information and maybe INSERT them into a DB on the master?

    I began trying to make it work using salt_mine.

    It looks like this on the /etc/salt/minion file

    mine_functions:
    mysql.query:
    database: db
    query: “etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"


    The problem is: it only keeps the last defined mysql.query entry. Now it
    seems that I could solve this using the ‘alias’ feature documented.

    It did not.

    Whenever I defined something like

    mine_functions:
    my_function:
    mine_function: mysql.query
    database: db
    query: “etc”

    Salt would print an error telling me that he doesn’t know ‘my_function’ .


    Is this task really best accomplished this way? Why didn’t the alias
    technique work? How could I extract the information from the mine on the
    master and maybe pass ir to a method that could insert into a DB?




    Regards,
    --
    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.
  • Gabriel Galvão at Sep 23, 2014 at 1:33 pm
    I guess I now have the answer to my own question.

    Check http://docs.saltstack.com/en/latest/topics/jobs/schedule.html

    You can set up a redis, mysql, sqlite3, whatever method on the minion
    configuration file and then call it as the returner for your scheduled
    function call.


    On Tuesday, September 23, 2014 8:23:18 AM UTC-3, Gabriel Galvão wrote:

    Oops,

    Subject was supposed to be 'Best Way*'.

    I saw that the alias feature is only supported on the latest Release
    Candidate 2014.7. That was my fault not paying enough attention to this.

    I also researched into the 'returner' attribute of the job scheduler. What
    is not clear is if this returner will only work on each minion or if this
    can be called all the way to the master, centralizing information. Anyone?
    On Monday, September 22, 2014 5:22:32 PM UTC-3, Gabriel Galvão wrote:

    Hi, folks,

    I just started studying Salt and it is great so far. I just can’t get to
    know what is the best way to run several SQL queries on the minions and
    store these information and maybe INSERT them into a DB on the master?

    I began trying to make it work using salt_mine.

    It looks like this on the /etc/salt/minion file

    mine_functions:
    mysql.query:
    database: db
    query: “etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"

    mysql.query:
    database: db
    query: "etc"


    The problem is: it only keeps the last defined mysql.query entry. Now it
    seems that I could solve this using the ‘alias’ feature documented.

    It did not.

    Whenever I defined something like

    mine_functions:
    my_function:
    mine_function: mysql.query
    database: db
    query: “etc”

    Salt would print an error telling me that he doesn’t know ‘my_function’ .


    Is this task really best accomplished this way? Why didn’t the alias
    technique work? How could I extract the information from the mine on the
    master and maybe pass ir to a method that could insert into a DB?




    Regards,
    --
    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 @
postedSep 22, '14 at 8:22p
activeSep 23, '14 at 1:33p
posts3
users1

1 user in discussion

Gabriel Galvão: 3 posts

People

Translate

site design / logo © 2022 Grokbase