Skip to content

Commit

Permalink
qemu-ansible: deploy a /etc/config/lime-node template to set hostname…
Browse files Browse the repository at this point in the history
…, domain, ap_ssid, and no lan protocol on eth2
  • Loading branch information
altergui committed Dec 17, 2020
1 parent 283196d commit 4fa1fbb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/ansible/qemu_cloud_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
port: "{{ lm_ifname }}_2"
when: eth2 | default() != ""

- name: deploy template
template:
dest: "/tmp/lime_node_{{ node_id }}"
src: lime-node

- name: run qemu
shell: (../qemu_dev_start --no-serial --no-create-ifaces --node-id {{ node_id }} --eth0 {{ lm_ifname }}_0 --eth2 {{ lm_ifname }}_2 {{ rootfs }} {{ ramfs }} &)

Expand Down
24 changes: 24 additions & 0 deletions tools/ansible/templates/lime-node
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

config lime 'system'
option hostname '{{inventory_hostname_short}}'
option domain 'cloud{{cloud}}.test'

config lime 'network'

config lime 'wifi'
option ap_ssid 'cloud{{cloud}}'
option apname_ssid 'cloud{{cloud}}/%H'

config net 'eth2'
option linux_name 'eth2'
# no 'lan' protocol to avoid being added to br-lan
list protocols 'ieee80211s'
list protocols 'anygw'
list protocols 'batadv:%N1'
list protocols 'bmx6:13'
list protocols 'olsr:14'
list protocols 'olsr6:15'
list protocols 'olsr2:16'
list protocols 'babeld:17'
list protocols 'bmx7:18'

3 changes: 3 additions & 0 deletions tools/qemu_dev_start
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ if [ "$_arg_libremesh_workdir" ]; then
done
fi

# quick hack used by qemu_cloud_start.yml ansible playbook
[ -e /tmp/lime_node_${NODE_ID} ] && mv /tmp/lime_node_${NODE_ID} ${temp_dir}/etc/config/lime-node

# build the cpio
( cd /tmp/lime_rootfs_${NODE_ID} && find . | cpio --quiet -o -H newc > /tmp/lime_rootfs_${NODE_ID}.cpio )

Expand Down

0 comments on commit 4fa1fbb

Please sign in to comment.