Skip to content

abhinav5656/a10-ansible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a10-ansible

Repository of for ansible modules

This code is now being generated using the SDK generator at https://github.com/a10networks/sdkgenerator

Summary

This repository is a set of Ansible modules and example playbooks for interacting with AXAPI v3 for configuration and monitoring of A10 ACOS-based hardware and virtual appliances. The module code and example playbooks are generated using a combination of Python code and Jinja templates.

Installation

a10-ansible is distributed as a Python package. It can be installed from the Github repository. It is assumed that ansible is already installed and configured.

Github Installation - Using Script (Linux)

git clone https://github.com/a10networks/a10-ansible a10-ansible
cd a10-ansible 
chmod +x a10_install.sh

Check the ansible module location then run..

./a10_install.sh

You can now delete the install files 

Github Installation - Pip Install

git clone https://github.com/a10networks/a10-ansible a10-ansible
pip install -e a10-ansible/

Usage Information

All actions are required to have a10_host, a10_username, a10_password, a10_port, and a10_protocol specified. Note that a10_host refers to the ip address of the Thunder device.

Action and module names are formatted based upon their API endpoint. For example, the virtual server endpoint is as follows: /axapi/v3/slb/virtual-server. As such, the action name is a10_slb_virtual_server and the module is a10_slb_virtual_server.py.

**Note that when getting information, changes made to the playbook will not result in a create or update as the state has been put into no-op.

Creating / updating a resource

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>

Deleting a resource

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        state: absent

Getting information about a single object

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        state: noop
        get_type: single 

Getting information about a collection

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        state: noop
        get_type: list

Getting operational information

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        state: noop
        get_type: oper

Getting statistic information

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        state: noop
        get_type: stats

Configuring a resource on a partition

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        a10_partition:
          name: {{ partition_name }}
          shared: 0
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>

Check Mode

Check mode can be specified in two ways:

- name: <Description of playbook>
  connection: local
  hosts: <inventory>
  tasks:
    - name: <Description of task>
      <action>:
        a10_host: {{ a10_host }}
        a10_username: {{ a10_username }}
        a10_password: {{ a10_password }}
        a10_port: {{ a10_port }}
        a10_protocol: {{ a10_protocol }}
        <resource_key>: <resource_val>
        <another_resource_key>: <another_resource_val>
        check_mode: yes

or

$ ansible-playbook <playbook_name>.yml --check-mode

Examples

Please see (https://github.com/a10networks/a10-ansible/tree/master/examples) for example playbooks.

Bug Reporting and Feature Requests

Please submit bug reports and feature requests via GitHub issues. When reporting bugs, please include the playbook that demonstrates the bug and the Ansible output. Stack traces are always nice, but playbooks work well. Please ensure any sensitive information is redacted as Issues and Pull Requests are publicly viewable.

Contact

If you have a question that cannot be submitted via Github Issues, please email [email protected] with "a10-ansible" in the subject line.

About

Repository of for ansible modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%