Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stwind opened this issue Dec 25, 2013 · 7 comments

Comments

@stwind
Copy link
Contributor

stwind commented Dec 25, 2013

$ 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
Copy link

pinterb commented Jan 3, 2014

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

@srgvg
Copy link

srgvg commented Jan 5, 2014

Same here, both 1.4 and 1.5

@bennojoy
Copy link
Owner

bennojoy commented Jan 6, 2014

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

@bennojoy bennojoy closed this as completed Jan 6, 2014
@ringe
Copy link

ringe commented Jan 31, 2014

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
Copy link

ringe commented Jan 31, 2014

Commenting out lineinfile tasks makes no difference.

@ringe
Copy link

ringe commented Jan 31, 2014

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
Copy link

ringe commented Jan 31, 2014

I'm really sorry. I'm in the wrong repo. 🌴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants