'netconf_config' is not a valid attribute for a Play

82 views
Skip to first unread message

Armstrong Soo

unread,
Mar 22, 2018, 3:22:02 PM3/22/18
to Ansible Project
Hi all, I am testing a very simple playbook for netconf and I didn't get very far. What did I do wrong?


ERROR! 'netconf_config' is not a valid attribute for a Play

The error appears to have been in '/home/as2618/FSL/main.yaml': line 1, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Add Netconf User
  ^ here

This is the content of the playbook:

xxxxx@ansi0003vm001:~/FSL$ cat -T main.yaml
- name: Add Netconf User
  netconf_config:
    host: 192.168.0.100
    username: root
    password: hellothere
    xml: |
          <?xml version="1.0" encoding="UTF-8"?>
          <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
               <capabilities>
                        <capability>urn:ietf:params:netconf:base:1.0</capability>
                        <capability>urn:com:dingdong:ebase:1.1.0</capability>
               </capabilities>
          </hello>
          ]]>]]>

Thanks!

Kai Stian Olstad

unread,
Mar 22, 2018, 3:32:43 PM3/22/18
to ansible...@googlegroups.com
That is not a playbook, I suggest reading the documentation and a good start is this one
https://docs.ansible.com/ansible/latest/playbooks_intro.html

--
Kai Stian Olstad

Armstrong Soo

unread,
Mar 22, 2018, 5:01:28 PM3/22/18
to ansible...@googlegroups.com
I thought I am following the example of http://docs.ansible.com/ansible/latest/netconf_config_module.html


--
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/4wR1vPdfQpM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1900306.PCMuUXU3K0%40x1.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
Mar 22, 2018, 5:05:23 PM3/22/18
to Ansible Project
Most module examples are 'specific tasks', they are supposed to be in
the context of a play and playbook.

If you are unclear on what that is, i suggest starting at
http://docs.ansible.com/ansible/latest/intro.html



--
----------
Brian Coca

Armstrong Soo

unread,
Mar 22, 2018, 10:37:26 PM3/22/18
to ansible...@googlegroups.com
Thanks all. If I understand the Playbook Intro correctly, I changed the playbook to

xxxxx@ansi0003vm001:~/FSL$ cat -T main.yaml
---

- name: Add Netconf User
  netconf_config:
  host: 192.168.0.100
  username: root
  password: hellothere
  xml: |
        <?xml version="1.0" encoding="UTF-8"?>
        <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
             <capabilities>
                      <capability>urn:ietf:params:netconf:base:1.0</capability>
                      <capability>urn:com:dingdong:ebase:1.1.0</capability>
             </capabilities>
        </hello>
        ]]>]]>

I get this message.

xxxxx@ansi0003vm001:~/FSL$ ansible-playbook main.yaml
 [WARNING]: Could not match supplied host pattern, ignoring: all

 [WARNING]: provided hosts list is empty, only localhost is available

ERROR! 'username' is not a valid attribute for a Play

The error appears to have been in '/home/xxxxx/FSL/main.yaml': line 2, column 3, but may

be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---

- name: Add Netconf User
  ^ here
--
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/4wR1vPdfQpM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages