video: https://www.miradot.se/post/automation-webinar-del-1
aci.yml
server.yml
These installation instructions assumes you have a python environment with python-pip installed.
pip3 install -r requirements.txt
(OPTION 1) python3 setup_aci.py
(OPTION 2) python3 setup_server.py
(OPTION 1) ansible-playbook aci.yml -i hosts
(OPTION 2) ansible-playbook server.yml -i hosts
python3 setup_tf.py
Make changes to aci.tf and vmware.tf to your choosing (or use examples).
terraform init
terraform plan
terraform apply ; yes
(OPTIONAL, USE WITH CARE) terraform destroy ; yes
These installation instructions assumes you have a python environment with python-pip installed.
pip3 install -r requirements.txt
python3 setup_iac.py
Make changes to aci.tf and vmware.tf to your choosing (or use examples).
Create a project in gitlab
CI/CD variables needed:
- ANSIBLE_VAULT_PASSWORD ; Password chosen in setup_iac.py (-pv)
- CI_PUSH_TOKEN ; User settings > Access Tokens > Choose a Name and check "write_repository"
- CI_PUSH_USER ; <gitlab user>
- CI_PUSH_URL ; <gitlab_fqdn>
- CI_PROJECT_NAME ; <project name>
- TF_ACI_PASS ; ACI Password
- TF_VC_PASS ; vCenter Password
git clone <project url>
cp -r 3.0_iac/ <folder in step above>
cd <folder in step above>
git add .
git commit -m "my awesome iac"
git push
video: https://www.miradot.se/post/automation-webinar-del-2
Will gather information from specified NXOS devices and parse the configuration. After the configuration and files
has been pushed to gitlab it's possible to manage the device(s) with git.
These installation instructions assumes you have a python environment with python-pip installed.
pip3 install -r requirements.txt
python3 setup.py
Create a project in gitlab
CI/CD variables needed:
ANSIBLE_VAULT_PASSWORD ; Password chosen in setup_iac.py (-pv)
git clone <url to git project>
cp -r 1.0_nxos_existing_no_netbox/ <folder in step above>
cd <folder in step above>/ansible
ansible-playbook init.yml -i hosts --ask-vault-pass ; Password chosen in setup.py (-pv)
cd ..
git add .
git commit -m "[skip ci] new host_vars"
git push
Make changes to the ansible/host_vars files according to preferences.
git add .
git commit -m "changes"
git push
Will gather information from specified NXOS devices and parse the configuration. After the configuration and files
has been pushed to gitlab it's possible to manage the device(s) with git and Netbox.
Netbox support:
these installation instructions assumes you have a python environment with python-pip installed.
pip3 install -r requirements.txt
python3 setup.py
scp netbox_tools/webhook_proxy_svc.py <netbox>
ssh <netbox>
screen
gunicorn -b :5000 --access-logfile - --error-logfile - webhook_proxy_svc:app
ctrl + a + d
exit
https://<netbox>/admin/extras/webhook/
Name: interfaces_update
Object types: dcim > interface
Enabled checked
Type create checked
Type update checked
URL: http://localhost:5000/netbox_webhook/
HTTP method: POST
HTTP content type: application/json
Body template: {"msg": "interfaces updated"}
Create a project in gitlab
CI/CD variables needed:
ANSIBLE_VAULT_PASSWORD ; Password chosen in setup_iac.py (-pv)
Create a pipeline trigger
git clone <project url>
cp -r 2.0_nxos_existing_with_netbox/ <folder in step above>
cd <folder in step above>/ansible
ansible-playbook init.yml -i hosts --ask-vault-pass ; Password chosen in setup.py (-pv)
cd ..
git add .
git commit -m "[skip ci] new host_vars"
git push
Make changes to the ansible/host_vars files according to preferences.
git add .
git commit -m "changes"
git push
OR make Name/Interface changes in Netbox according to preferences
OR make changes with sommerjobber tool: python3 netbox_tools/tool.py
If you have questions, concerns, bug reports, etc., please create an issue against this repository.
This project is supposed to work as examples to get started with automation in several areas. If you have any suggestions on what else to include, feel free to reach ut by creating an issue.
Copyright (c) 2020, Miradot AB
This code is licensed under the MIT License. See LICENSE for details.
Owner
Contributors
Categories
Products
Application Centric Infrastructure (ACI)NX-OSProgramming Languages
AnsibleTerraformPythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community