video: https://www.miradot.se/post/automation-webinar-del-1
- Ansible installed on local machine
- Cisco ACI
- One or more target machines
aci.yml
- Creates ACI Tenant
- Creates ACI VRF
- Creates ACI Bridge Domain
- Creates ACI Subnet on Bridge Domain
- Creates ACI Application Profile
- Creates ACI Endpoint Group(s)
- Creates ACI Contract(s), Subject(s), Filter(s)
- Creates ACI Contract(s) to EPG binding(s)
server.yml
- Runs apt-update
- Installs apache2
- Removes old index.html
- Copies new index.html from roles/webserver/files to target machine(s)
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
- Terraform installed on local machine
- Cisco ACI
- VMware
- VMware template (Ubuntu, called ubuntu_template)
- Cisco ACI to VMware VMM integration
- Creates ACI Tenant
- Creates ACI VRF
- Creates ACI Bridge Domains
- Creates ACI Subnet on Bridge Domains
- Creates ACI Application Profile
- Creates ACI Endpoint Groups
- Creates ACI Contracts, Subjects, Filters
- Creates ACI Contracts to EPG bindings
- Clones VMware ubuntu_template and spins up two VMs
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
- Self-hosted Gitlab
- Cisco ACI
- VMware
- VMware template (Ubuntu, called ubuntu_template)
- Cisco ACI to VMware VMM integration
- Creates ACI Tenant
- Creates ACI VRF
- Creates ACI Bridge Domains
- Creates ACI Subnet on Bridge Domains
- Creates ACI Application Profile
- Creates ACI Endpoint Groups
- Creates ACI Contracts, Subjects, Filters
- Creates ACI Contracts to EPG bindings
- Clones VMware template and spins up two VMs (web and db)
- Runs two ansible-playbooks
- web: will install apache2 and copy demo website
- db: will install mariadb and inject demo data
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
- Ansible installed on local machine
- Cisco Nexus (VM or Hardware)
- Self-hosted Gitlab
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
- Ansible installed on local machine
- Cisco Nexus (VM or Hardware)
- Self-hosted Gitlab
- Self-hosted Netbox
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:
- Name change
- Description change
- Access vlan change
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.