Skip to content

Instantly share code, notes, and snippets.

@cheuschober
Created June 9, 2015 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheuschober/8fd2f5f76624ca19f315 to your computer and use it in GitHub Desktop.
Save cheuschober/8fd2f5f76624ca19f315 to your computer and use it in GitHub Desktop.
Mine in Pillar
$ cat /srv/pillar/test.sls
#!jinja|yaml
mine_functions:
network.ip_addrs: [eth0]
test:
ips: {{ salt['mine.get']('*', 'network.ip_addrs') | json }}
good: True
$ salt '*' pillar.get test
{
"salt": ""
}
{
"etcd-04": {
"ips": {},
"good": true
}
}
{
"etcd-02": {
"ips": {},
"good": true
}
}
{
"etcd-01": {
"ips": {},
"good": true
}
}
{
"etcd-03": {
"ips": {},
"good": true
}
}
{
"etcd-05": {
"ips": {},
"good": true
}
}
$ salt 'etcd-01' mine.get '*' network.ip_addrs
{
"etcd-01": {
"etcd-04": [
"10.0.3.240"
],
"etcd-05": [
"10.0.3.213"
],
"etcd-01": [
"10.0.3.75"
],
"etcd-02": [
"10.0.3.59"
],
"etcd-03": [
"10.0.3.154"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment