Vagrant、Ansible 和 MySql:错误!任务中未检测到任何操作。这通常表示模块名称拼写错误或模块路径不正确

Vagrant, Ansible and MySql: ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path

我正在处理 Symfony 中的一个项目。它带有一个 Vagrant 文件。当我 vagrant up 时,结果是这样的:

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/home/chris/Projects/TechAnalyzePlatform/deploy/ansible/roles/db/tasks/mysql.yml': line 16, column 5, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# http://ansible.cc/docs/modules.html#mysql-user - name: update mysql root password for all root accounts ^ here

Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

mysql.yml 文件包含以下内容:

---
# MySQL setup
  - name: Install MySQL/MariaDB
    action: yum name={{ item }}
    with_items:
      - MySQL-python
      - perl-Cache-Cache
      - mariadb
      - mariadb-server

  - name: Start the MySQL service
    action: service name=mariadb state=started enabled=yes

  # 'localhost' needs to be the last item for idempotency, see
  # http://ansible.cc/docs/modules.html#mysql-user
  - name: update mysql root password for all root accounts
    mysql_user: name=root host={{ item }} password=admin priv=*.*:ALL,GRANT
    with_items:
      - "{{ ansible_hostname }}"
      - 127.0.0.1
      - ::1
      - localhost

  - name: create /.my.cnf
    template: src=my.cnf dest=~/.my.cnf

该模块存在,我应该在那里插入什么样的动作?什么会导致这种情况?

非常感谢

解决方案:更新 Ansible。已解决。