| 1 |
# ansible-mso |
| 2 |
|
| 3 |
## Description |
| 4 |
|
| 5 |
The `ansible-mso` project provides an Ansible collection for managing and automating your Cisco ACI Multi-Site or Nexus Dashboard Orchestrator environments. |
| 6 |
It consists of a set of modules and roles for performing tasks related to ACI Multi-Site. |
| 7 |
|
| 8 |
See the [cisco.mso collection index](https://galaxy.ansible.com/ui/repo/published/cisco/mso/content/) for a full list of modules and plugins. |
| 9 |
|
| 10 |
*Note: The Nexus Dashboard (ND) HTTPAPI connection plugin should be used when Cisco ACI Multi-Site is installed on Nexus Dashboard (v3.2+) or when using this collection with Nexus Dashboard Orchestrator (v3.6+).* |
| 11 |
|
| 12 |
## Requirements |
| 13 |
|
| 14 |
- Ansible v2.16 or newer |
| 15 |
- Python v3.11 or newer |
| 16 |
|
| 17 |
Follow the [Installing Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) guide for detailed instructions. |
| 18 |
|
| 19 |
## Installation |
| 20 |
|
| 21 |
Before using this collection, you need to install it with the Ansible Galaxy command-line tool: |
| 22 |
|
| 23 |
```sh |
| 24 |
ansible-galaxy collection install cisco.mso |
| 25 |
``` |
| 26 |
|
| 27 |
You can also include this collection in a requirements.yml file and install it with: |
| 28 |
|
| 29 |
```sh |
| 30 |
ansible-galaxy collection install -r requirements.yml |
| 31 |
``` |
| 32 |
|
| 33 |
Using the following `requirements.yml` format: |
| 34 |
|
| 35 |
```yaml |
| 36 |
collections: |
| 37 |
- name: cisco.mso |
| 38 |
``` |
| 39 |
|
| 40 |
Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. |
| 41 |
To upgrade the collection to the latest available version, run the following command: |
| 42 |
|
| 43 |
```sh |
| 44 |
ansible-galaxy collection install cisco.mso --upgrade |
| 45 |
``` |
| 46 |
|
| 47 |
You can also install a specific version of the collection. For example, to install version 1.0.0, use the following syntax: |
| 48 |
|
| 49 |
```sh |
| 50 |
ansible-galaxy collection install cisco.mso:==1.0.0 |
| 51 |
``` |
| 52 |
|
| 53 |
See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. |
| 54 |
|
| 55 |
### Installation with Nexus Dashboard |
| 56 |
|
| 57 |
Install the Nexus Dashboard (ND) collection when Cisco ACI Multi-Site is installed on Nexus Dashboard (v3.2+) or when using this collection with Nexus Dashboard Orchestrator (v3.6+) |
| 58 |
|
| 59 |
```sh |
| 60 |
ansible-galaxy collection install cisco.nd |
| 61 |
``` |
| 62 |
|
| 63 |
### Latest Build |
| 64 |
|
| 65 |
Follow these instructions to get the latest collection. |
| 66 |
|
| 67 |
#### First Approach - Build From Source Code |
| 68 |
|
| 69 |
Clone the `ansible-mso` repository. |
| 70 |
|
| 71 |
```sh |
| 72 |
git clone https://github.com/CiscoDevNet/ansible-mso.git |
| 73 |
``` |
| 74 |
|
| 75 |
Go to the `ansible-mso` directory |
| 76 |
|
| 77 |
```sh |
| 78 |
cd ansible-mso |
| 79 |
``` |
| 80 |
|
| 81 |
Pull the latest master on your mso |
| 82 |
|
| 83 |
```sh |
| 84 |
git pull origin master |
| 85 |
``` |
| 86 |
|
| 87 |
Build and Install a collection from source |
| 88 |
|
| 89 |
```sh |
| 90 |
ansible-galaxy collection build --force |
| 91 |
ansible-galaxy collection install cisco-mso-* --force |
| 92 |
``` |
| 93 |
|
| 94 |
#### Second Approach - Download From Latest CI Build |
| 95 |
|
| 96 |
Go to [ansible-mso Actions](https://github.com/CiscoDevNet/ansible-mso/actions/workflows/ansible-test.yml?query=branch%3Amaster) and select the latest CI build. |
| 97 |
|
| 98 |
Under Artifacts download collection suffixed with the latest version of Ansible (eg. `collection-stable-2.17`) and unzip it using Terminal or Console. |
| 99 |
|
| 100 |
*Note: The collection file is a zip file containing a tar.gz file. We recommend using CLI because some GUI-based unarchiver might unarchive both nested archives in one go.* |
| 101 |
|
| 102 |
Install the unarchived tar.gz file |
| 103 |
|
| 104 |
```sh |
| 105 |
ansible-galaxy collection install cisco-mso-1.0.0.tar.gz —-force |
| 106 |
``` |
| 107 |
|
| 108 |
## Use Cases |
| 109 |
|
| 110 |
Once the collection is installed, you can use it in a playbook by specifying the full namespace path to the module, plugin and/or role. |
| 111 |
|
| 112 |
### Adding a new site EPG |
| 113 |
|
| 114 |
```yaml |
| 115 |
- hosts: mso |
| 116 |
gather_facts: no |
| 117 |
|
| 118 |
tasks: |
| 119 |
- name: Add a new site EPG |
| 120 |
cisco.mso.mso_schema_site_anp_epg: |
| 121 |
host: mso_host |
| 122 |
username: admin |
| 123 |
password: SomeSecretPassword |
| 124 |
schema: Schema1 |
| 125 |
site: Site1 |
| 126 |
template: Template1 |
| 127 |
anp: ANP1 |
| 128 |
epg: EPG1 |
| 129 |
state: present |
| 130 |
``` |
| 131 |
|
| 132 |
## MSO HTTPAPI Plugin |
| 133 |
|
| 134 |
You can use the MSO HTTPAPI connection plugin by setting the following variables in your inventory file (cisco.mso collection v1.2+). |
| 135 |
|
| 136 |
```yaml |
| 137 |
ansible_connection=ansible.netcommon.httpapi |
| 138 |
ansible_network_os=cisco.mso.mso |
| 139 |
``` |
| 140 |
|
| 141 |
The HTTPAPI connection plugin will also allow you to specify additional parameters as variable and omit them from the task itself. Module parameters will override global variables. |
| 142 |
|
| 143 |
```yaml |
| 144 |
ansible_host=10.0.0.1 |
| 145 |
ansible_user=admin |
| 146 |
ansible_ssh_pass="MySuperPassword" |
| 147 |
ansible_httpapi_validate_certs=False |
| 148 |
ansible_httpapi_use_ssl=True |
| 149 |
ansible_httpapi_use_proxy=True |
| 150 |
``` |
| 151 |
|
| 152 |
You should use the Nexus Dashboard (ND) collection plugin, which is available in the [cisco.nd](https://galaxy.ansible.com/cisco/nd) collection, when Cisco ACI Multi-Site is installed on Nexus Dashboard (v3.2+) or when using this collection with Nexus Dashboard Orchestrator (v3.6+) by changing the following variables. |
| 153 |
|
| 154 |
```yaml |
| 155 |
ansible_connection=ansible.netcommon.httpapi |
| 156 |
ansible_network_os=cisco.nd.nd |
| 157 |
ansible_httpapi_use_ssl=True |
| 158 |
``` |
| 159 |
|
| 160 |
## Testing |
| 161 |
|
| 162 |
Integration tests for each module in the `cisco.mso` collection are executed on the following Nexus Dashboard Orchestrator versions: |
| 163 |
|
| 164 |
- 3.7 |
| 165 |
- 4.1 |
| 166 |
- 4.2 |
| 167 |
- 4.3 |
| 168 |
|
| 169 |
## Contributing |
| 170 |
|
| 171 |
Ongoing development efforts and contributions to this collection are tracked as issues in this repository. |
| 172 |
|
| 173 |
We welcome community contributions to this collection. If you find problems, need an enhancement or need a new module, please open an issue or create a PR against the [Cisco MSO collection repository](https://github.com/CiscoDevNet/ansible-mso/issues). |
| 174 |
|
| 175 |
## Support |
| 176 |
|
| 177 |
This collection supports any MSO/NDO version within the Last Day of Support (LDOS) date. |
| 178 |
|
| 179 |
Certain modules and options in the collection are only available from specific versions of MSO/NDO. The versions that a module or option supports are documented in the individual module documentation. |
| 180 |
|
| 181 |
To find EOL announcements for MSO/NDO versions, refer to the [End-of-Life and End-of-Sale Notices](https://www.cisco.com/c/en/us/products/cloud-systems-management/multi-site-orchestrator/eos-eol-notice-listing.html) page. |
| 182 |
|
| 183 |
## Release Notes |
| 184 |
|
| 185 |
See the [Changelog](https://github.com/CiscoDevNet/ansible-mso/blob/master/CHANGELOG.rst) for full release notes. |
| 186 |
|
| 187 |
## Related Information |
| 188 |
|
| 189 |
For further information, refer to the following: |
| 190 |
|
| 191 |
- [Automating Cisco MSO with Ansible Learning Lab](https://developer.cisco.com/learning/labs/mso-ansible_part1-intro/setup-an-ansible-and-mso-environment/) |
| 192 |
- [Nexus Dashboard Orchestrator Overview](https://www.cisco.com/c/en/us/products/collateral/cloud-systems-management/multi-site-orchestrator/nb-06-mso-so-cte-en.html) |
| 193 |
- [Nexus Dashboard Orchestrator Support Documentation](https://www.cisco.com/c/en/us/support/cloud-systems-management/multi-site-orchestrator/series.html) |
| 194 |
- [Nexus Dashboard Orchestrator API Release Notes](https://developer.cisco.com/docs/search/?q=Nexus+Dashboard+Orchestrator) |
| 195 |
|
| 196 |
## License Information |
| 197 |
|
| 198 |
This collection is licensed under the [GNU General Public License v3.0](https://github.com/CiscoDevNet/ansible-mso/blob/master/LICENSE) |