-
Notifications
You must be signed in to change notification settings - Fork 19
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
ansible-config #35
Comments
This would be great, but I'm curious how it would interoperate with vault. |
I really like the idea and the flexibility it gives you, the only thing which I'm not sure I'm the fan of is using YAML, because from your example this ini format:
is replaced with: ANSIBLE_COW_SELECTION:
desc: Allows choosing specific cowsay stencils, use 'random' to cycle through them
ini:
section: defaults
key: cow_selection
env: ANSIBLE_COW_SELECTION
type: string
default: null The ini file is far more easier to read/edit and understand. Of course YAML gives you additional info, but is all of it important except the environment variable which can be used, but you can put the variable in the comment of the ini file as well. This YAML is awesome when you want to add some new option (as you added main:
defaults:
cow_selection: 'defaults' The reason why I'm saying this, is that most often you would like to override some ini value for a project/role/play, but the above option feels too complicated for that. |
@jhawkesworth that is already been added in 2.2 @kustodian that exmaple is the 'data definition' not the config file, the config file looks like this:
|
@bcoca that config file looks great :) |
@bcoca YAML formatting, always +1. This proposal allows for proper meta data (not loosely filled comment fields) and being declarative for everyone to read and understand in the whole otherwise YAML oriented Ansible setup. |
How about runtime configuration too?
or
As an alternative to:
|
@willthames we currently have an ANSIBLE_CONFIG option, which with the proposed 'mergable' toggles would act the same. I'm not against adding a |
Would we be able to auto generate a new page on docs.ansible.com from this? |
@gundalow yes, all that is part of the plan .. just not sure when it will be ready |
@bcoca just making sure... Am I mistaken or it looks like the plugin portion of the spec hasn't been implemented yet ? For example there is the notion of plugins in ConfigData but seemingly nothing that loads actual plugins and their configuration into _plugins. I ask because I might want to get involved into this for ARA. |
it is a work in progress, I expect most features to be done in time for 2.4, but this project will probably extend into 2.5 |
Is there any update on this issue? It didn't ship with 2.6 ( as far as I'm concerned ). Is it still on the roadmap? We're currently facing an extreme amount of config duplication across our different ansible projects which would be elegantly solved by outsourcing most of the settings into a common ansible.cfg and only overwriting those that are needed. |
it is waiting for other projects to be finalized as they can influence how this would take final shape, so I am still planing on finishing all the features noted above, but this is a 'multi release' project. |
@bcoca how can I be involved in this? I would like to help. |
+1 |
I guess there is still no news on this? :( (Or am I missing something? Current docs, 2.9, states it is still the "first file behavior") |
Maybe this simple shell workaround can help some people. |
We can close ansible/ansible#61778 in favor of this. I believe it's covered by the agenda here. |
Adding plugin support ansible/ansible#49627 |
Is it still impossible to read and use multiple config files? E.g. - i wanna use Or maybe is there a way to also read |
I'm looking to get more involved in the ansible community and I'd like to take a crack at parts of this, specifically config precedence with the standard ansible.cfg files:
|
@minsis i'm not sure what you want to change, but the existing precedence is already as you list. My proposal would not affect that, it would only affect .yml configuration files as we also require a indicator for the setting to be mergable/nonmergable to allow for mandated/incompatible settings detection. |
@bcoca To clarify I mean the merging of the config files. |
that is what i suspected and that is why my answer also includes why the current 'ini-ish' .cfg files are not a target for that. |
Is this feature of including multiple .cfg files inside the main one still not available? |
@bcoca why would it only be limited to yaml files only and not support backward compatibility? Inventory files does this. Also is there any ongoing discussions on which variables would be protected ones? |
@minsis because in yaml i can do things like |
@bcoca i guess I'm not quite understanding the feature you're talking about. Can you link some docs on what you mean? Overall I still think it's a mistake not to support backwards compatibility. On day one of removing ini files is going to break a lot of people's automation including my own. We deploy a standard cfg file to servers to point to our private automation hub. If the overall goal is to make everything yaml then maybe a depreciation warning for a few versions to allow people time to migrate. |
Where is it mentioned that the ini files are going away? And if they were going to be removed we already have a 4 version deprecation cycle so that would give people plenty of time. The reason the merge would only support YAML has to do with different security contexts. For example, in a context where you have strict regulations/policy on what is permitted the /etc/ansible/config.yml might have a few things you cannot override due to security/compliance/policy
while others are permitted to be merged
Also having a generic setting for the whole file:
It is not possible to have this type of fine grained control with the ini format. This would allow the Administrator to set policy over settings and not have the playbook author/user bypass anything that is globally set due to security/regulation/policy. |
Proposal: ansible-config
Author: Brian Coca @bcoca
Date: 2016/10/-1
Draft implementation: ansible/ansible#12797
Motivation
The current configuration system is limited to a single file and previously hardcoded entries in constants.py. We want to allow plays, plugins and even roles to add config settings when they need them.
Problems
Solution proposal
meta/
dir adjacent to play that can host a config.yml specificOther options
meta/config.yml
for roles, same purpose as play oneread_config_from_role = no|yes
Config Data definition
Example config file:
Example config definition file:
The text was updated successfully, but these errors were encountered: