Projet

Général

Profil

Bug #30899

Le playbook d'installation échoue si lancée par un sudoers NOPASSWD

Ajouté par Paul Marillonnet il y a environ 5 ans. Mis à jour il y a environ 2 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
26 février 2019
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Avec le paquet debian ansible 2.7.7+dfsg-1 :

$ ansible-playbook -i tenants-inventory.yml install.yml

PLAY [publik multitenants installation] *******************************************************

TASK [Gathering Facts] ************************************************************************
ok: [localhost]

TASK [facts : guess username (can be overidden in options/inventory)] *************************
changed: [localhost -> localhost]

TASK [facts : set user variable] **************************************************************
ok: [localhost]

TASK [base : Install system packages dependencies] ********************************************
ok: [localhost]

TASK [base : create the postgresql user named paul] *******************************************
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: il est nécessaire de saisir un mot de passe\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
    to retry, use: --limit @/home/paul/publik-devinst/install.retry

PLAY RECAP ************************************************************************************
localhost                  : ok=4    changed=1    unreachable=0    failed=1   

Historique

#1

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

  • Statut changé de Nouveau à Rejeté

RTFM :) : https://doc-publik.entrouvert.com/dev/installation-developpeur/

$ ansible-playbook -i tenants-inventory.yml -K install.yml
#2

Mis à jour par Paul Marillonnet il y a environ 5 ans

Merci...

#3

Mis à jour par Emmanuel Cazenave il y a environ 5 ans

  • Sujet changé de Le playbook d'installation ne demande pas le mot de passe sudo à Le playbook d'installation échoue si lancée par un sudoers NOPASSWD
  • Statut changé de Rejeté à Nouveau

Et donc en fait puisque ton utilisateur est un 'sudoers NOPASSWD', la commande devrait passer tel quelle je pense, sans le -K qui n'a aucun sens dans cette situation.

Et là tu tombes peut-être là dedans, à creuser : https://github.com/ansible/ansible/issues/14022.

#4

Mis à jour par Paul Marillonnet il y a environ 5 ans

Bizarre bizarre, je ne comprends plus.

paul@amok:~/publik-devinst$ su
Mot de passe : 
root@amok:/home/paul/publik-devinst# exit
paul@amok:~/publik-devinst$ ansible-playbook -K -i tenants-inventory.yml --become-method=su install.yml
SU password: 

PLAY [publik multitenants installation] *******************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************
ok: [localhost]

TASK [facts : guess username (can be overidden in options/inventory)] *************************************************************************************************************************
changed: [localhost -> localhost]

TASK [facts : set user variable] **************************************************************************************************************************************************************
ok: [localhost]

TASK [base : Install system packages dependencies] ********************************************************************************************************************************************
ok: [localhost]

TASK [base : create the postgresql user named paul] *******************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "su: Échec d'authentification\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
    to retry, use: --limit @/home/paul/publik-devinst/install.retry

PLAY RECAP ************************************************************************************************************************************************************************************
localhost                  : ok=4    changed=1    unreachable=0    failed=1 
#5

Mis à jour par Paul Marillonnet il y a environ 2 ans

  • Statut changé de Nouveau à Fermé
  • Planning mis à Non

la structure du playbook a beaucoup bougé depuis, je ne reproduis plus, je ferme le ticket.

Formats disponibles : Atom PDF