FAQ
I am experiencing issues setting a var using grains.get versus just calling
grains. Is there a different to these two methods that isn't manifestly
obvious?

The grain is available on the host:

$ salt-call grains.get ec2_vpc_id
local:
     vpc-123

But these two lines in a pillar file produce different results:

foo: {{ salt['grains.get']('ec2_vpc_id', None) }}
bar: {{ grains['ec2_vpc_id'] | default(None) }}

$ salt-call pillar.get foo
local:
     None

$ salt-call pillar.get bar
local:
     vpc-123

Both the minion and the master are running the same version of salt
(2014.1.0). The host is both the saltmaster and the salt-minion. Any ideas
what might be causing this?

--
Stephen Wood
www.heystephenwood.com

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

  • Tim H Baker at Jul 19, 2014 at 5:12 am

    On Saturday, July 19, 2014 2:22:15 PM UTC+10, Stephen Wood wrote:
    I am experiencing issues setting a var using grains.get versus just
    calling grains. Is there a different to these two methods that isn't
    manifestly obvious?


    Hi Stephen,
    A similar issue was reported
    here: https://github.com/saltstack/salt/issues/10954

    Not sure whether the root cause is the same in your case.

    cheers,
    Tim

    --
    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.
  • Colton Myers at Jul 25, 2014 at 11:11 pm
    This does seem strange, I think those two things should be getting the same
    value.

    Mind filing an issue on Github? Or if #10954 fits, commenting there?

    --
    Colton Myers

    On Fri, Jul 18, 2014 at 11:12 PM, wrote:


    On Saturday, July 19, 2014 2:22:15 PM UTC+10, Stephen Wood wrote:

    I am experiencing issues setting a var using grains.get versus just
    calling grains. Is there a different to these two methods that isn't
    manifestly obvious?


    Hi Stephen,
    A similar issue was reported here:
    https://github.com/saltstack/salt/issues/10954

    Not sure whether the root cause is the same in your case.

    cheers,
    Tim

    --
    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 19, '14 at 4:22a
activeJul 25, '14 at 11:11p
posts3
users3

People

Translate

site design / logo © 2022 Grokbase