Hi,

I believe the issue may be the missing "tasks:" from the example, 

It should be written as


 vars:
  cli:
    host: "{{ inventory_hostname }}"
    username: cisco
    password: cisco
    authorize: yes
    auth_pass: cisco
    transport: cli

tasks:
  - asa_command:
      commands:
        - show version
      provider: "{{ cli }}"

  - asa_command:
      commands:
        - show asp drop
        - show memory
      provider: "{{ cli }}"

  - asa_command:
      commands:
        - show version
      provider: "{{ cli }}"
      context: system




I'll update the module documentation.

Ansible 2.2 has been officially released 
now 
https://www.ansible.com/press/ansible-22-delivers-new-automation-capabilities-for-containers-networks-and-cloud

Kind regards,
John Barker

On Tuesday, 8 November 2016 16:44:24 UTC, Tony Reveal wrote:
>
> I'm still looking for an answer on this.  I still get a message that 
> "asa_command is not a valid attribute for a play".  I've even cloned the 
> modules-extras repo and included the local repository in my ansible.cfg.  
> Even going so far as to specify the ASA directory:
>
> tony@ansible:/etc/ansible/playbooks$ ansible --version
> ansible 2.2.0.0
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> ['/etc/ansible/ansible-modules-extras/network/asa/']
>
>
> I've even tried using one of the examples:
>
> ---
> - vars:
>     cli:
>       host: 192.168.0.1
>       authorize: yes
>       username: cisco
>       password: cisco
>       transport: cli
>
> - asa_command:
>     commands:
>       - sh ver
>     provider: "{{ cli }}"
>
>
> On Wednesday, June 1, 2016 at 1:59:34 AM UTC-5, Ludi Fang wrote:
>>
>> *I could login the cisco device with SSH and run the show version 
>> successfully.*
>>
>> -----------------------------------------------------------------------------------------------------------------
>> [root@peklnelh03 ansible]# ssh [email protected]
>> [email protected]'s password: 
>> **********************************************************************
>> This is a private property facility to be accessed and used for Lenovo
>> internal systems. Unauthorized Access Prohibited!
>> **********************************************************************
>> ***********************************************************************
>> *  Warning Notice:                                                    *
>> *    ip verify reverse-path interface is not supported      *
>> Type help or '?' for a list of available commands.
>> CNSHPFW5510-01> show version
>>
>> Cisco Adaptive Security Appliance Software Version 8.2(5)51 
>> Device Manager Version 5.2(4)
>>
>> ---------------------------------------------------------------------------------------------------------------------
>> *However, I run the ios_command with ansible, I got this error:*
>>
>>
>> *------------------------------------------------------------------------------------------------------------------------------------*
>> TASK [ios_command] 
>> *************************************************************
>> fatal: [10.106.65.xxx]: FAILED! => {"changed": false, "commands": 
>> "terminal length 0", "failed": true, "msg": "terminal length 0\r\n         
>>         ^\r\nERROR: % Invalid input detected at '^' marker.\r\n\r> "}
>>
>> - hosts: ios
>>   gather_facts: no
>>   connection: local
>>
>>   tasks:
>>   - name: LOGIN
>>     include_vars: secrets.yaml
>>
>>   - name: PROVIDER
>>     set_fact:
>>       provider:
>>         host: "{10.106.65.xxx}"
>>         username: "{xxx}"
>>         password: "{6785493@bcdD}"
>>         auth_pass: "{cisco}"
>>   - ios_command:
>>       host: "10.106.65.xxxxx"
>>       username: "xxxxxx"
>>       password: "6785493@bcdD"
>>       port: "22"
>>       commands:
>>         - show version
>>     register: version
>>   - debug: var=version.stdout_lines
>>
>> ---------------------------------------------------------------------------------------------------------------------
>> *Could someone give me some advice to fix this issue?*
>>
>>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e7f464bb-61f4-416d-8dd4-f1b658dd442b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to