Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Question about backing up running config #90

Open
farhadkam opened this issue May 23, 2018 · 2 comments
Open

Question about backing up running config #90

farhadkam opened this issue May 23, 2018 · 2 comments

Comments

@farhadkam
Copy link

Hi Experts,

Is there any way to backup panos running config using ansible?

Thanks and sorry for this as I could not find any module in Ansible Documentation for backing up Panos.

@dmitryzykov
Copy link

I've created a napalm-ansible module napalm_get_config for creating backup of running config. It works for panos well.

role

- name: install napalm
  pip:
    name: "{{ item }}"
    state: latest
  with_items: 
    - napalm
    - napalm-ansible
    - napalm-panos

- name: backup config
  napalm_get_config:
    hostname: "{{ inventory_hostname }}"
    username: "{{ username }}"
    dev_os: "{{ os }}"
    password: "{{ password }}"
    dest: "{{ backup_path }}/{{ inventory_hostname }}"
    strip_comments: "{{ backup_strip_comments }}"
  register: config
  environment: 
    PYTHONHTTPSVERIFY: 0 # do not verify ssl certs at panos devices

ansible.cfg

[defaults]
library = /usr/lib/python2.7/site-packages/napalm_ansible

playbook

- hosts: all
  gather_facts: no
  connection: local
  roles:
    - backup

https://github.com/napalm-automation/napalm
https://github.com/napalm-automation/napalm-ansible
napalm-automation/napalm-ansible#131
https://github.com/napalm-automation-community/napalm-panos/

@farhadkam
Copy link
Author

Thanks I will test it as soon as I get back from my trip.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants