This guide provides an Ansible playbook to install Oxidized using Docker Compose for Debian 10+, Ubuntu LTS, and RHEL 9+ compatible systems.
Oxidized is a Ruby gem and can be installed via:
gem install oxidized (requires Ruby development tools)- name: Install Oxidized
hosts: oxidized
become: true
vars:
oxidized_dir: /opt/oxidized
tasks:
- name: Create Oxidized directory
file:
path: "{{ oxidized_dir }}"
state: directory
mode: "0755"
- name: Create Oxidized config directory
file:
path: "{{ oxidized_dir }}/config"
state: directory
mode: "0755"
- name: Create Oxidized configuration file
copy:
dest: "{{ oxidized_dir }}/config/config"
content: |
---
username: readonly
password: your_password
model: junos
interval: 3600
use_syslog: false
debug: false
threads: 30
timeout: 20
retries: 3
rest: 0.0.0.0:8888
output:
default: git
git:
user: Oxidized
email: oxidized@example.com
repo: "/root/.config/oxidized/oxidized.git"
source:
default: csv
csv:
file: "/root/.config/oxidized/router.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
model_map:
cisco: ios
juniper: junos
- name: Create router.db file
copy:
dest: "{{ oxidized_dir }}/config/router.db"
content: |
# hostname:model:username:password
router1.example.com:ios:admin:password
switch1.example.com:ios:admin:password
- name: Create docker-compose.yml
copy:
dest: "{{ oxidized_dir }}/docker-compose.yml"
content: |
services:
oxidized:
image: oxidized/oxidized:latest
container_name: oxidized
ports:
- "8888:8888"
volumes:
- ./config:/root/.config/oxidized
restart: unless-stopped
- name: Start Oxidized container
community.docker.docker_compose:
project_src: "{{ oxidized_dir }}"
state: present
- name: Wait for Oxidized to be ready
uri:
url: http://localhost:8888
status_code: [200, 401]
register: result
until: result.status == 200 or result.status == 401
retries: 10
delay: 5
failed_when: false
For systems without Docker, install via Ruby gems:
- name: Install Oxidized via gem
hosts: oxidized
become: true
tasks:
- name: Install Ruby and build tools
apt:
name:
- ruby
- ruby-dev
- libssh2-1-dev
- libssl-dev
- build-essential
state: present
- name: Install Oxidized gem
gem:
name: oxidized
state: present
- name: Install oxidized-web for web interface
gem:
name: oxidized-web
state: present
oxidized/oxidized on Docker HubAny questions?
Feel free to contact us. Find all contact information on our contact page.