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

linode module: "name" parameter required, but documentation says it isn't #29785

Closed
ansibot opened this issue Sep 12, 2017 · 4 comments
Closed
Labels
affects_2.1 This issue/PR affects Ansible v2.1 cloud docs This issue/PR relates to or includes documentation. linode https://github.com/ansible/community/wiki/Linode module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@ansibot
Copy link
Contributor

ansibot commented Sep 12, 2017

From @skyfaller on 2016-06-06T11:12:57Z

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

linode module

ANSIBLE VERSION
ansible 2.1.0.0
  config file = 
  configured module search path = Default w/o overrides
CONFIGURATION
OS / ENVIRONMENT

Running Ansible from OS X 10.11.5

SUMMARY

The documentation for the linode module at http://docs.ansible.com/ansible/linode_module.html claims that the "name" parameter is not required, but I seem to be unable to successfully use the linode module without it, it says "name is required for active state".

(P.S. I don't actually understand what value the "name" parameter should have, but using my server's hostname "caprice" makes the playbook run fine. What is the purpose of the "name" parameter, and how is it different from the "linode_id" parameter?)

STEPS TO REPRODUCE

Here's a sample playbook named "reboot.yml":


---

- hosts: caprice
  tasks:
  - name: Reboot the server
    local_action:
      module: linode
      api_key: "{{ linode_api_key }}"
#      name: caprice
      linode_id: "{{ linode_id }}"
      state: restarted
EXPECTED RESULTS

I expected the playbook to run successfully without the "name" parameter.

ACTUAL RESULTS
Vin:ansible nelson$ ansible-playbook reboot.yml --ask-vault-pass -vvvv
No config file found; using defaults
Vault password: 
Loaded callback default of type stdout, v2.0

PLAYBOOK: reboot.yml ***********************************************************
1 plays in reboot.yml

PLAY [caprice] *****************************************************************

TASK [setup] *******************************************************************
<caprice> ESTABLISH SSH CONNECTION FOR USER: None
<caprice> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/nelson/.ansible/cp/ansible-ssh-%h-%p-%r caprice '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465211261.42-104881048472456 `" && echo ansible-tmp-1465211261.42-104881048472456="` echo $HOME/.ansible/tmp/ansible-tmp-1465211261.42-104881048472456 `" ) && sleep 0'"'"''
<caprice> PUT /var/folders/wj/fj_s9pp157xb_c7hb_r91rtm0000gn/T/tmpjrQJWt TO /home/nelson/.ansible/tmp/ansible-tmp-1465211261.42-104881048472456/setup
<caprice> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/nelson/.ansible/cp/ansible-ssh-%h-%p-%r '[caprice]'
<caprice> ESTABLISH SSH CONNECTION FOR USER: None
<caprice> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/nelson/.ansible/cp/ansible-ssh-%h-%p-%r -tt caprice '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/nelson/.ansible/tmp/ansible-tmp-1465211261.42-104881048472456/setup; rm -rf "/home/nelson/.ansible/tmp/ansible-tmp-1465211261.42-104881048472456/" > /dev/null 2>&1 && sleep 0'"'"''
ok: [caprice]

TASK [Reboot the server] *******************************************************
task path: /Users/nelson/Code/server_documents/ansible/reboot.yml:5
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: nelson
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1465211263.04-60988620546823 `" && echo ansible-tmp-1465211263.04-60988620546823="` echo $HOME/.ansible/tmp/ansible-tmp-1465211263.04-60988620546823 `" ) && sleep 0'
<localhost> PUT /var/folders/wj/fj_s9pp157xb_c7hb_r91rtm0000gn/T/tmpMBOJkL TO /Users/nelson/.ansible/tmp/ansible-tmp-1465211263.04-60988620546823/linode
<localhost> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/nelson/.ansible/tmp/ansible-tmp-1465211263.04-60988620546823/linode; rm -rf "/Users/nelson/.ansible/tmp/ansible-tmp-1465211263.04-60988620546823/" > /dev/null 2>&1 && sleep 0'
fatal: [caprice -> localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"api_key": "vMQG7JAhCOKxDkVogfBVMg6vMwxiow0P0Q2Pt4XSOb566Bvt6yKFFhuDyBzGYw6V", "datacenter": null, "distribution": null, "linode_id": 1814698, "name": null, "password": null, "payment_term": 1, "plan": null, "ssh_pub_key": null, "state": "restarted", "swap": 512, "wait": true, "wait_timeout": "300"}, "module_name": "linode"}, "msg": "name is required for active state"}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @reboot.retry

PLAY RECAP *********************************************************************
caprice                    : ok=1    changed=0    unreachable=0    failed=1   

Vin:ansible nelson$ 

Copied from original issue: ansible/ansible-modules-core#3873

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @alikins on 2016-06-06T11:12:57Z

Looking at the code https://github.com/ansible/ansible-modules-core/blob/devel/cloud/linode/linode.py#L406-L422 ,
I see where the error is coming from.

However, I don't see why name is required there.
Looks like a bug to me.

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

@ansibot ansibot added cloud docs_report module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 12, 2017
@ansibot ansibot added docs This issue/PR relates to or includes documentation. and removed docs_report labels Mar 1, 2018
@decentral1se
Copy link
Contributor

I hope the OP of this is aware that they dropped the Linode API key into the report!

decentral1se added a commit to decentral1se/ansible that referenced this issue Aug 26, 2018
@decentral1se
Copy link
Contributor

Submitted #44699 for this 👍

@resmo resmo closed this as completed in fbcdf8b Aug 30, 2018
@dagwieers dagwieers added the linode https://github.com/ansible/community/wiki/Linode label Jan 31, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.1 This issue/PR affects Ansible v2.1 cloud docs This issue/PR relates to or includes documentation. linode https://github.com/ansible/community/wiki/Linode module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

3 participants