Shared Modules

In the example above, ../shared directory should contain modules directory.

Security Notes

Don't store any sensitive information (passwords etc.) in config.yml. If you
want to keep passwords in git, create a vault.yml file, add it to .gitignore
and store the encrypted version in revision control:

Think of this as just another level of security for your private git repos. You
probably don't want to store the encrypted vault in a public repo.

sudo

Because sudo password is passed as an argument to the
expect script,
it will be visible in the process list on your local computer. This could be
an issue if you're using a shared machine to run setup scripts.

Usage

welder run my-site # runs the playbook defined in my-site.yaml

The run script will compile templates and configs, upload them to the server
(to /home/username/setup) and then it will ask you for the sudo password.
After that, it will execute all *.sh scripts from the modules listed in the
playbook file.

Additional commands:

welder compile <playbook># compiles templates and uploads them to the server
welder cleanup <playbook># remove compiled files from the server

If you want to run a single *.sh script on the server, you can use this:

welder run-script <user@example.com><path/to/script.sh>

NOTE: the run-script command does not compile templates. It merely wraps
ssh -t user@example.com "$(< ./path/to/script.sh)". If you want access to
templates and config, run welder compile <playbook> first and
welder cleanup <playbook> when you're done.

Installation

Install dependencies

Welder requires expect, rsync and ruby. Ruby is used mainly as a
convenient way to parse YAML configuration files.

Optionally, if you'd like to use the templating feature,
you need to install liquid gem:

$ gem install liquid

Check out this repository into /opt/welder (or whatever location you
prefer):

# git clone https://github.com/pch/welder.git /opt/welder

Add a symbolic link to the welder front-end in your $PATH:

# ln -sf /opt/welder/bin/welder /usr/local/bin/welder

Caveats

Since welder allows you to run anything on the server, you should use it
with caution. It won't protect you from screw-ups, like
rm -rf "/$undefined_variable".