# pulling infor from a config.

**URL:** <https://forum.ansible.com/t/pulling-infor-from-a-config/33211>\
**Category:** Ansible Project\
**Created:** [June 18, 2020, 1:56pm UTC](https://forum.ansible.com/t/pulling-infor-from-a-config/33211 "2020-06-18T13:56:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe3](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Joe3](https://forum.ansible.com/u/Joe3)\
**Post date:** [June 18, 2020, 1:56pm UTC](https://forum.ansible.com/t/pulling-infor-from-a-config/33211/1 "2020-06-18T13:56:21Z")

</div>

I am trying to figure out how to put information from a switch config using ansible so it can be manipulated and used as data in your ansible playbook. For example, all switches have a configuration section similar to the following:

archival {  
configuration {  
transfer-on-commit;  
archive-sites {  
“ftp://ftpuser:ftppassword@10.120.255.150/subc/ftp/jnpr/cfg/dp-b284-agg”;  
}

I’m trying to figure out how to put the ftp:// line and manipulate that string so i can replace the ip with a new/different ip, in addition i want to pull out the directory structure so i can use that path to create the needed directory structure on the new server. would any one have any tips on this?
