# Configuring an HP GbE2c switch with SCP.

**URL:** <https://forum.ansible.com/t/configuring-an-hp-gbe2c-switch-with-scp/13435>\
**Category:** Ansible Project\
**Created:** [September 9, 2013, 1:41am UTC](https://forum.ansible.com/t/configuring-an-hp-gbe2c-switch-with-scp/13435 "2013-09-09T01:41:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris10](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@Chris10](https://forum.ansible.com/u/Chris10)\
**Post date:** [September 9, 2013, 1:41am UTC](https://forum.ansible.com/t/configuring-an-hp-gbe2c-switch-with-scp/13435/1 "2013-09-09T01:41:21Z")

</div>

Hi there,

I’m brand new to Ansible and I would like to know how you would approach the following situation: I’m trying to push some configuration files to HP GbE2c L2/L3 switches that I maintain. I can access the switches using SSH but need to enter a password manually (no way to declare an authorized RSA key). From there I have access to a CISCO-like CLI to manage the configuration. I can also push a configuration file remotely using SCP, with a syntax like the following, for instance from a Linux host:

> scp config.cfg admin@switch\_ip:putcfg\_apply\_save  
> Password:

which will upload file “config.cfg” to the switch, apply the new configuration and flash it to persistent memory.

I would like to do this automatically with Ansible as I have a fairly large number of switches to manage (about 20). There are two things I need for that:  
1 - A way to enter the SSH admin password automatically, like with Tcl/Tk “expect”.  
2 - A way to carry an scp command locally as obviously I can’t execute any command on the remote system.

Up to now I have come with the following solution:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [September 9, 2013, 2:04am UTC](https://forum.ansible.com/t/configuring-an-hp-gbe2c-switch-with-scp/13435/2 "2013-09-09T02:04:30Z")

</div>

“ansible-playbook -k -vvv test.yml” will ask you for the ssh password and send it to each host but prompt you only once

as for the commands, try the following:

- hosts: switches  
gather\_facts: no  
user: admin  
tasks:

- name: Push configuration to the switches  
local\_action: command scp ${inventory\_hostname}.cfg

- name: save config  
raw: putcfg\_apply\_save
