If you used vars_files or vars_prompt, could it be done all in one pass?
Michael DeHaan wrote:
If you used vars_files or vars_prompt, could it be done all in one pass?
Very likely - the one I put together for a test lab installation of gitlab on Ubuntu is a single playbook (although with around a dozen templates and 3 scripts). I can dig it out if anyone is interested - would need to remove the 2 database and 1 account password obviously.
The scripts used - one does the ruby install (short circuiting if that version of ruby is already in place), one is a slightly modified version of the mysql lockdown script that ships with mysql (modified so I can run it non-interactively under ansible), and the last is an odds and sods bit of gitlab setup that ensures that ssh can connect to localhost and generally sets up gitolite (so this one handles part of the reason why Alexander's playbook cannot run in one pass).
The bit I haven't done is a gitlab upgrade of an existing installation. I suspect that might be hard to do well - it may even be easier to just backup, zilch the existing install, install new, restore from backup.
Nigel.
Alexander Teinum wrote:
Very likely - the one I put together for a test lab installation of
gitlab on Ubuntu is a single playbook (although with around a dozen
templates and 3 scripts). I can dig it out if anyone is interested -
would need to remove the 2 database and 1 account password obviously.It would be great if you made it available.
I have put a lightly modified (removed/concealed some site specific stuff), onto github at
https://github.com/nigelm/ansible_sample_gitlab
The scripts used - one does the ruby install (short circuiting if that
version of ruby is already in place), one is a slightly modified
version
of the mysql lockdown script that ships with mysql (modified so I can
run it non-interactively under ansible), and the last is an odds and
sods bit of gitlab setup that ensures that ssh can connect to localhost
and generally sets up gitolite (so this one handles part of the reason
why Alexander's playbook cannot run in one pass).Did you find a way to skip the Ruby installation step using only Ansible
� i.e. no external shell scripts? I read about the conditional
execution, but I didn�t find a way to write what would resemble an
if-block for a set of tasks.
No solution to that right now.
Only one I can think of would be to gather some custom facts including the ruby patch level.
With the changes to command/shell coming up you would be able to use a custom exit code from the script to mean that no changes were made.
Nigel.
If you don't want to write a fact, you can always use 'register'.