geerlingguy / ansible-role-mysql

Ansible Role - MySQL
https://galaxy.ansible.com/geerlingguy/mysql/
MIT License
1.05k stars 861 forks source link

FAILED! => {"changed": false, "msg": "Could not find the requested service mysql: host"} #521

Open garyyang6 opened 1 year ago

garyyang6 commented 1 year ago

Per https://galaxy.ansible.com/geerlingguy/mysql, I installed the role,

ansible-galaxy install geerlingguy.mysql

playbooks/install_database.yaml:

- hosts: database
  user: ubuntu
  become: yes
  vars_files:
   - ../vars/database.yaml
  roles:
    - role: geerlingguy.mysql

vars/database.yaml

mysql_databases:
  - name: db01
    encoding: utf8mb4
    collation: utf8mb4_unicode_ci
mysql_users:
  - name: linuxhint
    host: "%"
    password: secret
    priv: "db01.*:ALL"

Ran the check command,

ansible-playbook -i hosts playbooks/install_database.yaml -e ansible_python_interpreter=/usr/bin/python3 --check

I got the error,

fatal: [30.10.1.7]: FAILED! => {"changed": false, "msg": "Could not find the requested service mysql: host"}
30.10.1.7                  : ok=18   changed=2    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0
github-actions[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

okaufmann commented 1 year ago

I have the same problem when using with it with a Ubuntu 22.04...

github-actions[bot] commented 8 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

armenr commented 6 months ago

I've got the same exact issue on RockyLinux9 in a docker container being provisioned via Vagrant.

vishwanath69 commented 6 months ago

using ansible-playbook if one of MySQL's SQL scripts fails it does not execute subsequent SQL scripts and immediately ansible stop anyone having code please share me

github-actions[bot] commented 2 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

vz000 commented 1 month ago

Faced a similar issue, but in case someone else stumbles on this problem getting the same error message: make sure the right mysql packages are correctly installed.