2 votes

Ansible ne parvient pas à redémarrer le service - pourquoi ?

J'essaie ceci sur une instance EC2 d'AWS exécutant Ubuntu 14.04.
J'ai une tâche qui notifie un gestionnaire. Lorsque le gestionnaire est exécuté, j'obtiens une erreur. J'ai du mal à comprendre le message d'erreur et je ne peux donc pas le déboguer.

La tâche :

- name: Set post_max_size to 100M
  sudo: yes
  lineinfile: dest=/etc/php5/fpm/php.ini regexp='^;?post_max_size =' line='post_max_size = 100M'
  notify:
    - restart php5-fpm

Les manipulateurs

---
- name: start php5-fpm
  service: name=php5-fpm state=started

- name: restart php5-fpm
  service: name=php5-fpm state=restarted

L'erreur que je reçois

NOTIFIED: [php | restart php5-fpm] ********************************************
<54.154.82.195> ESTABLISH CONNECTION FOR USER: ubuntu
<54.154.82.195> REMOTE_MODULE service name=php5-fpm state=restarted
<54.154.82.195> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 54.154.82.195 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998 && echo $HOME/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998'
<52.16.161.67> ESTABLISH CONNECTION FOR USER: ubuntu
<52.16.161.67> REMOTE_MODULE service name=php5-fpm state=restarted
<52.16.161.67> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 52.16.161.67 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917 && echo $HOME/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917'
<52.16.161.67> PUT /tmp/tmpyZ8NZb TO /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917/service
<54.154.82.195> PUT /tmp/tmp67pMQt TO /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998/service
<52.16.161.67> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 52.16.161.67 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=pkjcazbngchlcujcryxpjhqvysuogqdq] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-pkjcazbngchlcujcryxpjhqvysuogqdq; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917/service; rm -rf /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-159732570027917/ >/dev/null 2>&1'"'"''
<54.154.82.195> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 54.154.82.195 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=kmaknhfrafsrngyemkpxdkifpezqbtui] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-kmaknhfrafsrngyemkpxdkifpezqbtui; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998/service; rm -rf /home/ubuntu/.ansible/tmp/ansible-tmp-1433866104.51-11364253366998/ >/dev/null 2>&1'"'"''
failed: [54.154.82.195] => {"failed": true}
failed: [52.16.161.67] => {"failed": true}

4voto

Repox Points 235

Il semble que ce soit un bug lié à la version 1.9.1 d'Ansible.

https://github.com/ansible/ansible-modules-core/issues/1170

Parcheando avec le patch suggéré et tout a fonctionné.

SistemesEz.com

SystemesEZ est une communauté de sysadmins où vous pouvez résoudre vos problèmes et vos doutes. Vous pouvez consulter les questions des autres sysadmins, poser vos propres questions ou résoudre celles des autres.

Powered by:

X