» Home » Docs
Howto start using (R)?ex
This is a small howto showing the first steps with Rex.
Using Modules and Templates
In this example you will learn how to build a ntp module that uploads custom ntp.conf files for your test-, pre-prod-, and production environment.
Working with packages
If you want to install or remove packages on your server Rex gives you a few functions to do this.
Just enough Perl for Rex
Perl is a scripting language designed to keep easy things easy, and make hard things possible. In this tutorial you will learn just enough Perl to write your own Rex tasks.
- Cheat Sheet
This guide tries to help you getting started with using Rex to manage OpenWrt boxes.
Manage your Amazon EC2 instances
This chapter will show you how to manage your Amazon EC2 instances.
- Manage your Amazon EC2 instances
Rex Book (work in progress)
SSH as an agent
To setup an environment to work with Rex you don't have to do much. You have to install Rex on your workstation or a central administration server. For most distributions you'll find packages on the package server.
Version Control with Git
We recommend you to use a version control system for your development. Especially if you're working in a team it will bring you many advantages.
Example of a complete Rex code infrastructure
For maintainable and reusable code it is important to start with the right infrastructure choices and tools. In this chapter you will learn how to setup and design your project to achieve this.
- SSH as an agent
The Rex DSL
Rex is capable to use two different SSH implementations under the hood: Net::SSH2 which is default on Windows, and the combination of Net::OpenSSH and Net::SFTP::Foreign on other platforms.
Rex offers you a powerfull way to group your servers. In this chapter you will learn the basics and also learn how to use databases to generate groups.
With environments it is easy to group your servers depending on the maturity of your configuration or your code. You can create environments for dev, staging and production machines. There is no limit for environments, so you can create as much as you need.
A template is a text file containing special variables or perl code inside it. So with this technique you can generate dynamic configuration files. For example if you want to configure apache only to listen on a special ethernet device (eth0 for example) templates are what you need.
Getting information of the environment
Often you need to know some things of the environment where you are currently connected. For example if you need to install apache on Debian and CentOS you have to provide different packages names.
- Getting information of the environment
Working with Files and Packages
Working with Files
One task in configuration management is managing files and keeping them in a consistant state. Rex gives you some easy to use functions to work with files.
Installing packages is easy. You can use the pkg function for this.
- Working with Files
Managing Datacenters and the Cloud
Deploying OpenLDAP and SSSD
OpenLDAP (http://www.openldap.org/) is an open source directory server widely used for account management. It is easy to setup and administrate. There are also some Webfrontends like http://phpldapadmin.sourceforge.net/ and https://www.ldap-account-manager.org/lamcms/. SSSD (https://fedorahosted.org/sssd/) is the acronym for System Security Services Daemon. With its help it is possible to to authenticate your linux users against an OpenLDAP directory server with some nifty additions like offline support.
- Deploying OpenLDAP and SSSD
A word on backward compatibility
Everyone knows the pain if something gets deprecated and one have to port his old (and stable) code to a new version of a library or a framework. There is enough work to do instead of fixing code to work with newer versions of them.
API Documentation for Version 1.3