Hi,
I'm new to saltstack and trying to get saltstack / saltcloud / ec2 up and running.
My environment:
1. Amazon Linux (current version)
2. Salt-master, salt-minion, salt-cloud 2015.5.5-1 from EPEL 6 repo
Salt works as expected, and I can use salt-cloud to launch minions based on a map file. Here's a sample map file I'm using:
west2-small-internal:
grains:
ihost: test
(Lots of stuff about the provider and profile omitted)
Now I would like to use reactor to flesh out the initial system. I would like to do the following:
1. Set the internal host name to the ifqdn name
2. Bunches of other stuff
In order to do that, I set up a simple reactor.conf file:
# reactor for ec2 bootstrapping
reactor:
- 'salt/cloud/*/created':
- '/srv/reactor/hostname.sls'
And the reactor file:
# hostname.sls
hostname_set:
local.network.system:
- tgt: {{ data['name'] }}
- kwarg:
name: {{ grains['ifqdn'] }}
hostname: {{ grains['ifqdn'] }}
hostname_rename:
local.cmd.run:
- tgt: {{ data['name'] }}
- kwarg:
name: hostname {{ grains['ifqdn'] }}
However, the above fails to run. The error is:
SaltRenderError: Jinja variable 'dict object' has no attribute 'ifqdn'
Even though:
----------
ifqdn:
I'm obviously doing something wrong, but what?
BTW, if I rewrite the reactor file as a state file:
hostname_set:
network.system:
- name: {{ grains['ifqdn'] }}
- hostname: {{ grains['ifqdn'] }}
hostname_rename:
cmd.run:
- name: hostname {{ grains['ifqdn'] }}
- wait:
cmd: network
works.
. . . just my confused 2 cents
/mde/