Skip to content

Ansible role that configures basic system settings of OpenWRT device

License

Notifications You must be signed in to change notification settings

pe-pe/ansible_role_openwrt_config_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenWRT Config System

Role Quality CI

Ansible role that configures basic system settings of OpenWRT device (mainly those which are usually defined in /etc/config/system).

Requirements

None

Role variables

Configuration settings defined in openwrt_config_system variable which are to be applied on OpenWRT device.

openwrt_config_system:
  hostname: myrouter
  timezone: "CET-1CEST,M3.5.0,M10.5.0/3"
  zonename: "Europe/Warsaw"
  conloglevel: 8
  cronloglevel: 6
  log_ip: 127.0.0.1
  log_proto: udp
  ntp:
    enabled: 1
    enable_server: 0
    servers: ["0.europe.pool.ntp.org", "1.europe.pool.ntp.org"]

If openwrt_config_system configuration variable is not present - no changes are made by role.

Dependencies

This role depends on Ansible role gekmihesg.openwrt which allows to manage OpenWRT and derivatives with Ansible but without Python.

Example playbook using the role

./host_vars
./host_vars/myrouter.yml

---
openwrt_config_system:
  hostname: myrouter
  timezone: "CET-1CEST,M3.5.0,M10.5.0/3"
  zonename: "Europe/Warsaw"

./inventory.ini

[openwrt]
myrouter

./roles
./roles/requirements.yml

---
roles:
- name: gekmihesg.openwrt
- name: pe_pe.openwrt_config_system

./site.yml

---
- hosts: all
  roles:
    - role: gekmihesg.openwrt
    - role: pe_pe.openwrt_config_system

./ansible.cfg

[defaults]
# Define inventory location
inventory = ./inventory.ini
# Where to put roles downloaded from galaxy and other repos
roles_path = ./roles
# Defaults to /tmp to avoid flash wear on target device
remote_tmp = /tmp

Example execution

Install roles and requirements:

ansible-galaxy role install -r roles/requirements.yml

Preview changes execution would perform on inventory:

ansible-playbook site.yml --check --diff

Execute playbook on inventory:

ansible-playbook site.yml

License

MIT

Author Information

PePe

About

Ansible role that configures basic system settings of OpenWRT device

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published