eugene_ky_wong.viptela_ansible
Role Name
This section provides a short description of the role.
This Ansible role is designed to help set up Cisco Viptela's environment, utilizing Cisco Viptela's software-defined networking features and the remote management capabilities of vManage.
Requirements
To use this role, you need to have a python2.7
environment. Run the following commands to set it up::
sudo pip install viptela-python --upgrade
sudo pip install ansible
Installation
You can install the Ansible role directly from Ansible Galaxy by executing this command::
ansible-galaxy install eugene_ky_wong.viptela_ansible --force
If you don't have the ansible-galaxy
command-line tool (which usually comes with Ansible) or want to download the role package directly, visit the Ansible Galaxy role page and click "Download."
Alternatively, you can go to our GitHub repository.
Role Variables
This section describes the variables that you can set for this role. This includes any variables found in defaults/main.yml and vars/main.yml, as well as any that can be set through role parameters. Any variables used from other roles or global variables (like hostvars, group vars, etc.) should also be noted here.
Dependencies
List any other roles available on Galaxy that this role depends on, along with any important parameter details required for those roles or variables used from them.
Example Playbook
Here’s a sample playbook that demonstrates how to use the role:
# Upload software to vManage
- name: Upload software to vManage
viptela_command:
name: Stage 18.2.0
filename: "viptela-18.2.0-mips64.tar.gz"
user: admin
user_pass: pass
vmanage_server: 10.1.1.41
register: results
# Upload software to vEdge
- name: Upgrade Software on vEdge
viptela_command:
user: admin
user_pass: pass
vmanage_server: "{{ vmanage_server }}"
version: "{{ version }}"
URL: 'vmanage'
action: 'upgrade'
ip_address: "{{ ip_address }}"
device_uuid: "{{ device_uuid[0] }}"
register: upgrade
# Activate upgraded software in vEdge
- name: Change Partition on vEdge
viptela_command:
user: admin
user_pass: pass
vmanage_server: "{{ vmanage_server }}"
version: "{{ version }}"
action: 'activate'
ip_address: "{{ ip_address }}"
device_uuid: "{{ device_uuid[0] }}"
register: change_partition
# Check if the upgrade was successful
- name: Check Upgrade Status
viptela_command:
user: admin
user_pass: pass
vmanage_server: "{{ vmanage_server }}"
URL: "{{ change_partition.results }}"
action: 'check_status'
register: check_status
retries: "{{ timeout * 6 }}"
delay: 10
until: ( check_status.results[0].statusId=="success" ) or
( check_status.results[0].statusId=="skipped" )
License
This role is licensed under BSD.
Author Information
For inquiries, contact: morphyme@gmail.com
GitHub: eugene-ky-wong/viptela-ansible
ansible-galaxy install eugene_ky_wong.viptela_ansible