All Projects → aruba → aos-switch-ansible-collection

aruba / aos-switch-ansible-collection

Licence: other
Ansible collection for AOS-Switch switches

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aos-switch-ansible-collection

aoscx-ansible-role
Ansible roles for AOS-CX switches
Stars: ✭ 15 (-48.28%)
Mutual labels:  switch, aruba
angular-projects
A collection of projects built on the Angular framework
Stars: ✭ 17 (-41.38%)
Mutual labels:  collection
PowerShell
Mega collection of 250+ useful cross-platform PowerShell scripts.
Stars: ✭ 274 (+844.83%)
Mutual labels:  collection
OctopathTraveler
Switch OctopathTraveler SaveDate Editor
Stars: ✭ 32 (+10.34%)
Mutual labels:  switch
The-Java-Workshop
A New, Interactive Approach to Learning Java
Stars: ✭ 65 (+124.14%)
Mutual labels:  collection
switch-ssh-go
A packaged SSH library for switches (huawei,h3c,cisco)
Stars: ✭ 53 (+82.76%)
Mutual labels:  switch
pyArubaCloud
Python Interface for ArubaCloud IaaS Service
Stars: ✭ 32 (+10.34%)
Mutual labels:  aruba
HBHybridCollectionView
Instead for SwipeTableView when using collection view.
Stars: ✭ 14 (-51.72%)
Mutual labels:  collection
eBookReaderNX
A Nintendo Switch eBook Reader
Stars: ✭ 15 (-48.28%)
Mutual labels:  switch
tutti-quanti-shelf
Collection of miscellaneous developer-oriented utilities wrapped into one single app, built with Electron.
Stars: ✭ 30 (+3.45%)
Mutual labels:  collection
SwiTAS
A usable toolkit for creating Nintendo Switch TASes with homebrew
Stars: ✭ 54 (+86.21%)
Mutual labels:  switch
OnlySwitch
⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
Stars: ✭ 1,288 (+4341.38%)
Mutual labels:  switch
micell
A collection of functions for front-end development
Stars: ✭ 16 (-44.83%)
Mutual labels:  collection
UserDeviceTracker
快速定位一个IP或MAC在你的网络中的位置,是网络工程师提高工作效率的利器,也可以为CMDB提供基础网络数据。
Stars: ✭ 36 (+24.14%)
Mutual labels:  switch
enumerable4j
Amazing Ruby's "Enumerable" ported to Java
Stars: ✭ 29 (+0%)
Mutual labels:  collection
Homebrew-Guide
Guide for getting CFW setup on your Nintendo Switch (And Wii U)
Stars: ✭ 104 (+258.62%)
Mutual labels:  switch
x86-Assembly-Reverse-Engineering
🛠 Knowledge about the topic of x86 assembly & disassembly 🛠
Stars: ✭ 27 (-6.9%)
Mutual labels:  collection
Nintendo-Switch-JoyCon-Hack
Hardwiring a push button in a JoyCon to grant bootloader access
Stars: ✭ 44 (+51.72%)
Mutual labels:  switch
CoolSlidingMenu
A powerful menu that you can customize it。
Stars: ✭ 25 (-13.79%)
Mutual labels:  collection
book-sentences
A collection of sentences from different books.
Stars: ✭ 43 (+48.28%)
Mutual labels:  collection

AOS-Switch Ansible Collection

This Ansible Network collection provides a set of platform dependent configuration management modules specifically designed for the AOS-Switch Ansible Collection network device.

Requirements

  • Python 2.7 or 3.5+
  • Ansible 2.9.0 or later
    • Ansible 2.10+ requires ansible.netcommon collection to be installed
  • For AOS-Switch firmware version 16.08 and above is supported
  • Enable REST on your AOS-Switch device with the following commands:
    switch(config)# web-management ssl
    switch(config)# rest-interface
    
  • Install all Ansible requirements, with the following command:
    ansible-galaxy install -r requirements.yml
    

Installation

Through Galaxy:

ansible-galaxy collection install arubanetworks.aos_switch

Inventory Variables

The variables that should be defined in your inventory for your AOS-CX host are:

  • ansible_host: IP address of switch in A.B.C.D format. For IPv6 hosts use a string and enclose in square brackets E.G. '[2001::1]'
  • ansible_user: Username for switch in plaintext format
  • ansible_password: Password for switch in plaintext format
  • ansible_connection: Set to local to use REST API modules, and to network_cli to use SSH/CLI modules See below for info on using both REST API modules and SSH/CLI modules on a host
  • ansible_network_os: Must always be set to arubanetworks.aos_switch.arubaoss

Sample Inventory:

YAML

all:
  hosts:
    aosswitch_1:
      ansible_host: 10.0.0.1
      ansible_user: admin
      ansible_password: password
      ansible_connection: local  # REST API connection method
      ansible_network_os: arubanetworks.aos_switch.arubaoss  # Do not change

Setting Environment Variables

In order to use the AOS-Switch collection you need to modify your environment in order for Ansible to recognize the Network OS:

Example of setting environment variable in the command : $ ANSIBLE_NETWORK_GROUP_MODULES=arubaoss ansible-playbook sample_playbook.yml -i inventory.yml

You can also check which ansible.cfg is used by increasing the verbosity (add -v to command above) and accordingly set the value of NETWORK_GROUP_MODULES to "arubaoss" in the [defaults] section.

[defaults]
NETWORK_GROUP_MODULES=arubaoss

Example Playbook

If collection installed through Galaxy add arubanetworks.aos_switch to your list of collections:

    ---
    -  hosts: all
       collections:
         - arubanetworks.aos_switch
       tasks:
         - name: Create VLAN 300
           arubaoss_vlan:
             vlan_id: 400
             name: "vlan400"
             config: "create"
             command: config_vlan

SSH/CLI Modules

  • To use the SSH/CLI modules arubaoss_config and arubaoss_command, SSH access must be enabled on your AOS-Switch device. It is enabled by default.
    • If necessary, re-enable SSH access on the device with the following command:
    switch(config)# ip ssh
    
  • The control machine's known_hosts file must contain the target device's public key.
    • Alternatively, host key checking by the control machine may be disabled, although this is not recommended.
    • To disable host key checking modify the ansible.cfg file (default /etc/ansible/ansible.cfg) to include: host_key_checking = false

Using Both REST API and SSH/CLI Modules on a Host

To use both REST API and SSH/CLI modules on the same host, you must create separate plays such that each play uses either only REST API modules or only SSH/CLI modules. A play cannot mix and match REST API and SSH/CLI module calls. In each play, ansible_connection must possess the appropriate value according to the modules used. If the play uses REST API modules, the value should be local. If the play uses SSH/CLI modules, the value should be network_cli.

A recommended approach to successfully using both types of modules for a host is as follows:

  1. Set the host variables such that Ansible will connect to the host using REST API.
  2. In the playbook, in each play wherein the SSH/CLI modules are used, set the ansible_connection to network_cli.

The inventory should look something like this:

all:
  hosts:
    switch1:
      ansible_host: 10.0.0.1
      ansible_user: admin
      ansible_password: password
      ansible_connection: local  # REST API connection method
      ansible_network_os: arubanetworks.aos_switch.arubaoss  # Do not change

and the playbook like this (note how the second play, which uses the SSH/CLI module arubaoss_command, sets the ansible_connection value accordingly):

- hosts: all
  collections:
    - arubanetworks.aos_switch
  tasks:
    - name: Create VLAN 200
      arubaoss_vlan:
        vlan_id: 300
        name: "vlan300"
        config: "create"
        command: config_vlan

- hosts: all
  collections:
    - arubanetworks.aos_switch
  vars:
    ansible_connection: network_cli
  tasks:
    - name: Execute show run on the switch
      arubaoss_command:
        commands: ['show run']

Contribution

At Aruba Networks we're dedicated to ensuring the quality of our products, if you find any issues at all please open an issue on our Github and we'll be sure to respond promptly!

For more contribution opportunities follow our guidelines outlined in our CONTRIBUTING.md

License

Apache-2.0

Author Information

  • Tiffany Chiapuzio-Wong (@tchiapuziowong)
  • Sunil Veeramachaneni (@sunil.veeramachaneni)
  • Castro, Jorge Arturo (@jorge.castro93)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].