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

Error when run with ansible 2.2 #4

Closed
goetzk opened this issue Apr 13, 2017 · 5 comments
Closed

Error when run with ansible 2.2 #4

goetzk opened this issue Apr 13, 2017 · 5 comments

Comments

@goetzk
Copy link
Contributor

goetzk commented Apr 13, 2017

Hi,
Ansible 2.1+ have a bug in their library handling.
ansible/ansible#16561
The error returned is

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

The error appears to have been in '/Users/kgoetz/server-configuration-management/tproles/franklinkim.ssh/tasks/known_hosts.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Registering known hosts
  ^ here

The work around/fix mentioned in the referenced bug report (updating your library path) worked for me so I would like to request it is added to the readme for the module.

 ansible-playbook --version
ansible-playbook 2.2.1.0
  config file = /Users/kgoetz/server-configuration-management/ansible.cfg
  configured module search path = ['/opt/local/share/ansible', './library']

thanks,

@franklinkim
Copy link
Member

Hi, thanks for the head's up! I added a note to the README and keeping this open till it's been fixed on ansibles side.

@goetzk
Copy link
Contributor Author

goetzk commented Apr 13, 2017 via email

@onny
Copy link

onny commented Mar 10, 2018

Somehow the fix doesn't work for me:

$ cat ansible.cfg 
[defaults]
library = /usr/share/ansible:library
$ ansible-playbook --version
ansible-playbook 2.4.3.0
  config file = /home/onny/projects/ansible-piradio/ansible.cfg
  configured module search path = [u'/usr/share/ansible', u'/home/onny/projects/ansible-piradio/library']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.14 (default, Jan  5 2018, 10:41:29) [GCC 7.2.1 20171224]
$ ansible-playbook -i hosts -v piradio.yml --ask-become-pass --vault-password-file ~/.ansible_vault_pw
Using /home/onny/projects/ansible-piradio/ansible.cfg as config file
SUDO password: 

PLAY [all] *************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************
ok: [192.168.178.3]

TASK [franklinkim.ssh : Include OS-specific variables.] ****************************************************************************************************************************************************
ok: [192.168.178.3] => {"ansible_facts": {"openssh_packages": ["openssh"]}, "ansible_included_var_files": ["/home/onny/.ansible/roles/franklinkim.ssh/vars/Archlinux.yml"], "changed": false}

TASK [franklinkim.ssh : include_tasks] *********************************************************************************************************************************************************************
included: /home/onny/.ansible/roles/franklinkim.ssh/tasks/install.yml for 192.168.178.3

TASK [franklinkim.ssh : Installing packages] ***************************************************************************************************************************************************************
ok: [192.168.178.3] => (item=openssh) => {"changed": false, "item": "openssh", "msg": "package(s) already installed. "}

TASK [franklinkim.ssh : include_tasks] *********************************************************************************************************************************************************************
included: /home/onny/.ansible/roles/franklinkim.ssh/tasks/config.yml for 192.168.178.3

TASK [franklinkim.ssh : Configuring sshd] ******************************************************************************************************************************************************************
ok: [192.168.178.3] => {"changed": false, "checksum": "ea22e7fbdb3eb5b2acdf258e3961bb603921732c", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/ssh/sshd_config", "size": 2423, "state": "file", "uid": 0}

TASK [franklinkim.ssh : include_tasks] *********************************************************************************************************************************************************************
fatal: [192.168.178.3]: FAILED! => {"reason": "no action detected in task. This often indicates a misspelled module name, or incorrect module path.\n\nThe error appears to have been in '/home/onny/.ansible/roles/franklinkim.ssh/tasks/known_hosts.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Registering known hosts\n  ^ here\n\n\nThe error appears to have been in '/home/onny/.ansible/roles/franklinkim.ssh/tasks/known_hosts.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Registering known hosts\n  ^ here\n\nexception type: <class 'ansible.errors.AnsibleParserError'>\nexception: no action detected in task. This often indicates a misspelled module name, or incorrect module path.\n\nThe error appears to have been in '/home/onny/.ansible/roles/franklinkim.ssh/tasks/known_hosts.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Registering known hosts\n  ^ here\n"}
	to retry, use: --limit @/home/onny/projects/ansible-piradio/piradio.retry

PLAY RECAP *************************************************************************************************************************************************************************************************
192.168.178.3              : ok=6    changed=0    unreachable=0    failed=1   

Best regards,
Jonas

@franklinkim
Copy link
Member

@onny have you downloaded the sshknownhosts module into your library folder?

@goetzk
Copy link
Contributor Author

goetzk commented Sep 27, 2019

I've just opened PR #8 to (re)add sshknownhosts to the README file in the Dependencies section. This essentially replaces the text whih was removed in bad407d to match the Ansible upstream policy that the current behaviour is as expected (it was added but then removed again during cleanup).

As a result of upstream closing their issue I'm going to mark this closed - the ticket was supposed to be temporary in nature due to upstreams bug - and I'll hope PR 8 is merged to draw attention to this issue separately.

@goetzk goetzk closed this as completed Sep 27, 2019
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

3 participants