You need one more space in front of your "commands:".
This is correct:
- hosts: 192.168.0.1
gather_facts: False
connection: local
tasks:
- asa_command:
commands:
- sh ver
A YAML parser like http://yaml-online-parser.appspot.com/ is super helpful
in debugging little syntax things like that sometimes.
On Thursday, August 4, 2016 at 11:45:33 AM UTC-4, Tony Reveal wrote:
>
> Well I apologize. I found an ASA module that uses the REST API and that
> is the module I was referring to. I found the asa_command module you're
> referring to and ha I've tried it. Basically I replaced ios_command with
> asa_command and command with commands. The playbook will not run.
>
> Can you provide a good known working playbook example?
>
> YAML:
>
> ---
> # Connect to ASA and run Show Version command
>
> - hosts: 192.168.0.1
> gather_facts: False
> connection: local
>
> tasks:
> - asa_command:
> commands:
> - sh ver
> ...
>
> RESULTS:
>
> ERROR! no action detected in task. This often indicates a misspelled
> module name, or incorrect module path.
>
> The error appears to have been in
> '/etc/ansible/playbooks/asaShowVersion.yml': line 9, column 7, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> tasks:
> - asa_command:
> ^ here
>
>
> The error appears to have been in
> '/etc/ansible/playbooks/asaShowVersion.yml': line 9, column 7, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> tasks:
> - asa_command:
> ^ here
>
>
>
> On Wed, Aug 3, 2016 at 7:38 AM, Peter Sprygada <[email protected]
> <javascript:>> wrote:
>
>> The ASA modules in extras are CLI based not REST based so there is no
>> dependency on REST API. Not sure about the 9.3 requirement, I don't see
>> that anywhere in the module docstring.
>>
>> Agreed that the modules are currently part of devel and not ready for
>> production use yet (as in still be tested) but going down the path of force
>> fitting ios_command to fill that role is no more or no less ready for
>> production as it isn't tested against ASA devices
>>
>> On Fri, Jul 22, 2016 at 5:54 PM, Tony Reveal <[email protected]
>> <javascript:>> wrote:
>>
>>> Yes, there are ASA specific modules. But those modules require ASA v9.3
>>> and use Cisco's REST API introduced in ASA v9.3. For anyone not wishing to
>>> use the REST API or who does not have ASA v9.3, those ASA modules do not
>>> work. In addition, it doesn't appear that those modules are ready for
>>> "production" use yet. According to the developer on his own website - he
>>> is still testing, asking for help testing, He's still finding bugs (normal
>>> even after release). Some his own, and some are bugs in Cisco's REST API.
>>>
>>> Now - to post what I found wrong because you didn't publish it the first
>>> time....
>>>
>>> Ansible's ios_command module tries to run the command "terminal length
>>> 0" to disable breaks which would require the user to interact and
>>> "continue" the output. The problem with this is that the "terminal length
>>> 0" command only works on Cisco routers and switches. The appropriate
>>> command for an ASA is "terminal pager 0".
>>>
>>>
>>> On Friday, July 22, 2016 at 2:01:14 PM UTC-5, Peter Sprygada wrote:
>>>>
>>>> There are now ASA specific modules available in extras (
>>>> https://github.com/ansible/ansible-modules-extras/tree/devel/network/asa)
>>>> I would recommend using those for management of ASA devices.
>>>>
>>>> On Fri, Jul 22, 2016 at 12:25 PM, Tony Reveal <[email protected]> wrote:
>>>>
>>>>> Did you ever find a fix for this? I'm seeing the same error when
>>>>> connecting to an ASA 5505.
>>>>>
>>>>>
>>>>> 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/5cc05fda-51a7-4b68-b24d-e47acdd2aff3%40googlegroups.com
>>>>>
>>>>> <https://groups.google.com/d/msgid/ansible-project/5cc05fda-51a7-4b68-b24d-e47acdd2aff3%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected]
>>> <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/f44e9703-4f55-4824-8441-2ecb8e801f3c%40googlegroups.com
>>>
>>> <https://groups.google.com/d/msgid/ansible-project/f44e9703-4f55-4824-8441-2ecb8e801f3c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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/QWMQJCUavV0/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAEkdrMhS_fGecOVEh5a9R%3D0vuGAUwJabgozG6x7mb1431SNfyA%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/CAEkdrMhS_fGecOVEh5a9R%3D0vuGAUwJabgozG6x7mb1431SNfyA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
NOTICE: The information contained in this email may be confidential,
proprietary and/or legally privileged. It has been sent for the sole use of
the intended recipient(s). If the reader of this message is not an intended
recipient, you are hereby notified that any unauthorized review, use,
disclosure, dissemination, distribution, or copying of this communication,
or any of its contents, is strictly prohibited. If you have received this
communication in error, please reply to the sender and destroy all copies
of the message. Thank you.
--
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/b669ca68-3385-485f-96b1-a99c9f99dc26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.