Automatic TWiki Deployment
This is a follow-up to my
blog article with the same name. Over there, I wrote about
why, and here's the
how.
Disclaimer: As far as I know, the procedure described here has been used in my own environment only. These days I try to exploit this for test automation, so there'll likely be no changes in the stuff presented here for some time. Proceed at own risk.
Generally speaking, I am following the idea of "Infrastructure as Code" (see
Wikipedia
): The whole system is defined in plain text files, which can (and should!) easily be kept under version control. The text files are a "Vagrantfile" to define a VM and a bunch of YAML files for Ansible to define the configuration.
The current doc has two parts:
I am slightly concerned that this stuff introduces too many different tools and techniques into the mix, though only a tiny fraction of their features is needed. It is a trade-off: I happen to be sufficiently comfortable with Ansible and Vagrant, therefore it was easier to just use these tools instead of writing the same automation procedures focused on TWiki deployment myself.
Things to consider:
- As of today, the playbooks automate deployment of one TWiki configuration with one web server (Apache). The only choice is the distribution, but this is restricted to Debian and Ubuntu. Other distributions need more work because of their different packaging tools (and package names!). How many different sets of configurations are useful?
- A playbook to deploy TWiki could live a life of its own, and maybe be published in the Ansible repository. How relevant is Ansible to the TWiki market?
- To what extent can this stuff be used for test automation? I'm currently experimenting with this topic.
- All that is totally independent of the TWiki codebase itself, with a separate versioning, and irrelevant for TWiki customers. Should it go into a separate repository, e.g. on github? Or merged into TWikiDevContrib (which is in SVN, but not in Plugins)?
- The whole concept defines the configuration of the operating system, the web server, and TWiki into some "Uber-config". Is it useful to create one uber-config file to specify all different options?
--
Contributors:
Harald Jörg - 2018-01-08
Discussion
After working with this stuff for some time I found it too cumbersome to remember the parameters and syntax for direct use of the Ansible commands from "
running the playbooks" - so I now merged it into TWikiDevContrib in
SVN. There are now four subcommands related to VMs. The command framework (
CPAN:MooseX::App::Cmd
) has the big advantage that it is rather self-documenting... so here's what the command says as of today:
haj@hajdesktop:~$ twikidev
twikidev <command> [-?h] [long options...]
-? -h --help show help
Available commands:
Getting help:
help: display a command's help screen
commands: list the application's commands
Managing SVN:
t2b: Copy file(s) from trunk to a branch
Building distributables:
collect: collect all stuff from one or more MANIFEST files to a directory
extract: Extract a tar, tar.gz, or zip archive
packtwp: Take a directory tree from collect and create an executable
Managing a test environment:
vmconfig: Configure your VM test environment
vmcreate: Create a new VM in your test environment
vmstatus: Show status information about a VM
vmdelete: Delete a VM by its IP address suffix
--
Harald Jörg - 2018-02-15
Cool!
--
Peter Thoeny - 2018-02-15