bennojoy / mysql

ansible role for mysql
150 stars 137 forks source link

Got "host is not a legal parameter in an Ansible task or handler" with ansible 1.4.3 #2

Closed stwind closed 10 years ago

stwind commented 10 years ago
$ ansible-playbook ansible/site.yml -vvvv
ERROR: host is not a legal parameter in an Ansible task or handler

$ cat ansible/site.yml

---
- hosts: mysql-servers
  sudo: true
  roles:
  - bennojoy.mysql

$ ansible --version
ansible 1.4.3

when commented out main.yml:77, it is working fine

  #host: ip={{ hostvars[mysql_repl_master].ansible_default_ipv4.address }} hostname={{ mysql_repl_master }} state=present
pinterb commented 10 years ago

I was able to reproduce this error while running against ansible 1.5 (devel 89abc35e59)

srgvg commented 10 years ago

Same here, both 1.4 and 1.5

bennojoy commented 10 years ago

Sorry for the delay.. It is fixed now.. the host module had been removed from core as it had soem issues, so it is now replaced with lineinfile

ringe commented 10 years ago

What do you mean it's fixed?

$ ansible --version
ansible 1.4.4
$ ansible-playbook site.yml 
ERROR: hosts is not a legal parameter in an Ansible task or handler

Playbook:

---
# file: site.yml
- hosts: peers
  roles:
  - common
  - peer
  sudo: true
  vars_files:
    - passwords.yml
ringe commented 10 years ago

Commenting out lineinfile tasks makes no difference.

ringe commented 10 years ago

Removed hosts: from site.yml:

$ ansible-playbook site.yml 
ERROR: hosts declaration is required

This is very confusing, since I'm trying to literally follow the guide: http://docs.ansible.com/playbooks_best_practices.html#directory-layout

ringe commented 10 years ago

I'm really sorry. I'm in the wrong repo. :palm_tree: