Outputting salt-mine data into templateHow do I list all connected Salt Stack minions?salt stack: use state...

What do you call someone who likes to pick fights?

Under what conditions can the right to remain silent be revoked in the USA?

Are E natural minor and B harmonic minor related?

Translation of 答えを知っている人はいませんでした

Why restrict private health insurance?

Origin of the word “pushka”

How do I increase the number of TTY consoles?

Why aren't there more Gauls like Obelix?

Can the Witch Sight warlock invocation see through the Mirror Image spell?

Writing text next to a table

Help! My Character is too much for her story!

Is divide-by-zero a security vulnerability?

PTIJ: Who was the sixth set of priestly clothes for?

Which country has more?

Are all players supposed to be able to see each others' character sheets?

Is there a logarithm base for which the logarithm becomes an identity function?

Computation logic of Partway in TikZ

How to install round brake pads

Is this Paypal Github SDK reference really a dangerous site?

Are small insurances worth it?

Converting from "matrix" data into "coordinate" data

Either of .... (Plural/Singular)

Finding the minimum value of a function without using Calculus

If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?



Outputting salt-mine data into template


How do I list all connected Salt Stack minions?salt stack: use state jinja variables in templateusing grain data in a custom salt stack grainSalt: Minion did not return but salt-call is workingSalt-Stack copy directory from salt master to minionSalt: Properties for pillar data?Salt: Read property file into Postgres databaseBuilding an AMI using Packer with a shell provisionerSalt top.sls does not update on `salt-run fileserver.update` with gitfsWhy can't I use Digital Ocean private IPs for reverse proxying with this Salt Cloud setup?













0















Can anyone spot my error here. I have the following in the minion config:



mine_functions:
network.interfaces: []


I expect the following to return the IP of all minions:



{% for ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
{{ ip }}
{% endfor %}


The state fails with the following:




Unable to manage file: Jinja error: 'list' object has no attribute 'lower'.




I've also tried doing it another way:



{% set hosts = salt['mine.get']('*', 'network.interfaces') %}
{% for i in hosts %}
{{ hosts[i]['eth0']['inet'][0]['address'] }}
{% endfor %}


From this I get:




variable 'dict object' has no attribute 'inet';




If I remove inet, 0 and address it works but outputs all interface info when I only want the IP of eth0.



Any help is greatly appreciated.










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    Can anyone spot my error here. I have the following in the minion config:



    mine_functions:
    network.interfaces: []


    I expect the following to return the IP of all minions:



    {% for ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
    {{ ip }}
    {% endfor %}


    The state fails with the following:




    Unable to manage file: Jinja error: 'list' object has no attribute 'lower'.




    I've also tried doing it another way:



    {% set hosts = salt['mine.get']('*', 'network.interfaces') %}
    {% for i in hosts %}
    {{ hosts[i]['eth0']['inet'][0]['address'] }}
    {% endfor %}


    From this I get:




    variable 'dict object' has no attribute 'inet';




    If I remove inet, 0 and address it works but outputs all interface info when I only want the IP of eth0.



    Any help is greatly appreciated.










    share|improve this question
















    bumped to the homepage by Community 8 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      Can anyone spot my error here. I have the following in the minion config:



      mine_functions:
      network.interfaces: []


      I expect the following to return the IP of all minions:



      {% for ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
      {{ ip }}
      {% endfor %}


      The state fails with the following:




      Unable to manage file: Jinja error: 'list' object has no attribute 'lower'.




      I've also tried doing it another way:



      {% set hosts = salt['mine.get']('*', 'network.interfaces') %}
      {% for i in hosts %}
      {{ hosts[i]['eth0']['inet'][0]['address'] }}
      {% endfor %}


      From this I get:




      variable 'dict object' has no attribute 'inet';




      If I remove inet, 0 and address it works but outputs all interface info when I only want the IP of eth0.



      Any help is greatly appreciated.










      share|improve this question
















      Can anyone spot my error here. I have the following in the minion config:



      mine_functions:
      network.interfaces: []


      I expect the following to return the IP of all minions:



      {% for ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
      {{ ip }}
      {% endfor %}


      The state fails with the following:




      Unable to manage file: Jinja error: 'list' object has no attribute 'lower'.




      I've also tried doing it another way:



      {% set hosts = salt['mine.get']('*', 'network.interfaces') %}
      {% for i in hosts %}
      {{ hosts[i]['eth0']['inet'][0]['address'] }}
      {% endfor %}


      From this I get:




      variable 'dict object' has no attribute 'inet';




      If I remove inet, 0 and address it works but outputs all interface info when I only want the IP of eth0.



      Any help is greatly appreciated.







      saltstack






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 1 '17 at 17:59









      Roald Nefs

      30629




      30629










      asked May 1 '14 at 14:07









      Joseph GardnerJoseph Gardner

      2115




      2115





      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          # use network.ip_addrs instead



          mine_functions:
          network.ip_addrs: [eth0]





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "2"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f592497%2foutputting-salt-mine-data-into-template%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            # use network.ip_addrs instead



            mine_functions:
            network.ip_addrs: [eth0]





            share|improve this answer




























              0














              # use network.ip_addrs instead



              mine_functions:
              network.ip_addrs: [eth0]





              share|improve this answer


























                0












                0








                0







                # use network.ip_addrs instead



                mine_functions:
                network.ip_addrs: [eth0]





                share|improve this answer













                # use network.ip_addrs instead



                mine_functions:
                network.ip_addrs: [eth0]






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 5 '14 at 20:14









                user199788user199788

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f592497%2foutputting-salt-mine-data-into-template%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                    Список ссавців Італії Природоохоронні статуси | Список |...

                    Українські прізвища Зміст Історичні відомості |...