Audiocodes, KEMP, Fortinet, Zyxel network device management with Ansible
There are hundreds of tools that make your network operation life easier, one of the most popular tool is Ansible (open source). Let us give you an example on how to can use Ansible to automate Audiocodes, KEMP, Zyxel or Fortigate devices backups.
You may have pure Ansible installation or Ansible Tower on top. Tower allows you to manage your playbooks in a Visual Web GUI, create workflows, set credentials and schedule jobs to run regularly.
AWX / Ansible Tower
AWX is a free version of Ansible Tower from RedHat:

It uses docker container images and can be deployed on various platforms, here is a CentOS v7. Once deployed there are containers running tasks, web, Database, queue and cache:

As docker images are maintained by RedHat, you do not need to go deep into how it works, but just profit from nice web GUI and start your development.
So, we want to create a job and template to backup Audiocodes SBC – it will be based on a playbook (YAML ansible code)

The playbook code may look like this:

It opens Audiocodes SBC via REST API with a predefined user (we store credentials in AWX database securely and not in YAML open text) and saves SBC backup ini file in a folder and add timestamp to the filename. The API information from Audiocodes can be found here: https://www.audiocodes.com/media/13528/rest-api-for-mediant-devices-ver-72.pdf
Workflows in AWX
In AWX we can create more complex workflows in a visual way:

Here is example of taking backup and then copying file to a NAS for long term storage and retention. Finally we will schedule this job to run on a monthly basis. In case of job failure we can set system to send email to an administrator.

The same way we can backup KEMP load balancer:
Or Zyxel switches
Fortigate REST API requires firmware 6.x and you can find the required information here: https://docs.fortinet.com/document/fortimail/6.0.4/rest-api-reference
Do not waste your time using fortios_config and FW 5.x – it is not very stable method.
The full power of Ansible is scalability, once you have created a unit code for a function you can multiply its use, delegate operation and manage this way many devices. For production use, you need obviously have isolated DEV and PROD platforms, keep your playbook is an environment with versioning, etc.
Happy DevOps to you!
Ce qu'un article ne peut pas savoir
Un article décrit ce qui vaut pour tout le monde. Ce qui change d'une organisation à l'autre, c'est l'inventaire : quelles applications, quels comptes, quels équipements sont réellement concernés chez vous. C'est l'inventaire qui décide de l'effort, et il ne se répond pas sur une page.
Vous parlez aux ingénieurs qui feraient le travail, pas à un intermédiaire. Réponse sous 24 heures ouvrées.
Vérifier ce qui est encore vrai
Les dates annoncées sont parfois repoussées, les produits changent de nom, les conditions évoluent. Le blog suit ces sujets au fil du temps : quand une règle change, un nouvel article le dit.
Chercher un sujet dans le blogDans le même dossier
Trois articles du même sujet. Le blog en compte 139, tous en accès libre.



