salt icon indicating copy to clipboard operation
salt copied to clipboard

help with masterless windows and network.interfaces and jinja

Open emmellee opened this issue 13 years ago • 3 comments

My configuration is a masterless windows environment where salt-call produces the following:

C:\salt>salt-call network.interfaces
←[0;36mlocal←[0m:
    ←[0;36m----------←[0m
    ←[0;36mvmxnet3 Ethernet Adapter←[0m:
        ←[0;36m----------←[0m
        ←[0;36mhwaddr←[0m:
            ←[0;32m<edit>←[0m
        ←[0;36minet←[0m:
            ←[0;36m----------←[0m
            ←[0;36m- address←[0m:
                ←[0;32m<edit>.16←[0m
            ←[0;36m- label←[0m:
                ←[0;32mvmxnet3 Ethernet Adapter←[0m
            ←[0;36m- netmask←[0m:
                ←[0;32m255.255.0.0←[0m
        ←[0;36mup←[0m:
            ←[1;33mTrue←[0m
    ←[0;36mvmxnet3 Ethernet Adapter #2←[0m:
        ←[0;36m----------←[0m
        ←[0;36mhwaddr←[0m:
            ←[0;32m<edit>←[0m
        ←[0;36minet←[0m:
            ←[0;36m----------←[0m
            ←[0;36m- address←[0m:
                ←[0;32m<edit>.16←[0m
            ←[0;36m- label←[0m:
                ←[0;32mvmxnet3 Ethernet Adapter #2←[0m
            ←[0;36m- netmask←[0m:
                ←[0;32m255.255.0.0←[0m
        ←[0;36mup←[0m:
            ←[1;33mTrue←[0m
    ←[0;36mvmxnet3 Ethernet Adapter #3←[0m:
        ←[0;36m----------←[0m
        ←[0;36mhwaddr←[0m:
            ←[0;32m<edit>←[0m
        ←[0;36minet←[0m:
            ←[0;36m----------←[0m
            ←[0;36m- address←[0m:
                ←[0;32m<edit>.117←[0m
            ←[0;36m- broadcast←[0m:
                ←[0;32m<edit>.113←[0m
            ←[0;36m- label←[0m:
                ←[0;32mvmxnet3 Ethernet Adapter #3←[0m
            ←[0;36m- netmask←[0m:
                ←[0;32m255.255.255.240←[0m
        ←[0;36mup←[0m:
            ←[1;33mTrue←[0m

C:\salt>

Seems to work, so how might I utilize network.interfaces in a state or pillar file for templating? For example:

JenkinsTomcat7:
  file:
    - managed
    - name: D:\tomcats\tomcat-jenkins\conf\server.xml
    - template: jinja
    - source: salt://templates/server.xml
    - context:
      shutdownPort: 8115
      sslPort: 443
      IP:  {{ salt-call['network.interfaces']()['????']['inet'][???]['address'] }}

Thanks for your help.

emmellee avatar Nov 14 '13 22:11 emmellee

You're generally better off asking general questions like this on the salt-users group -- more people watch those e-mails.

That said, I think this documentation will help: http://docs.saltstack.com/topics/tutorials/standalone_minion.html

basepi avatar Nov 14 '13 23:11 basepi

ah, okay. Haven't been to the salt-users group. I'm guessing that's the google group I see? I'll post the question there. thanks.

emmellee avatar Nov 15 '13 14:11 emmellee

Yep, that's the one!

basepi avatar Nov 15 '13 21:11 basepi