Sync settings in two or more Turris Omnia routers

I have two Omnia routers, two networks. I want to keep their settings in sync? When I change something in one of them, it will change on another one as well. Or maybe one-way sync would be enough.

Any suggestions? Thanks.

Funny - we both had similiar idea in same time-span … have seen your thread just today, when I posted my little “general-password” idea.

2 Likes

isn’t that excelent usecase for Ansible?

2 Likes

Any working examples please? Or is someone willing to share his setup with me? Thanks.

at your workstation, install ansible:

pip3 install --user ansible

create some play

$ cat helloworld.yaml 
---
- name: HelloWorld
  hosts: turris
  tasks:
    - name: Create a file
      copy:
        content: hello worldn
        dest: /tmp/testfile.txt
$

create inventory with your routers:

$ cat inventory.yaml 
all:
  children:
    infrastructure:
      hosts:
        turris:
          ansible_python_interpreter: /usr/bin/python 

$

run the play with the given inventory

$ ansible-playbook -i ./inventory.yaml ./helloworld.yaml

PLAY [HelloWorld] *****************************************************************************************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************************************************************************************************************************************************************************
ok: [turris]

TASK [Create a file] **************************************************************************************************************************************************************************************************************************************************************************************************
ok: [turris]

PLAY RECAP ************************************************************************************************************************************************************************************************************************************************************************************************************
turris                     : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

$
2 Likes

I qlso thought about ansible. But I think writing playbooks for changing one setting with ad-hoc commands is a big overkill. Unless you want to have your setup stored in a way so its easily replicable from scratch.

I also have two Omnias and I use ansible but not for configuring routers. Overkill. Maybe when ansible gets more developed and will support openwrt with some modules it woukd make more sense to use it.

1 Like