run ansible on arbor appliance

444 views
Skip to first unread message

Asif Iqbal

unread,
Nov 25, 2013, 2:25:29 PM11/25/13
to ansible...@googlegroups.com
Hi All

I am trying to run ansible on arbor appliances.

To run ssh remotely and get data from arbor appliance you will need to run it like this

$ echo "uname -a; exit" | ssh -qtt atl-col-01 shell
uname -a; exit
DIAG> uname -a; exit
Linux atl-col-01 2.6.18-arbux26 #1 SMP PREEMPT Thu Aug 2 16:16:46 EDT 2012 i686 i686 i386 GNU/Linux
exit

OR like this

$ ssh -qtt atl-col-01 shell
DIAG> uname -a
Linux atl-col-01 2.6.18-arbux26 #1 SMP PREEMPT Thu Aug 2 16:16:46 EDT 2012 i686 i686 i386 GNU/Linux
DIAG> exit
exit
$


OR like this

$ ssh -qtt atl-col-01 shell <<EOF
> uname -a
> exit
> EOF
uname -a
exit
DIAG> uname -a
Linux atl-col-01 2.6.18-arbux26 #1 SMP PREEMPT Thu Aug 2 16:16:46 EDT 2012 i686 i686 i386 GNU/Linux
DIAG> exit
exit

I was trying to do the same with playbook

$ cat file.yml
---
- hosts: atl-col-01
  user: admin
  tasks:
  - name: ping it
    local_action: shell 'ping {{ inventory_hostname }}' 
    register: result


$ cat hosts
...
atl-col-01 ansible_python_interpreter=/usr/local/bin/python
...

$ cat ~/.ansible.cfg 
[defaults]
remote_tmp = /tmp

$ ansible-playbook file.yml -i hosts -vvvv

PLAY [atl-col-01] ************************************************************* 

GATHERING FACTS *************************************************************** 
<atl-col-01> ESTABLISH CONNECTION FOR USER: admin
<atl-col-01> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/iqbala/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=admin', '-o', 'ConnectTimeout=10', 'atl-col-01', "/bin/sh -c 'mkdir -p /tmp/ansible-1385407330.54-15863228552079 && chmod a+rx /tmp/ansible-1385407330.54-15863228552079 && echo /tmp/ansible-1385407330.54-15863228552079'"]
<atl-col-01> REMOTE_MODULE setup 
<atl-col-01> PUT /tmp/tmpQ1MvZ1 TO 120: Invalid command/setup
fatal: [atl-col-01] => failed to transfer file to 120: Invalid command/setup:

120: Invalid command


TASK: [ping it] *************************************************************** 
FATAL: no hosts matched or all hosts have already failed -- aborting


PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/iqbala/file.retry

atl-col-01                 : ok=0    changed=0    unreachable=1    failed=0   


Any suggestion how to make it work?

Thanks 

Michael DeHaan

unread,
Nov 25, 2013, 8:10:26 PM11/25/13
to ansible...@googlegroups.com
I'm not familiar with Arbor Networks internals personally

Possible options:

try scp instead of SFTP in ansible.cfg
see if you can configure something to give you a login shell
just use "raw" commands
see if there's a API and do something closer to what's done with the Arista and F5 modules

etc?






--
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 ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Asif Iqbal

unread,
Nov 26, 2013, 8:28:20 AM11/26/13
to ansible...@googlegroups.com
Once you ssh to arbor, you will need to type shell to get a bash shell. From there it is pure linux.

Michael DeHaan

unread,
Nov 26, 2013, 8:58:01 AM11/26/13
to ansible...@googlegroups.com
Yeah that's not really going to work well in current state, because the system won't know to run the "shell" command.

There's no way to configure a regular shell account?





On Tue, Nov 26, 2013 at 8:28 AM, Asif Iqbal <vad...@gmail.com> wrote:
Once you ssh to arbor, you will need to type shell to get a bash shell. From there it is pure linux.
--
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 ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Asif Iqbal

unread,
Nov 26, 2013, 11:55:28 AM11/26/13
to ansible...@googlegroups.com


On Tuesday, November 26, 2013 8:58:01 AM UTC-5, Michael DeHaan wrote:
Yeah that's not really going to work well in current state, because the system won't know to run the "shell" command.

There's no way to configure a regular shell account?



There is a way to provide regular shell account, but appliance upgrade overwrites it. Plus Arbor guys discouraging it too :-(

If we can only redefine ssh as "ssh -ttt remotehost shell"  we would be golden. Here is how we run things manually.


~$ ssh atl-col-01
Last login: Tue Nov 26 16:45:52 2013 from 192.168.0.248

ArbOS v5.2
Copyright (c) 2000-2013 Arbor Networks, Inc.  All Rights Reserved.

Welcome to ArbOS

admin@atl-col-01:/# shell
DIAG> uname -a
Linux atl-col-01 2.6.18-arbux26 #1 SMP PREEMPT Thu Aug 2 16:16:46 EDT 2012 i686 i686 i386 GNU/Linux
DIAG> exit
exit
admin@atl-col-01:/# exit
Connection to atl-col-01 closed.
~$ 

Here is how we run it interactively using a script which I like to replace with ansible

~$ echo "uname -a; exit" | ssh -qtt atl-col-01 shell
uname -a; exit
DIAG> uname -a; exit
Linux atl-col-01 2.6.18-arbux26 #1 SMP PREEMPT Thu Aug 2 16:16:46 EDT 2012 i686 i686 i386 GNU/Linux
exit
~$ 

Asif Iqbal

unread,
Nov 26, 2013, 1:09:52 PM11/26/13
to ansible...@googlegroups.com


On Monday, November 25, 2013 8:10:26 PM UTC-5, Michael DeHaan wrote:
I'm not familiar with Arbor Networks internals personally

Possible options:

try scp instead of SFTP in ansible.cfg
see if you can configure something to give you a login shell
just use "raw" commands


With raw I am getting the same output

$ ansible atl-col-01 -u admin -m raw -a "shell; uname -a" -i hosts
atl-col-01 | success | rc=0 >>
120: Invalid command

It is trying to run ``bash'' or like instead of ``shell''. How do I know that? Because I can generate similar output manually

admin@atl-col-01:/# sh
110: Ambiguous command
admin@atl-col-01:/# bash
120: Invalid command
admin@atl-col-01:/# shell

Matt Hite

unread,
Dec 13, 2013, 7:17:53 PM12/13/13
to ansible...@googlegroups.com
Hi, Asif. I have considered writing an Arbor module (using their API). The initial "itch" I wanted to "scratch' was to manage network/customer object entities. 

What is it that you hope to accomplish?

Asif Iqbal

unread,
Mar 14, 2016, 10:04:57 AM3/14/16
to Ansible Project


On Friday, December 13, 2013 at 7:17:53 PM UTC-5, Matt Hite wrote:
Hi, Asif. I have considered writing an Arbor module (using their API). The initial "itch" I wanted to "scratch' was to manage network/customer object entities. 

What is it that you hope to accomplish?


Essentially run remote command to find resource status
Reply all
Reply to author
Forward
0 new messages