Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brainstorming: How to improve the workflow for changing IP address #2

Open
bjornfor opened this issue Dec 3, 2024 · 0 comments
Open

Comments

@bjornfor
Copy link
Contributor

bjornfor commented Dec 3, 2024

First, thanks for this really nice project. I'm so happy to have my OpenWrt devices under version control and be able to share configuration between them (thanks to the module system).

My OpenWrt devices are dumb APs which use DHCP, but when they're freshly installed / factory reset, they come up with IPv4 address 192.168.1.1 (standard OpenWrt). If I deploy to them in this state, the (dewclaw) deploy script will fail and start the rollback mechanism, because the devices become "inaccessible" after changing from 192.168.1.1 to a DHCP assigned address (in a different subnet even).

To work around this, I must either manually configure the address in the web UI before running dewclaw, or:

  1. Start the deploy script (nix-build -A dewclaw-env && ./result/bin/deploy-NAME).
  2. Run until ssh -o StrictHostKeyChecking=no root@$NEW_ADDRESS /etc/init.d/config_generation commit; do sleep 10; done && echo "Success!" in a separate terminal.

I was thinking of ways to improve upon this.

  1. Add an --unchecked option to dewclaw, in similar spirit as the LuCI web UI has an "Apply unchecked` option. This would not trigger the rollback mechanism, even if the target becomes inaccessible during the deploy.
  2. Add an option for multiple target IPv4 addresses / hostnames in the config and try them all. (Perhaps too silly.)
  3. Add an --alt-host-addr= option and try them all at runtime.
  4. Add an --after-deploy-addr= option and use that for trying to commit the new configuration.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant