1
0
Fork 0
mirror of https://github.com/myned/ansible-example.git synced 2025-12-05 22:35:46 +00:00
Example environment for Ansible automation with Cisco networking devices
Find a file
2025-04-24 13:10:39 -05:00
inventory files: add comments 2025-04-24 13:08:31 -05:00
logs git: add missing logs dir 2025-04-22 16:29:34 -05:00
playbooks files: add comments 2025-04-24 13:08:31 -05:00
.envrc files: add comments 2025-04-24 13:08:31 -05:00
.gitattributes Initial commit 2025-04-22 14:50:06 -05:00
.gitignore gitignore: enable *.log 2025-04-24 11:37:47 -05:00
ansible.cfg files: add comments 2025-04-24 13:08:31 -05:00
LICENSE Initial commit 2025-04-22 14:50:06 -05:00
README.md readme: update steps 2025-04-24 13:10:39 -05:00
requirements.txt pip: lower python version requirements 2025-04-24 13:00:53 -05:00

About

Example environment for Ansible automation with Cisco networking devices

Tested with:

Installation

Prerequisites

  • Git
  • Python 3.10+
  • Internet access

Note

The following instructions assume Ubuntu 22.04 LTS, optionally over WSL

Clone or download this repository

git clone https://github.com/myned/ansible-example

Go to the project directory

cd ansible-example

Install the Python venv package

Note

The exact package varies depending on your distribution

sudo apt update
sudo apt install python3-venv

Create a Python virtual environment

python3 -m venv .venv

Activate the virtual environment

source .venv/bin/activate

Tip

Shells other than bash may use the relevant activate scripts under .venv/bin/

Install dependencies within the virtual environment

pip install -r requirements.txt

Note

Newer versions of requirements.txt packages may be compatible, but have not been tested

Usage

Tip

Example output is available in the logs/ directory

Read through each file, the comments contain additional context

Edit inventory files as necessary

nano inventory/all.yaml

Run the playbook to show configuration

ansible-playbook -i inventory/all.yaml playbooks/show-interfaces.yaml

Run the playbook to modify configuration

ansible-playbook -i inventory/all.yaml playbooks/disable-interfaces.yaml