-
Notifications
You must be signed in to change notification settings - Fork 116
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
Best Practise Configuration (or: how to use 'playbooks-paths'?) #116
Comments
I don't combine "standard" DebOps playbooks and custom playbooks into one, in other words, I usually run just standard playbooks/roles and custom roles are executed separately as needed from I'm not sure how playbook include in Ansible works when playbooks and roles are in completely different paths, if it creates issues I'm open to changes in the scripts or configuration as needed. So, how do you guys use custom roles/playbooks with DebOps? Any experiences that can be defined as best practices? |
I'm also curious how to extend debops. I considered doing something like @ganto, but you mention separate playbooks for new roles in a few issues. I tried doing it that way.
I feel there might be an issue with the default configuration to do this as well. Or maybe it's just missing documentation. Or I'm missing something. EDIT: After more troubleshooting, I moved this to a separate issue. |
I am trying to do something similar, but in my case to provide a set of common playbooks based on the debops roles. The issue I'm finding is that all of the roles and plugin paths are determined relative to the playbooks-path. For me this is causing trouble since I still want to use the roles and plugins with the common playbooks. Specifically I want to create a common set of playbooks to manage sets of TurnkeyLinux appliances from their Ansible appliance. Ideally, the user would install debops, install the comon playbooks to a path like ~/.local/share/turnkey/tkl-playbooks, run debops-init, and set the playbooks-paths. Initially my thought was that the common tkl-playbooks would replace the debops playbooks, but maybe a user would want to use the debops ones alongside the common ones. In any case they would still need access to the plugins and roles from debops since I don't think it makes sense to try and duplicate those. I think that allowing the playbooks-paths to contain multiple paths with the first having priority, no matter what paths may have a site.yml, would provide the most flexibility. It would allow the following priority for all items: project->site custom->debops. I think that this would be a best practice for re-useability at least. |
For a while I'm trying to find the best way how to easily extend DebOps with my custom roles. However, I'm failing to find a satisfying configuration.
So far my approach was to create a custom
<project>/ansible/playbooks/site.yml
where I include the upstreamsite.yml
at the end. The dirty hack in this configuration is that the upstreamsite.yml
has to be given with a concrete path. E.g.Is there a variable which can be used in the YAML to get the upstream playbooks path?
Problem: Using playbooks-paths
When looking through the documentation I found that there is a
playbooks-paths
variable which is documented as:So I tried to move my custom
site.yml
to a separate path which is listed inplaybooks-paths
(btw. the parsing only works when the definition is newline separated, not comma separated):The problem now is, that because the
site.yml
is first found in my custom location, theroles_paths
is expanded to only include role directories relative to this playbook path. This makes it impossible to run upstream roles.So I deleted the
site.yml
from my custom directory, which now fixes the role lookup. But no custom playbooks are run anymore, what defeats the purpose of the configuration.Problem: Expanding roles_paths
Alternatively I tried to add the
%(install-paths)s/roles
path to theroles_paths
variable in.debops.cfg
which resulted in this error:Obviously
%(install-path)
cannot be correctly expanded when used under[ansible defaults]
.Questions:
I don't really understand how people are using these configuration statements.
playbooks-paths
?roles_paths
?The text was updated successfully, but these errors were encountered: