Use Ansible to backup config

Reply
Highlighted
L1 Bithead

Hi @sylvaing 

 

Please see output below:

 

}
skipping: [x.x.x.x] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"invocation": {
"module_args": {
"method": "GET",
"return_content": true,
"url": "https://x.x.x.x/api/?type=keygen&user=<username>&password=<password>",
"validate_certs": false
}
},
"msg": "remote module (uri) does not support check mode"
}

 

PS. Items in Bold have been substituted

 

At the moment I can pull the configs with a script that performs API calls though.

 

Regards

John.

Highlighted
L1 Bithead

Hi @jmolefe 

 

I think you run the playbook with the --check knob which is not compatible with the uri module.

I don t like it  but I have change the playbook to force each task to run in un-check mode. 

Give it a try with the new version and you should be good,

 

Highlighted
L1 Bithead

Hi @sylvaing 

 

Yes removing the --check mode and installing the lxml python module did the trick.

 

Thank you

John.

Tags (1)
Highlighted
L1 Bithead

Hi @jmolefe 

 

Correct lxml is mandatory , I should create a README with the requirement , 

Will do that in the next update,

 

 

Highlighted
L1 Bithead

Hi @sylvaing 

 

Yes that should help.

I see however that whenever I connect to the devices using the playbook there is no logout task and the connection remains active until a connection-timeout kicks the sessions out. Weird..

 

* Check logged in users after the play completes.

 

John.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!