Salt-Cloud Inventory Management

124 views
Skip to first unread message

Jay Ambi

unread,
Mar 7, 2016, 11:50:46 PM3/7/16
to Salt-users
Hi All,

Wondering what the equivalent inventory gathering method is for Salt with cloud providers?

I've been using Salt for sometime and don't think I've come across an option for this.

Coming from ansible, I previously would just run the standard inventory script every 2 mins on cron and it would generate a full list of all my AWS inventory and save for me to do various things with:

https://github.com/ansible/ansible/blob/37eac4592e2bf2814c2325b57042fee26ccdcd8a/contrib/inventory/ec2.py

What is the Salt Equivalent of this?

Daniel Wallace

unread,
Mar 8, 2016, 12:24:47 PM3/8/16
to salt-...@googlegroups.com
If you have the cloud cache enabled, you can use the cloud roster with salt-ssh



It does look like it might need to be expanded, but that should get you started.

Daniel


--
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.
For more options, visit https://groups.google.com/d/optout.

Jay Ambi

unread,
Mar 9, 2016, 1:00:53 AM3/9/16
to Salt-users
Ok, finding that documentation slightly confusing...

How can I confirm that the salt cloud cache is enabled? Is it configured via /etc/salt/cloud or /etc/salt/master?

I guess the first part is to generate the roster file based on the 'salt-cloud --full-query' output.. How do I generate the roster file from that? Is it via a salt-ssh command?

I've tried a few commands but I feel as though I'm poking around in the dark.

Daniel Wallace

unread,
Mar 9, 2016, 10:04:25 AM3/9/16
to salt-...@googlegroups.com
You enable it in the /etc/salt/cloud command.

Then you just run salt-cloud -F, and it will create the cache, and you can select to use the cloud roster when you do salt-ssh with i believe `salt-ssh —roster cloud …`

--
Daniel Wallace
@gtmanfred

Martin Höfling

unread,
Mar 31, 2016, 6:19:52 AM3/31/16
to salt-...@googlegroups.com
On 09.03.16 16:04, Daniel Wallace wrote:
> You enable it in the /etc/salt/cloud command.
>
> Then you just run salt-cloud -F, and it will create the cache, and you
> can select to use the cloud roster when you do salt-ssh with i believe
> `salt-ssh —roster cloud …`

I think the functionality is currently broken - see
https://github.com/saltstack/salt/issues/31005

Best

Martin
Reply all
Reply to author
Forward
0 new messages