Projet

Général

Profil

Bug #54710

ansible affiche [deprecation warning]: default_hash_behaviour ...

Ajouté par Thomas Noël il y a presque 3 ans. Mis à jour il y a plus de 2 ans.

Statut:
Fermé
Priorité:
Bas
Assigné à:
Version cible:
-
Début:
09 juin 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Genre quand je lance la mise à jour du certif :

$ ansible-playbook -K -i inventory.yml --tags "tls" install.yml
[DEPRECATION WARNING]: DEFAULT_HASH_BEHAVIOUR option, this feature is fragile and not portable, leading to continual confusion and misuse, 
use the ``combine`` filter explicitly instead. This feature will be removed from ansible-base in version 2.13. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
BECOME password: 

Tout marche, mais bon, un jour, sans doute que pas.

Pour info je suis en Debian testing donc Ansible 2.10.8 :

$ ansible --version
ansible 2.10.8
  config file = /home/thomas/src/publik-devinst/ansible.cfg
  configured module search path = ['/home/thomas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]


Fichiers

Révisions associées

Révision a4422ca2 (diff)
Ajouté par Emmanuel Cazenave il y a plus de 2 ans

use standard hash behaviour (replace) (#54710)

Historique

#1

Mis à jour par Thomas Noël il y a presque 3 ans

Et en même temps « git grep DEFAULT_HASH_BEHAVIOUR » ne renvoie rien dans les sources de publik-devinst, si ça se trouve ça vient de ma config ansible (mais j'ai bien l'impression de ne pas en avoir...)

#2

Mis à jour par Daniel Muyshond il y a plus de 2 ans

Bonjour, j'atteri ici via une recherche dans redmine sur "TLS" et pour info j'ai la même chose :

dmuyshond@dmuyshond-ThinkPad-T590:~/src/publik-devinst$ ansible-playbook -K -i inventory.yml --tags "tls" install.yml
[DEPRECATION WARNING]: DEFAULT_HASH_BEHAVIOUR option, this feature is fragile and not portable, leading to continual confusion and misuse, use the ``combine`` filter explicitly instead. This feature will be 
removed from ansible-base in version 2.13. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
dmuyshond@dmuyshond-ThinkPad-T590:~/src/publik-devinst$ ansible --version
ansible 2.10.5
  config file = /home/dmuyshond/src/publik-devinst/ansible.cfg
  configured module search path = ['/home/dmuyshond/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0]

#3

Mis à jour par Daniel Muyshond il y a plus de 2 ans

Thomas Noël a écrit :

Et en même temps « git grep DEFAULT_HASH_BEHAVIOUR » ne renvoie rien dans les sources de publik-devinst, si ça se trouve ça vient de ma config ansible (mais j'ai bien l'impression de ne pas en avoir...)

C'est normal puisque cette option s'init dans le .cfg via la clé "hash_behaviour" et pas "DEFAULT_HASH_BEHAVIOR" (cfr. https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-hash-behaviour).

dmuyshond@dmuyshond-ThinkPad-T590:~/src/publik-devinst$ cat /home/dmuyshond/src/publik-devinst/ansible.cfg
[defaults]
hash_behaviour = merge
remote_tmp = /tmp
interpreter_python = /usr/bin/python3

On retrouve bien votre hash_behavior = merge

Par ailleurs ils recommandent de ne plus employer "merge" :

The Ansible project recommends you avoid ``merge`` for new projects. It is the intention of the Ansible developers to eventually deprecate and remove this setting, but it is being kept as some users do heavily rely on it. New projects should avoid ‘merge’.

#4

Mis à jour par Emmanuel Cazenave il y a plus de 2 ans

Le merge avait été posé par moi dans #21725 :

ajout du ansible.cfg avec hash_behaviour = merge qui permet à l'utilisateur de surcharger certaines valeurs de la section apps dans son inventory (sans le hash_behaviour = merge, il faut redéfinir toute la section apps)

En pratique cette fonctionnalité (de surcharger des variables qui sont au fin fond de group_vars/all) n'est pas documentée, je ne m'en sers jamais, donc on va dire qu'on va très bien vivre sans.

#5

Mis à jour par Nicolas Roche (absent jusqu'au 3 avril) il y a plus de 2 ans

  • Statut changé de Solution proposée à Solution validée
#6

Mis à jour par Emmanuel Cazenave il y a plus de 2 ans

  • Statut changé de Solution validée à Solution déployée
commit a4422ca29f2ca29de456ea8c8f7b9155cf67d7d5
Author: Emmanuel Cazenave <ecazenave@entrouvert.com>
Date:   Wed Oct 6 14:37:30 2021 +0200

    use standard hash behaviour (replace) (#54710)

Formats disponibles : Atom PDF