linode_module not working

51 views
Skip to first unread message

Michael Bushey

unread,
Mar 18, 2015, 2:38:02 PM3/18/15
to ansible...@googlegroups.com
I'm attempting to use the first example on page: http://docs.ansible.com/linode_module.html

⇒ ansible-playbook --version
ansible-playbook 1.7.2

⇒ ansible-playbook -i ../hosts create_web.yml
ERROR: datacenter is not a legal parameter at this level in an Ansible Playbook

 ⇒ cat create_web.yml 
---
- local_action:
  module: linode
  api_key: 'Myapikeyishere'
  name: web1
  plan: 2
  datacenter: 2
  distribution: 130
  password: 'mypasword'

any ideas?


Dan Vaida

unread,
Mar 22, 2015, 4:53:57 PM3/22/15
to ansible...@googlegroups.com
You're missing indentation. Take a look at the examples on the module page.

Michael Bushey

unread,
Mar 23, 2015, 1:14:40 PM3/23/15
to ansible-project
Dan,

Thanks for your response. Since you feel my spacing is wrong, please
let me know what is wrong. Proving a link to yaml spacing whitepaper
is not helping. How do you propose that incorrect spacing will result
in the error of "ERROR: datacenter is not a legal parameter at this
level in an Ansible Playbook"? Typically spacing errors result in
something like "ERROR: Syntax Error while loading YAML script".

Michael
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/0S1OeNZj_Qk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/bc512bbb-cabc-442c-b20a-2cbf7ee4d7bc%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Dan Vaida

unread,
Mar 23, 2015, 1:59:16 PM3/23/15
to ansible...@googlegroups.com
Hi Michael,

I'll provide a short example to prove my point (b11be68249):
$ cat whatever.yml
---
- hosts: localhost
  gather_facts: false
  vars:
    foo: bar
  tasks:
  - name: test
    local_action:
    module: copy
    src: ./src
    dest: ./dest

$ ansible-playbook whatever.yml
ERROR: dest is not a legal parameter in an Ansible task or handler

Whereas:
$ cat whatever.yml
---
- hosts: localhost
  gather_facts: false
  vars:
    foo: bar
  tasks:
  - name: test
    local_action:
      module: copy
      src: ./src
      dest: ./dest

$ ansible-playbook whatever.yml

PLAY [localhost] **************************************************************

TASK: [test] ******************************************************************
ok: [localhost -> 127.0.0.1]

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

I'm sorry you feel like that way about the link. I know it's sometimes easy to oversee the local_action attribute. It is mostly used (although it's not the only way) when one calls SDK/APIs through localhost.

Can you perhaps show how and where you include this create_web.yml of yours? Perhaps the scope is not set right.

Cheers,
Dan.

Michael Bushey

unread,
Mar 23, 2015, 4:57:26 PM3/23/15
to ansible-project
Dan,

The second example worked, thank you for taking the time to resolve
this problem! :)
> https://groups.google.com/d/msgid/ansible-project/5febd0d1-9204-4dd1-a505-c3b4788c02e7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages