Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update aruba ansible playbook CASMNET-2026 #256

Merged
merged 27 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
65ab5e6
Fix unchecked `bmc` port `3` error, enhance messaging and begin model…
trad511 Jan 5, 2023
1de72c6
version bump
trad511 Jan 5, 2023
3071655
correct misspelling
trad511 Jan 5, 2023
a30d738
CASMNET-1968 add dynamic ansible inventory script that queries SLS
jacobsalmela Jan 5, 2023
9fc7669
CASMNET-1982 ansible plays for aruba
jacobsalmela Jan 4, 2023
4a6ec6e
Update readme
jacobsalmela Jan 5, 2023
1980e22
CASMNET-1968 and CASMNET-1982 tests
jacobsalmela Jan 5, 2023
a99fa59
update spec to install canu-inventory
jacobsalmela Jan 9, 2023
25d2c8b
pyinstaller changes to deploy canu and canu-inventory
jacobsalmela Jan 9, 2023
c0793e0
remove snooper
jacobsalmela Jan 19, 2023
4c475ff
fix lint for shcd.py
jacobsalmela Jan 17, 2023
532ad6d
use variable for leaf bmc play
jacobsalmela Jan 19, 2023
32dd2f7
allow ansible to apply configs to all switches, remove banner munging
lukebates123 Jan 20, 2023
816823e
add lnet onboard
lukebates123 Jan 23, 2023
e7e9192
update aruba ansible playbook
lukebates123 Jan 24, 2023
c79829c
readme
lukebates123 Jan 24, 2023
06a73b7
revert template changes from other branch
lukebates123 Jan 24, 2023
f695ba1
Update README.md
lukebates123 Jan 24, 2023
ae8af5f
pull mgmt interface from api
lukebates123 Jan 24, 2023
3776a5a
Merge branch 'CASMNET-2026' of https://github.com/Cray-HPE/canu into …
lukebates123 Jan 24, 2023
34152cd
check for config differences before applying config to running
lukebates123 Jan 25, 2023
b2a8497
comments
lukebates123 Jan 25, 2023
8f2470f
readme
lukebates123 Jan 25, 2023
a473eec
Merge branch 'develop' into CASMNET-2026
lukebates123 Jan 26, 2023
f61fd0b
Merge branch 'develop' into CASMNET-2026
lukebates123 Jan 26, 2023
fe3e487
Merge branch 'main' into CASMNET-2026
lukebates123 Jan 26, 2023
4890a32
Merge branch 'main' into CASMNET-2026
rustydb Jan 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 🛶 CANU v1.6.27
# 🛶 CANU v1.6.29

CANU (CSM Automatic Network Utility) will float through a Shasta network and make switch setup and validation a breeze.

Expand Down Expand Up @@ -1313,6 +1313,32 @@ Version : GL.10.09.0010
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

## Using `canu-inventory` with Ansible

`canu-inventory` is a dynamic inventory script that queries a `sls_input_file.json` in the working directory, or an API gateway (`$SLS_API_GW`). It can be called directly to print the information or it can be passed as an argument to `ansible-inventory`.

- `$SLS_API_GW` and `$SLS_TOKEN` (or `$TOKEN`) must be set in order to query the API.
- `$SWITCH_USERNAME` and `$SWITCH_PASSWORD` must be set in order to execute playbooks.
- `ANSIBLE_HOST_KEY_CHECKING=False` can be set to ignore host key checking.
- `-e config_folder` should be set to the directory containing the switch configs.

```bash
# examples
ansible-inventory -i canu-inventory --list
ansible-playbook -i canu-inventory aruba-aoscx.yml -e config_folder=/switch_configs
```

When running the playbook you may need to input the full path to `canu-inventory`, the playbook, and the switch configs.

```bash
# example
ansible-playbook -i /Users/lucasbates/canu-container/venv/bin/canu-inventory /Users/lucasbates/canu-container/canu/canu/inventory/plays/aruba-aoscx.yml -e config_folder=/Users/lucasbates/canu-container/canu
```

If using the API, `$TOKEN` or `$SLS_TOKEN` need to be set.

If running this from outside the cluster over the CMN, `$REQUESTS_CA_BUNDLE` needs to be set

## Uninstallation

`pip3 uninstall canu`
Expand Down Expand Up @@ -1351,13 +1377,33 @@ To reuse a session without reinstalling dependencies use the `-rs` flag instead

# Changelog

## [1.6.26]
## [1.6.30]

- Updated Aruba ansible playbook and documentation.
- Added ansible play to retain mgmt interface configuration. This will help avoid lockouts.
- Added ansible play utilize the aruba checkpoint feature. This will revert the switch config after 1 minute if the switch becomes unresponsive.

## [1.6.29]

- Added dynamic ansible inventory script, installed as `canu-inventory`.
- Added a playbook to validate/upload a config.

## [1.6.28]

- Fix a bug where `bmc` slots were allowed non-existent port `3`.
- Remove confusing references to "bi-directional" in warnings and errors.
- Change versioning of flake8-commas to break dependency loop.
- Add logging to `validate paddle`.
- Begin refactoring the model to better validate and pick slot/port/speed requests.
- Enhance node connection exception messaging in the model.

## [1.6.27]

- Fix login node shasta name for v1 architecture

## [1.6.26]

- Added gpu and kvm node definitions to v1 arrchitecture.
- Added gpu and kvm node definitions to v1 architecture.
- Added logging to `canu generate switch/network config` to clean up output.
- Provided better messaging about next-step handling of missing configs in generated files.

Expand Down
2 changes: 2 additions & 0 deletions canu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ chown -R --reference=. ./dist/linux
%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 dist/linux/canu %{buildroot}%{_bindir}/canu
install -m 755 dist/linux/canu-inventory %{buildroot}%{_bindir}/canu-inventory

%pre
getent passwd canu >/dev/null || \
useradd -U -m -s /bin/bash -c "CANU user" canu

%files
%attr(755, canu, canu) %{_bindir}/canu
%attr(755, canu, canu) %{_bindir}/canu-inventory
%license LICENSE

%changelog
22 changes: 22 additions & 0 deletions canu/inventory/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MIT License
#
# (C) Copyright [2022] Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
"""CANU."""
Loading