(R)?ex is a configuration management framework written in Perl which can be used to simplify and automate various system administrator tasks from deployment management to data center automation. OpenWrt is a Linux distribution for embedded devices and it is widely used on different network equipment by replacing their original firmware. Soon you can combine the power of these two as OpenWrt support is coming into Rex!
I was using Rex for various tasks for almost a year when I wanted to be able to quickly build my OpenWrt-based home wireless router’s configuration from scratch. My first experiments to do it with Rex have failed quickly as soon as I tried to do anything more than running a command directly on the remote box. After hacking my way through the different issues, I suddenly found myself sending a pull request with initial support patches. A bit later it got merged into the upstream project and I was also given access to the testing and build infrastructure, where we ask Mr. Jenkins to help run our tests on KVM images. If you’re interested you can check the current project weather on build.rexify.org.
Given the minimalistic/restricted environments of embedded systems in general, you need some simple preparations before you try to use Rex with OpenWrt. At least the following commands are needed to be run against a vanilla OpenWrt Attitude Adjustment (12.09) installation:
- install perl
opkg update opkg install perl
- install an SFTP server (to avoid
ERROR - Error executing task: Can't call method "open" on an undefined valuemessages)
opkg update opkg install gesftpserver mkdir /usr/libexec ln -s /usr/bin/gesftpserver /usr/libexec/sftp-server
Optionally you may want to install additional Perl components for convenience:
opkg update opkg install perlbase-essential perlbase-xsloader perlbase-digest