Issue 1:
As discussed in Google Groups

I have a task that imports a db file into mysql but it fails the second time I re-run the playbook.

In order to overcome the failure I need to login to the mysql server and drop the database in order to import successfully in the second play, this is not possible in a production environment and doesn't make my code idempotent. Using the ignore_errors I still get the same problem causing Ansible to stop the execution on the next play and exit .

Task :

- name: import DB
mysql_db: login_host={{ DB_ADDRESS }} login_user={{ DB_MASTER_USERNAME }} login_password={{ DB_MASTER_PASSWORD }} name=mmdb state=import target=roles/mmdb/templates/mmdb-init-tables.sql.j2
ignore_errors: yes

Error message

failed: [localhost] => {"failed": true}
msg: ERROR 1062 (23000) at line 4: Duplicate entry 'CM' for key 'PRIMARY'

Ansible version

ansible 1.4 (devel 6008ea40ee) last updated 2013/11/12 12:34:58 (GMT +000)

In other tasks the "ignore_errors: yes" works just fine but that doesn't seem to be the case for an import failure using the mysql_db module.

Issue 2:
Bug Description:

Simple ansible-playbook indefinitely hangs when using su. This can be repeated indefinitely.

Version affected:

ansible 1.9.1

ansible 1.9.2

Version not affected (using the same script):

ansible 1.6.10

Environment tested on

Linux Redhat/Centos

Python version: 2.6.6

Other details:

The playbook is working fine if su is not used. Root credential is correct.

Using the ping module with su works fine.

The password prompt is "Password:" (without the quotes)

Run details

Playbook

Main file:

name: Install app on my servers

hosts: my_hosts

gather_facts: no

remote_user: my_user

su: yes

roles:

app_install

app_install role (under tasks/main.yml)

name: query whoami

shell: whoami

Log

[PROJECT] myotheruser@myprodserver# ansible-playbook -i hosts -k --ask-su-pass my_playbook.yml -vvvv

SSH password:

SU password[defaults to SSH password]:

PLAY [Install app on my servers] ************************************

TASK: [app_install | query whoami] ***

<my_server.mydomain.com> ESTABLISH CONNECTION FOR USER: my_user on PORT 22 TO my_server.mydomain.com

<my_server.mydomain.com> REMOTE_MODULE command whoami #USE_SHELL

<my_server.mydomain.com> EXEC /bin/sh -c 'mkdir -p /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733 && chmod a+rx /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733 && echo /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733'

<my_server.mydomain.com> PUT /tmp/tmp6UGeFE TO /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command

<my_server.mydomain.com> EXEC /bin/sh -c 'su root -c "/bin/sh -c '"'"'echo BECOME-SUCCESS-xzmbgooensxgrlbezhnlngbagojwbczg; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command; rm -rf /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/ >/dev/null 2>&1'"'"'"'

Extra tests

I have run the command below on the remote server. It is presenting the "Password:" prompt and execute correctly the command.

/bin/sh -c 'su root -c "/bin/sh -c '"'"'echo BECOME-SUCCESS-xzmbgooensxgrlbezhnlngbagojwbczg; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/command; rm -rf /tmp/.ansible_my_user/tmp/ansible-tmp-1438014075.95-221459817104733/ >/dev/null 2>&1'"'"'"

Happy to do any other test if needed