--- /dev/null
+---
+openwrt_arch: ar71xx
+openwrt_target: generic
+openwrt_profile: ubnt-unifiac-lite
+openwrt_output_image_suffixes:
+ - "generic-{{ openwrt_profile }}-squashfs-sysupgrade.bin"
+
+openwrt_mixin:
+ /etc/dropbear/authorized_keys:
+ content: |-
+ {% for key in noc_ssh_keys %}
+ {{ key }}
+ {% endfor %}
+
+openwrt_uci:
+ system:
+ - name: system
+ options:
+ hostname: '{{ inventory_hostname }}'
+ timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
+ ttylogin: '0'
+ log_size: '64'
+ urandom_seed: '0'
+
+ - name: timeserver 'ntp'
+ options:
+ enabled: '1'
+ enable_server: '0'
+ server:
+ - '0.lede.pool.ntp.org'
+ - '1.lede.pool.ntp.org'
+ - '2.lede.pool.ntp.org'
+ - '3.lede.pool.ntp.org'
+
+ network:
+ - name: globals 'globals'
+ options:
+ ula_prefix: fdc9:e01f:83db::/48
+
+ - name: interface 'loopback'
+ options:
+ ifname: lo
+ proto: static
+ ipaddr: 127.0.0.1
+ netmask: 255.0.0.0
+
+ - name: interface 'mgmt'
+ options:
+ type: bridge
+ ifname: "eth0.{{ net.mgmt.vlan }}"
+ accept_ra: 0
+ proto: static
+ ipaddr: "{{ net.mgmt.prefix | ipaddr(net.mgmt.offsets.accesspoints + groups.accesspoints.index(inventory_hostname)) | ipaddr('address') }}"
+ netmask: "{{ net.mgmt.prefix | ipaddr('netmask') }}"
+ gateway: "{{ net.mgmt.gw }}"
+ dns: "{{ net.mgmt.dns | join(' ') }}"
+ dns_search: realraum.at
+
+ - name: interface 'iot'
+ options:
+ type: bridge
+ ifname: "eth0.{{ net.iot.vlan }}"
+ accept_ra: 0
+ proto: none
+
+ - name: interface 'lan'
+ options:
+ type: bridge
+ ifname: "eth0.{{ net.lan.vlan }}"
+ accept_ra: 0
+ proto: none
---
# Build-related directories
-global_cache_dir: "{{ inventory_dir }}/.cache/"
-global_artifacts_dir: "{{ inventory_dir }}/files/"
+global_cache_dir: "{{ inventory_dir }}/.cache"
+global_artifacts_dir: "{{ inventory_dir }}/files"
# Default credentials
## Root password; by default, undefined
openwrt_packages_add:
- haveged
- htop
- - hwclock
- ip
- less
- nano
--- /dev/null
+---
+- hosts: accesspoints
+ connection: local
+ roles:
+ - role: openwrt-image
+ delegate_to: localhost
openwrt_packages_extra:
- "-dropbear"
+ - hwclock
- flashrom
- git
- kmod-usb-acm
metrics localconfig_ssh_config_user=root
testvm localconfig_ssh_config_user=root
+[net-zone-mgmt:children]
+accesspoints
+
[net-zone-mgmt:vars]
host_domain=mgmt.realraum.at
[desktops]
wuerfel
+[accesspoints]
+ap[0:1]
[openwrt]
torwaechter
+[openwrt:children]
+accesspoints
+
[openwrt:vars]
localconfig_ssh_config_user=root
Host gw.realraum.at r3-gw
Hostname gw.realraum.at
-Host ap0.mgmt.realraum.at r3g-ap0
- Hostname ap0.mgmt.realraum.at
- User root
-
-Host ap1.mgmt.realraum.at r3g-ap1
- Hostname ap1.mgmt.realraum.at
- User root
-
-Host ap2.mgmt.realraum.at r3g-ap2
- Hostname ap2.mgmt.realraum.at
- User root
-
Host licht.realraum.at r3-licht r3g-licht r3e-licht
Hostname licht.realraum.at
User realraum
openwrt_variant: lede
openwrt_release: 17.01.4
openwrt_download_dir: "{{ global_cache_dir }}/openwrt"
-openwrt_tarball_basename: "{{ openwrt_variant }}-imagebuilder-{{ openwrt_release }}-{{ openwrt_arch }}{% if openwrt_target != 'generic' %}-{{ openwrt_target }}{% endif %}.Linux-x86_64"
+openwrt_tarball_basename: "{{ openwrt_variant }}-imagebuilder-{{ openwrt_release }}-{{ openwrt_arch }}-{{ openwrt_target }}.Linux-x86_64"
openwrt_tarball_name: "{{ openwrt_tarball_basename }}.tar.xz"
openwrt_target: generic
---
- include: fetch.yml
+ run_once: true
when: openwrt_imgbuilder_tarball is not defined
- block:
- name: Build the OpenWrt image
command: >-
make -C {{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }} image
+ {% if openwrt_profile is defined %}PROFILE="{{ openwrt_profile }}" {% endif %}
FILES="{{ openwrt_imgbuilder_files }}"
PACKAGES="{{ openwrt_packages }}"
{% if openwrt_extra_name is defined %} EXTRA_IMAGE_NAME="{{ openwrt_extra_name }}" {% endif %}
state: directory
mode: '0755'
with_items:
- - "{{ openwrt_download_dir }}/dl"
+ - "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
- "{{ openwrt_imgbuilder_files }}/etc/config"
- "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}"
- name: Symlink the cache repository
file:
state: link
- src: "{{ openwrt_download_dir }}/dl"
+ src: "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
path: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/dl"