Skip to content

An ansible role that sets up OpenWrt routers. Python NOT requried on OpenWrt routers.

License

Notifications You must be signed in to change notification settings

bit-kitchen/ansible-role-openwrt-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-role-openwrt-setup

Ansible Role: bit_kitchen.openwrt_setup Build Status: bit-kitchen/ansible-role-openwrt-setup

ansible-galaxy install bit_kitchen.openwrt_setup

An ansible role that sets up OpenWrt routers. Python NOT requried on OpenWrt routers.

Requirements

None.

Role Variables

variable Note
System
zonename Examples: UTC, America/Los Angeles, Asia/Hong Kong.
Check all available timezones at http://openwrt.lan/cgi-bin/luci/admin/system/system
Dropbear
ssh_port SSH port
ssh_public_key SSH public key allowed for passwordless SSH login.
Note: When a key is added, password authentication for SSH will be disabled.
Root/LuCI Password
passwd The root password used for command line and LuCI.
Wireless Wireless variables apply to both 2.4G and 5G
ssid Wi-Fi Name
key Wi-Fi Password
encryption sae, sae-mixed, psk2, psk-mixed, psk, wpa, none
channel auto or channel number
Network
ipaddr LAN IPv4 address
netmask LAN IPv4 netmask
ipv6_disabled Whether to disable IPv6

Note: All variables are undefined by default. Unless a variable is set, no related tasks will be carried out.

Dependencies

This role depends on the gekmihesg.openwrt ansible role, so that python on OpenWrt becomes a non-requirement.

Example Inventory

Note: All OpenWrt hosts must be put under openwrt group.

[openwrt]
openwrt.lan

Example Playbook

- hosts: openwrt
  remote_user: root
  roles:
    - name: bit_kitchen.openwrt_setup
      # System
      zonename: "America/Los Angeles"

      # Dropbear
      ssh_port: 2222
      ssh_public_key: "ssh-rsa AAAAB3Nz...4Fq/k="

      # Root/LuCI Password
      passwd: "MySecretP@ss!"

      # Wireless
      ssid: "OpenWrt"
      key: "MyWiFiMyPass"
      encryption: psk2
      channel: auto

      # Network
      ipaddr: 10.20.30.1
      netmask: 255.255.255.0

License

MIT

Author Information

bit.kitchen

About

An ansible role that sets up OpenWrt routers. Python NOT requried on OpenWrt routers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published