Bash Configuration Management
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Doc Update Jun 19, 2015 Update Apr 2, 2017
LICENSE Update Dec 14, 2016


Waffles is a suite of Bash scripts to manage server resources in an idempotent fashion.

Installation and Usage

To install Waffles, just clone the git repo and source the file:

$ git clone /opt/waffles
$ source /opt/waffles/
$ apt.pkg --help

You can integrate Waffles into a Bash script by sourcing the file within the script:

source /opt/waffles/

# Install memcached
apt.pkg --package memcached --version latest

# Set the listen option
file.line --file /etc/memcached.conf --line "-l" --match "^-l"

# Determine the amount of memory available and use half of that for memcached
memory_bytes=$(elements System.Memory.Total 2>/dev/null)
memory=$(( $memory_bytes / 1024 / 1024 / 2 ))

# Set the memory available to memcached
file.line --file /etc/memcached.conf --line "-m $memory" --match "^-m"

# Manage the memcached service
service.sysv --name memcached

# If any changes happened, restart memcached
if [[ -n $waffles_total_changes ]]; then
  exec.mute /etc/init.d/memcached restart


Waffles tries to be as simple as possible while still providing useful utilities for everyday systems administration. If you find a bug or would like to add a feature, just make a patch and open a Pull Request.


Adding unit and acceptance tests are encouraged but not required for Pull Requests.

Unit Tests

Unit tests can be found in tests/ They're mainly used to verify certain functions work correctly.

Acceptance Tests

Acceptance tests are used to verify resources work correctly. Test Kitchen and Docker are used to run the suite of tests. Use the Waffles script to set up Test Kitchen and all other requirements on an Ubuntu-based system.

Test files can be found in tests/kitchen/resources. Each resource test requires 5 functions:

  • setup
  • create
  • update
  • delete
  • teardown

If any of the functions aren't applicable to the resource test you're writing, just issue a return.

You can execute tests by running:

$ cd /opt/waffles/tests/kitchen
$ ./ --platform ubuntu-1404 --resource file.line

--platform will take any regex compatible with the kitchen test command. --resource is the name of any resource you want to test. If you want to run all tests, use all as the value.

More Information

See for more information.