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

For those of us who maintain our Ansible stack in a git repo... #185

Closed
windowsrefund opened this issue May 3, 2018 · 5 comments
Closed

Comments

@windowsrefund
Copy link

Including inventory, how would we go about our node collection? In other words, it seems the Ansible Resource Model Source assumes an inventory is local; on disk. There appears to be no provision to pull it from a remote location. I explored the URL Source alternative but that seems to be limited to a (small?) number of supported file formats (I may be wrong) and does not allow for authentication.

Given everything I've said above, I'm not even sure the funtionality I'm looking for belongs in this plugin. I could see a protocol-specific plugin such as "Subversion Source" or "Git Source" being appropriate?

@windowsrefund
Copy link
Author

Found the git-resource-model plugin but that's not going to work at this time since it only supports YAML, JSON, and XML. I filed a feature request here: rundeck-plugins/git-resource-model#1

@agates
Copy link

agates commented May 7, 2018

It seems like an executable dyanimic inventory script in ansible might be the solution you want. The script would get executed by rundeck/ansible and return your inventory as JSON from a remote source.

@windowsrefund
Copy link
Author

I may have made progress via my dummy project's "configure SCM" option. After configuring the git import portion, I then was able to configure the project's node resource to look at a particular Ansible inventory file. The file exists on local disk as a result of the git import. This gives me a valid representation of Ansible inventory.....

What I do not know is how dymanic this import behavior is. In other words, the documentation doesn't bother to explain basic things like whether the import is a "one off" or if it'll repeat itself, etc... there's no scheduling so maybe it's tied to the project's run... I don't know.

@mcassaniti
Copy link
Contributor

We use a GIT repository for our Ansible repository. At the top of every job is a task to pull the repository into a temporary directory. Every night we run a job to pull the repository and refresh the project nodes. We could refresh every time we run a job, but we don't change the list of nodes more frequently than daily.

Yes it would be nice if Rundeck itself offered something around the SCM side to import and refresh when running a job. I'd suggest a new plugin to do that. While I know this doesn't fix the issue as such for you, can I mark the issue as resolved since it's outside the scope of this plugin?

@windowsrefund
Copy link
Author

sure thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants