Healthbot REST calls with Ansible - ksator/junos_monitoring_with_healthbot GitHub Wiki
We will use Ansible to interact with Healthbot.
This Ansible playbook pb_configure_healthbot.yml:
- generates healthbot configuration for new devices
- load this configuration on healthbot
- commit this changeset on healthbot
- collects the healthtbot running configuration for devices.
So, this is a very basic Ansible demo.
Demo
install ansible
$ pip install ansible
install python libraries
$ pip install jinja2
$ pip install pyyaml
indicate healthbot ip address and credentials, and the devices you want to add to healthbot
$ vi ansible_input.yml
generate ansible inventory
$ python ./generate_ansible_inventory.py
$ more hosts
generate ansible variables
$ python ./generate_vars_for_ansible.py
$ ls host_vars
execute this playbook
$ ansible-playbook pb_configure_healthbot.yml --forks 1
Verify on your Ansible server
$ ls ansible_output/
$ more ansible_output/healthbot_running_config_for_devices.json