- hosts: [rabbitmq] sudo: yes tasks: - shell: docker exec -i {{rabbitmq.name}} /usr/sbin/rabbitmqctl delete_user {{user.name}} run_once: true - hosts: [mariadb] sudo: yes tasks: - command: docker exec -t {{mariadb.name}} \ mysql -uroot -e "DROP USER '{{user.name}}'"