THanks Felix for quick response. It is still giving an error* Method not 
found-*

*I updated my playbook-*
[root@localhost ansible-content]# cat playbook-Create_User.yml
---
- name: Create new user account
  hosts: all
  tasks:
    - junipernetworks.junos.junos_user:
        name: testusr
        role: super-user
        state: present

*It is giving error as-*

[root@localhost ansible-content]# ansible-playbook playbook-Create_User.yml
[WARNING]: ansible.utils.display.initialize_locale has not been called, 
this may result in incorrectly calculated text widths
that can cause Display to print incorrect line lengths

PLAY [Create new user account] 
**************************************************************************************************

TASK [Gathering Facts] 
**********************************************************************************************************
ok: [vMX]
ok: [vMX_RE]
ok: [vQFX]

TASK [junipernetworks.junos.junos_user] 
*****************************************************************************************
fatal: [vMX]: FAILED! => {"changed": false, "module_stderr": "", 
"module_stdout": "\n{\"failed\": true, \"msg\": \"*Method not found*\", 
\"invocation\": {\"module_args\": {\"name\": \"testusr\", \"role\": 
\"super-user\", \"state\": \"present\", \"purge\": false, \"active\": true, 
\"aggregate\": null, \"full_name\": null, \"encrypted_password\": null, 
\"sshkey\": null, \"provider\": null}}}\n\n{\"failed\": true, \"msg\": 
\"Method not found\", \"invocation\": {\"module_args\": {\"name\": 
\"testusr\", \"role\": \"super-user\", \"state\": \"present\", \"purge\": 
false, \"active\": true, \"aggregate\": null, \"full_name\": null, 
\"encrypted_password\": null, \"sshkey\": null, \"provider\": null}}}\n", 
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
fatal: [vQFX]: FAILED! => {"changed": false, "module_stderr": "", 
"module_stdout": "\n{\"failed\": true, \"msg\": \"Method not found\", 
\"invocation\": {\"module_args\": {\"name\": \"testusr\", \"role\": 
\"super-user\", \"state\": \"present\", \"purge\": false, \"active\": true, 
\"aggregate\": null, \"full_name\": null, \"encrypted_password\": null, 
\"sshkey\": null, \"provider\": null}}}\n\n{\"failed\": true, \"msg\": 
\"Method not found\", \"invocation\": {\"module_args\": {\"name\": 
\"testusr\", \"role\": \"super-user\", \"state\": \"present\", \"purge\": 
false, \"active\": true, \"aggregate\": null, \"full_name\": null, 
\"encrypted_password\": null, \"sshkey\": null, \"provider\": null}}}\n", 
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
fatal: [vMX_RE]: FAILED! => {"changed": false, "module_stderr": "", 
"module_stdout": "\n{\"failed\": true, \"msg\": \"Method not found\", 
\"invocation\": {\"module_args\": {\"name\": \"testusr\", \"role\": 
\"super-user\", \"state\": \"present\", \"purge\": false, \"active\": true, 
\"aggregate\": null, \"full_name\": null, \"encrypted_password\": null, 
\"sshkey\": null, \"provider\": null}}}\n\n{\"failed\": true, \"msg\": 
\"Method not found\", \"invocation\": {\"module_args\": {\"name\": 
\"testusr\", \"role\": \"super-user\", \"state\": \"present\", \"purge\": 
false, \"active\": true, \"aggregate\": null, \"full_name\": null, 
\"encrypted_password\": null, \"sshkey\": null, \"provider\": null}}}\n", 
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Thanks,
Nish
On Wednesday, December 22, 2021 at 2:22:12 PM UTC-8 Felix Fontein wrote:

> Hi,
>
> > *[root@localhost ansible-content]# cat playbook-Create_User.yml----
> > name: Create new user account hosts: all #connection: local 
> > junipernetworks.junos.junos_user: name: ansibleusr role:
> > super-user state: present*
>
> you need to use the `tasks:` keyword and move the actual task into
> there. This is not a valid playbook (with or without collections).
>
> Something like:
>
> - hosts: all
> tasks:
> - junipernetworks.junos.junos_user:
> name: ansibleusr
> role: super-user
> state: present
>
> Cheers,
> Felix
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f75a250a-0e40-464f-9b18-1256ea2d99b0n%40googlegroups.com.

Reply via email to