Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Inventory support #47

Closed
lakshmantgld opened this issue Oct 15, 2015 · 31 comments
Closed

Dynamic Inventory support #47

lakshmantgld opened this issue Oct 15, 2015 · 31 comments
Milestone

Comments

@lakshmantgld
Copy link

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.

@lakshmantgld lakshmantgld changed the title can semaphore support for dynamic inventories can semaphore support dynamic inventories Oct 16, 2015
@gvenka008c
Copy link

@here... Any updates on this?

@lakshmantgld
Copy link
Author

@gvenka008c No answers. Built my own Ansible Tower.

@gvenka008c
Copy link

@Lakshman-LD Thanks. Got any repo to clone / view your Ansible tower version?

@gvenka008c
Copy link

@Lakshman-LD Any updates?

@matejkramny
Copy link
Contributor

You can automate the API, or adjust runner.js to have dynamic inventory.

@lakshmantgld
Copy link
Author

Dont have any repo to share!! sorry @gvenka008c

@gvenka008c
Copy link

@matejkramny I updated runner.js. How can i ensure the updated script is picked up by docker?

@gvenka008c
Copy link

@Lakshman-LD Thanks.

@matejkramny
Copy link
Contributor

@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

@matejkramny
Copy link
Contributor

Dynamic inventories will be supported in version 2 of semaphore.

It is WIP in branch https://github.com/ansible-semaphore/semaphore/tree/v2

@matejkramny matejkramny added this to the v2 milestone Mar 27, 2016
@matejkramny matejkramny mentioned this issue Mar 28, 2016
21 tasks
@matejkramny matejkramny modified the milestones: 2.1, 2.0 Apr 24, 2016
@matejkramny
Copy link
Contributor

Sorry guys, reassigned to v2.1 release

@matejkramny matejkramny changed the title can semaphore support dynamic inventories Dynamic Inventory support Apr 24, 2016
@adambonny
Copy link

👍

@nathan-v
Copy link

Is there any update on when this feature will be available?

@matejkramny
Copy link
Contributor

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?

@nathan-v
Copy link

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.

@srpayne
Copy link

srpayne commented Jul 21, 2016

Why not just use ec2.py instead of creating something new? or give the option of piping to it?

@pgporada
Copy link

I was expecting to be able to point at a custom inventory file as well.

@theasp
Copy link

theasp commented Mar 9, 2017

@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.

@pgporada
Copy link

pgporada commented Mar 9, 2017

@theasp Fantastic idea!

@matejkramny matejkramny mentioned this issue Apr 19, 2017
22 tasks
@JanSchr
Copy link

JanSchr commented Apr 29, 2017

Beeing able to choose an inventory file from a git repository would be awesome.

@morph027
Copy link

morph027 commented May 6, 2017

Jip, would love it! So far, the extra cli arguments stuff works for me.

@punktik
Copy link

punktik commented May 8, 2017

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.

@aioue
Copy link
Contributor

aioue commented Jun 2, 2017

is this released yet? It's greyed out in 2.3.0

@tf42src
Copy link

tf42src commented Aug 4, 2017

Still grayed out in v2.4.1. I have added AWS credentials in Key Store.

@anitakrueger
Copy link

anitakrueger commented Aug 15, 2017

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

@brad
Copy link

brad commented Sep 8, 2017

@aioue @tobiasfielitz @anitakrueger It's still unchecked in the roadmap (listed there as "Remote Inventories")

@GanimanSwift
Copy link

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.

@ghost
Copy link

ghost commented Dec 20, 2017

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

@ndeixonne
Copy link

ndeixonne commented Dec 20, 2017

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.

@twhiston
Copy link
Contributor

twhiston commented Feb 16, 2018

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.....)

@twhiston
Copy link
Contributor

closing this as file type of inventory allows for dynamic inventory files to be included in the source repo

hanserasmus added a commit to hanserasmus/ansible-semaphore-docs that referenced this issue Oct 13, 2023
According to semaphoreui/semaphore#47 (comment) using a file should work, but I could not find it in the docs. After taking a leap of faith and testing on my install, it seems to work.

If you run a play that is located in a git repo, then Semaphore will actually search for the inventory file in the location specified, but relative to your playbook location. So using standard Ansible practices, creating a folder in your git repo called `inventory` and then putting your yaml file in there, will actually work when referenced in the "inventory" configuration in Semaphore UI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests