{"id":18383504,"url":"https://github.com/aruba/aruba-ansible-modules","last_synced_at":"2025-04-06T23:32:21.729Z","repository":{"id":52795864,"uuid":"167591318","full_name":"aruba/aruba-ansible-modules","owner":"aruba","description":"Aruba Ansible Modules","archived":false,"fork":false,"pushed_at":"2021-05-13T15:58:15.000Z","size":321,"stargazers_count":69,"open_issues_count":13,"forks_count":36,"subscribers_count":28,"default_branch":"master","last_synced_at":"2023-07-31T19:22:56.012Z","etag":null,"topics":["ansible","ansible-modules","aruba","aruba-ansible-modules","arubaos-cx","arubaos-switch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aruba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T18:08:07.000Z","updated_at":"2023-04-18T12:50:57.000Z","dependencies_parsed_at":"2022-08-23T03:11:37.724Z","dependency_job_id":null,"html_url":"https://github.com/aruba/aruba-ansible-modules","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruba%2Faruba-ansible-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruba%2Faruba-ansible-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruba%2Faruba-ansible-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruba%2Faruba-ansible-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aruba","download_url":"https://codeload.github.com/aruba/aruba-ansible-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223266869,"owners_count":17116493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-modules","aruba","aruba-ansible-modules","arubaos-cx","arubaos-switch"],"created_at":"2024-11-06T01:11:43.565Z","updated_at":"2024-11-06T01:11:44.244Z","avatar_url":"https://github.com/aruba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":":warning: :warning: :warning: :warning: :warning: \n\n**_This repository is deprecated._**\n\n**_For all Aruba created Ansible content visit [ArubaNetworks on Galaxy](https://galaxy.ansible.com/arubanetworks)._**\n\n**_For official AOS-Switch Ansible [Collection](https://galaxy.ansible.com/arubanetworks/aos_switch)._**  \n\n**_For official Central Ansible [Role](https://galaxy.ansible.com/arubanetworks/aruba_central_role)._**  \n\n**_For official WLAN Ansible [Role](https://galaxy.ansible.com/arubanetworks/aos_wlan_role)._**  \n\n**_For official AOS-CX automation with Ansible guides and workflows visit Aruba's [Developer Hub](https://developer.arubanetworks.com/aruba-aoscx)._**  \n\n:warning: :warning: :warning: :warning: :warning: \n\n# aruba-ansible-modules\nAll Ansible modules, module installer, and example playbooks for AOS-Switch and WLAN products.\n For AOS-CX modules please see our AOS-CX Ansible Role in [Ansible's Galaxy](https://galaxy.ansible.com/arubanetworks/aoscx_role).\n\n## Structure\n\n* AOS-Switch and WLAN Ansible modules and files are stored in [aruba_module_installer/library](https://github.com/aruba/aruba-ansible-modules/tree/master/aruba_module_installer/library).\n* Documentation of Switching and WLAN Ansible modules are located in [module_documentation/](https://github.com/aruba/aruba-ansible-modules/tree/master/module_documentation) \n* Frequently Asked Questions are located in [FAQ.md](https://github.com/aruba/aruba-ansible-modules/blob/master/FAQ.md)\n* AOS-Switch and WLAN Ansible playbook examples are stored in [example_playbooks/](https://github.com/aruba/aruba-ansible-modules/tree/master/example_playbooks)\n\n# How to Install Modules\nThe aruba_module_installer.py tool installs all files/directories required by Ansible for AOS-Switch and WLAN integration.\n\n## Requirements\n\n* Linux operating system\n* Python 2.7 or 3.5+\n* Ansible version 2.5 or later\n* For AOS-Switch firmware version **16.08** and above is supported, for AOS-Switch setup instructions see [below](#how-to-run-a-playbook-on-aos-switch)\n\n\n## How to run this code\nClone this repository onto your Linux machine:  \n```bash\n$ git clone https://github.com/aruba/aruba-ansible-modules.git\n```\nEnter the cloned directory and execute the python installer:  \n```bash\n$ cd aruba-ansible-modules\n$ python aruba_module_installer/aruba_module_installer.py\n```\nIf you receive a permission error, use 'sudo':\n```bash\n$ sudo python aruba_module_installer/aruba_module_installer.py\n```\n\nIn order to run these scripts, please complete the steps below:\n1. Install Python version 2.7 or 3.5+ on the system.\n\n2. Install Ansible 2.5 or later (refer https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).\n \n## How to install updates or new modules\nEnter the cloned directory and pull any updates from the repository:  \n```bash\n$ cd aruba-ansible-modules\n$ git pull\n```\nRun the python installer with the `--reinstall` option, remember to use `sudo` if you receive a permission error:\n```bash\n$ sudo python aruba_module_installer/aruba_module_installer.py --reinstall\n```\n\n## Optional Arguments\n```\noptional arguments:\n  -h, --help    show this help message and exit\n  -r, --remove  remove all files \u0026 directories installed by this script.\n  --reinstall   remove all files \u0026 directories installed by this script. Then\n                re-install.\n  --switch      only install files/directories required for AOS-Switch.\n```\n\n# How to Run a Playbook on AOS-Switch\n\n## Prerequisites\nFollow the above steps to install the AOS-Switch Ansible modules.\n   \n1. Assign an IP address to the management interface of your Switch device. Ensure that the IP address is reachable\nfrom your Ansible control machine.\n2. Enable REST on your Switch device with the following commands:\n    ```\n    switch(config)# web-management ssl\n    switch(config)# rest-interface\n    ```\n3. Modify the IP address in the hosts file example_playbooks/arubaoss/switch_hosts.yml to match the IP of your Switch device.\n4. Modify the ansible_user and ansible_password in the hosts file example_playbooks/arubaoss/switch_hosts.yml to match the login information of your Switch device.\n\n## SSH/CLI Modules\n* To use the SSH/CLI modules `arubaoss_config` and `arubaoss_command`, SSH access must\n be enabled on your AOS-Switch device. It is enabled by default.\n    * If necessary, re-enable SSH access on the device with the following command:\n    ```\n    switch(config)# ip ssh\n    ```\n* The control machine's `known_hosts` file must contain the target device's public key.\n    * Alternatively, host key checking by the control machine may be disabled, although this is not recommended.\n    * To disable host key checking modify the ansible.cfg file (default /etc/ansible/ansible.cfg) to include:\n      `host_key_checking = false`\n\n## Inventory Variables\nThe variables that should be defined in your inventory for your AOS-Switch host are:\n\n* `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]'`.\n* `ansible_user`: Username for switch in `plaintext` format\n* `ansible_password`: Password for switch in `plaintext` format\n* `ansible_network_os`: Must always be set to `arubaoss`\n* `ansible_connection`: Set to `local` to use REST API modules, and to `network_cli` to use SSH/CLI modules\n  * See [below](#using-both-rest-api-and-sshcli-modules-on-a-host) for info on using both REST API modules and SSH/CLI modules on a host\n\n\n## Using Both REST API and SSH/CLI Modules on a Host\n\nTo use both REST API and SSH/CLI modules on the same host, \nyou must create separate plays such \nthat each play uses either only REST API modules or only SSH/CLI modules.\nA play cannot mix and match REST API and SSH/CLI module calls.\nIn each play, `ansible_connection` must possess the appropriate value \naccording to the modules used. \nIf the play uses REST API modules, the value should be `local`. \nIf the play uses SSH/CLI modules, the value should be `network_cli`.\n \nA recommended approach to successfully using both types of modules for a host\nis as follows:\n1. Set the host variables such that Ansible will connect to the host using REST API.\n2. In the playbook, in each play wherein the SSH/CLI\nmodules are used, set the `ansible_connection` to `network_cli`. \n\nThe inventory should look something like this:\n\n```yaml\nall:\n  hosts:\n    switch1:\n      ansible_host: 10.0.0.1\n      ansible_user: admin\n      ansible_password: password\n      ansible_network_os: arubaoss\n      ansible_connection: local  # REST API connection method\n```\n\nand the playbook like this (note how the second play, which uses the SSH/CLI module `arubaoss_command`,\nsets the `ansible_connection` value accordingly):\n\n```yaml\n- hosts: all\n  tasks:\n    - name: Create VLAN 200\n      arubaoss_vlan:\n        vlan_id: 300\n        name: \"vlan300\"\n        config: \"create\"\n        command: config_vlan\n\n- hosts: all\n  vars:\n    ansible_connection: network_cli\n  tasks:\n    - name: Execute show run on the switch\n      arubaoss_command:\n        commands: ['show run']\n```\n\n```yaml\nall:\n  hosts:\n    switch1:\n      ansible_host: 10.0.0.1\n      ansible_user: admin\n      ansible_password: password\n      ansible_network_os: arubaoss\n      ansible_connection: local  # REST API connection method\n```\n\n# How to Run a Playbook on ArubaOS Controller\nFollow the above steps to install the Aruba's Ansible modules. \n\n## Prerequisites\n1. Install python request module \"pip install requests\".\n2. Ensure that the IP address of the Aruba controllers are reachable from your Ansible machine.\n3. Update variables.yml file with required variables like username, IP address and password.\n4. Refer to the module_documentation folder for description of module arguments and example playbooks.\n\n\nContribution\n-------\nIf you're interested in contributing please read and follow our [contribution documentation](https://github.com/aruba/aruba-ansible-modules/blob/master/CONTRIBUTING.md).\n\n\nLicense\n-------\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruba%2Faruba-ansible-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faruba%2Faruba-ansible-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruba%2Faruba-ansible-modules/lists"}