Need help getting and applying custom grains from a REST api.

17 views
Skip to first unread message

steven...@firstdata.com

unread,
Jun 23, 2017, 10:16:12 AM6/23/17
to Salt-users
We are looking to pull fields from an API and then apply them to our servers as a grain. I saw the rest example but I don't know how to flesh out a bit more to what I need. Does anyone have an example they can share?

Daniel Wallace

unread,
Jun 23, 2017, 10:17:21 AM6/23/17
to Salt-users
You could model it after the metadata grains that are going to be in
2017.7, which just pulls down json information from the ec2/openstack
metadata servers.

https://github.com/saltstack/salt/blob/develop/salt/grains/metadata.py
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/salt-users/9c97d519-e359-4545-b59f-01e495b8b747%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages