hi imre,
thx for taking the time to answer.
but I do not really understand - or had a totally different narrativ, on
how debops works with groups.
first: there is no such thing as max of 3 groups? correct?
Am 21.08.20 um 11:43 schrieb Imre Jonk:
Hi guenter,
On Thu, 2020-08-20 at 12:55 +0200, dev wrote:
> hello everybody,
>
> Since a wile I do have a weird behavior, that some group assignments
> are not executed.
>
> mainly I recognized these with apt_install and resources.
>
> today I had the time to debug and moved them out of the way, and
> back one by one.
>
> after 3 resources, no all definitions got executed (mostly commands)
> any more.
It sounds like one group variable is overriding the other. I know of
two ways to solve that:
That I don’t understand.
what do you mean by overriding? from my understanding, they should all
be “combined”, i.e.
|resources__commands| will be concatenated with all
|resources__group_commands|, and then concatenated with the
|resources__host_commands|.
if there are entries with the same |name:|, the last one wins.
so, when a host is part in diff. groups of the same role, which i.e.
have all |resources__group_commands| in the inventory, how can one group
overwrite the other, given the fact that I don’t use the same |name:|
for commands
1. Arrange your inventory variables in such a way that this
doesn't
happen.
2. Change Ansible's hash_behaviour to merge variables instead of
overriding them. I haven't tried this though, it might very well mess
everything up (and the Ansible documentation recommends against
changing it). But if you want to give it a try, add "hash_behaviour =
merge" to the [ansible defaults] section in .debops.cfg.
I had a look at the how-variables-are-merged
<
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#h...
and it talks about overwriting variables with the same name.
does that mean, variables like |apt_install__group_packages| are
overwritten by each later group in the alphabet which also uses
|apt_install__group_packages|?
when I understand that right, that would mean, each host could
effectively be only in one group per role, where some of this i.e.
|apt_install__group_pks|, |resources__group_*| are used.
Let's see if option #1 works for you. You can also post the
relevant
inventory variables to the mailing list so that we can have a look.
my real world example is of that structure:
I have a couple of proxmox-hosts. to set them up, I depend heavily on
the “resources__*” role
there are settings (pve-user, groups, acls, backup-strorage,
image-downloads etc.), which are all the same for all my PVEs, which I
wrote in
|resources__group_[files, urls, commands]|
then there are hostbased settings (i.e disk-structures, storage-def.),
which go into:
|resources__host_[files, urls, commands]|
and the there is this new and shiny Proxmox-Backup-Server PBS, which
uses the same role-structure and is likely to be installed on the same
hosts (but not always), but utilizes diff. groups
|resources__group_[files, urls, commands]|
then there are hostbased settings, which go into:
|resources__host_[files, urls, commands]|
how to arrange something like that?
thanks a lot for clarification i.a.
guenter
Imre
> I did a yamllint & beautification – without any change. I ignored
> the error with linelength > 80, since they don't seem to make any
> difference
>
> I remember dark, that years ago there was something like a max. limit
> in which a host could only be member in 3 groups.
>
> is that still the case? why? and can that be changed, it's a too big
> restriction.
>
>
> if not, any suggestions how I could debug this?
>
>
> TIA
>
> guenter