Dynamic Inventory support
lakshmantgld opened this issue ยท 31 comments
I use aws with ansible, so dynamic inventory is used instead of adding hosts manually. Is this possible with semaphore?
Documentation for running playbooks from local machine? I am not able see the documentation for running test playbooks with git repo, if I have missed it, can you point the documentation.
@here... Any updates on this?
@gvenka008c No answers. Built my own Ansible Tower.
@Lakshman-LD Thanks. Got any repo to clone / view your Ansible tower version?
@Lakshman-LD Any updates?
You can automate the API, or adjust runner.js to have dynamic inventory.
Dont have any repo to share!! sorry @gvenka008c
@matejkramny I updated runner.js. How can i ensure the updated script is picked up by docker?
@Lakshman-LD Thanks.
@gvenka008c you can re-build the image or create an image from the semaphore image, and then edit those files.. Or you can attach to the container and edit files directly, restarting the node process afterwards
Dynamic inventories will be supported in version 2 of semaphore.
It is WIP in branch https://github.com/ansible-semaphore/semaphore/tree/v2
Sorry guys, reassigned to v2.1 release
๐
Is there any update on when this feature will be available?
It'll be a couple of weeks/days.
So far (in my mind) the inventory will fetch EC2 instances using an AWS key, then filter it by a regex specified by the user.
Is there more to it or just simple as that?
Better would be utilizing the EC2 instance tags rather than just the instance metadata.
My preference would be to also allow instance selection by grabbing instances that are members of an Auto Scaling Group. Often instances in AWS are deployed initially as AMIs to ASGs; being able to target the ASG members would be awesome.
Why not just use ec2.py instead of creating something new? or give the option of piping to it?
I was expecting to be able to point at a custom inventory file as well.
@pgporada I agree. I'm able to do it using an empty inventory in Semaphore (I named it "From Hosts File"), and adding this to the "Extra CLI Arguments":
["--inventory", "hosts",
"--limit", "some-group"]
Being able to specify a file from the git repository would allow running it as a script, as per normal ansible behaviour.
Beeing able to choose an inventory file from a git repository would be awesome.
Jip, would love it! So far, the extra cli arguments stuff works for me.
Is there anywhere a howto for someone not familiar with nodejs?
I still cannot selct AWS dynamical inventory.
Thank you in advance for your help.
is this released yet? It's greyed out in 2.3.0
Still grayed out in v2.4.1. I have added AWS credentials in Key Store.
Hi there,
I've just installed semaphore 2.4.1 and got all excited that I could now use AWS as the inventory. But when trying to create an inventory, as @tobiasfielitz said, AWS is greyed out as an option.
Is there a configuration step I am missing which is why it is greyed out? Or is the functionality not available yet?
Thanks!
Anita
@aioue @tobiasfielitz @anitakrueger It's still unchecked in the roadmap (listed there as "Remote Inventories")
I think this missing feature is what's going to prevent me from using Semaphore. I'd really like to be able to point it at a custom script.
Is there a way to just point a static inventory to the ansible hosts file on the server semaphore is running off? e.g. /etc/ansible/hosts
Actually you can specify custom inventory. You jsut need to override the parameter -i in the task template. The last -i in the code is given the priority.
If you need override any other parameters, try to override it in task template.
With -i, you can specify a custom script located in your git playbook, the custom script will be downloaded automatically and so you can use relative path. ex: ["-i","script.sh"] and script.sh is in the directory of your playboo in git.
I would like to try to get this feature in, via the api rather than an -i override into a 2.6.0 version
Dynamic inventory source should also allow 'none' so user can set only with cli arguments if required (to avoid empty inventory workarounds etc.....)
closing this as file type of inventory allows for dynamic inventory files to be included in the source repo