mysql_db single_transaction breaks import

22 views
Skip to first unread message

Chris Short

unread,
Jun 2, 2016, 9:17:04 AM6/2/16
to Ansible Project
Out of curiosity I have a mysql_db play in a playbook that imports a database into a pre-production environment. I added single_transaction=yes to it and the import never fully finished. Not sure if this is a bug or some external issue but since this is new functionality I'd be willing to aid in testing it.

Johannes Kastl

unread,
Jun 2, 2016, 11:04:03 AM6/2/16
to ansible...@googlegroups.com
Care to share your playbook? And the exact error messages?

Johannes

signature.asc

Chris Short

unread,
Jun 2, 2016, 11:15:37 AM6/2/16
to ansible...@googlegroups.com
---
- name: Sync REDCap Prod Database to Val Environment
  hosts: vml-rdcdb3
  tasks:
    - name: Remove any existing backup
      file: path={{ bu_dir }}/redcap.sql.gz state=absent
      tags:
        - prod

    - name: Create backup of production redcap database
      mysql_db: name=redcap state=dump target={{ bu_dir }}/redcap.sql.gz login_host=127.0.0.1 single_transaction=yes
      tags:
        - prod

    - name: Change ownership on bu_dir (defined in group_vars/REDCAP)
      file: path={{ bu_dir }} owner=ori-ansible group=ori-ansible recurse=yes state=directory
      tags:
        - prod

- hosts: vml-redc2
  tasks:
    - name: Stop httpd for redcap-val.dtmi.duke.edu (vml-redc2)
      service: name=httpd state=stopped
      tags:
        - val

- hosts: vml-rdcdbdev2
  tasks:
    - name: Drop redcap database from val
      mysql_db: name=redcap state=absent login_host=127.0.0.1
      tags:
        - val

    - name: Re-create redcap database for val
      mysql_db: name=redcap state=present login_host=127.0.0.1
      tags:
        - val

    - name: Import redcap database into val
      mysql_db: name=redcap state=import target={{ bu_dir }}/redcap.sql.gz
      tags:
        - val

- hosts: vml-redc2
  tasks:
    - name: Start httpd for redcap-val.dtmi.duke.edu (vml-redc2)
      service: name=httpd state=started
      tags:
        - val

No error message. It just runs and runs and never fails.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/j9MkI-AF2qo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/57504ACF.8050706%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Johannes Kastl

unread,
Jun 2, 2016, 11:18:14 AM6/2/16
to ansible...@googlegroups.com
On 02.06.16 17:14 'Chris Short' via Ansible Project wrote:

> No error message. It just runs and runs and never fails.

I had that sometimes, then I killed the process on the target host,
and voilá I had some error message on the controller running the
ansible task (I run with -v, to get more output).

I would guess it waits for input. Forever.

Johannes

signature.asc
Reply all
Reply to author
Forward
0 new messages