Uploaded a new version which supports wildcard dependencies. I'll go
into some detail here, but you'll have to forgive stream-of-
consciousness delivery. Food awaits me.
The change allows you to put something like this in your YAML:
__SNIP__
role9:
depends:
- @ALL@
__SNIP__
Since there was interest in having a scripts repository in another
thread, I'll demonstrate how this feature could be used to make one
that is guaranteed to be installed before other roles run.
In roles.yaml:
__SNIP__
roles:
scripts:
before: [ @ALL@ ]
__SNIP__
Drop some files into the script role:
roles/
scripts/files/var/lib/slack/scripts/ # in anticipation of this
some day being built in ;-)
install_package*
...
And then from any other role, something like this could be in your
preinstall:
__SNIP__
#!/bin/bash
set -e
export PATH="/var/lib/slack/scripts:${PATH}"
install_package "apache2"
__SNIP__
Here's the new package:
http://groups.google.com/group/slack-users/web/rolegen-0.2.tar.gz
If you're curious what install_package looks like (though it isn't
really relevant):
__SNIP__
#!/bin/bash
set -e
pkg="$1"
stat="$(dpkg-query -W --showformat='${Status} ${Package}' "${pkg}" 2>/
dev/null)"
if [ "${stat}" != "install ok installed ${pkg}" &>/dev/null ]; then
DEBIAN_FRONTEND=noninteractive apt-get -qq -y --force-yes install "$
{pkg}"
fi
__SNIP__
-P
On Aug 7, 9:41 am, Philip <
slla...@gmail.com> wrote:
> I wrote a little script to generate a slack roles.conf from a YAML
> file. I mostly did this to get rid of to large amounts of repetitive
> data I was having to write to the roles.conf when I wanted several
> hosts to have a similar set of roles. It also supports defining
> dependencies between roles which effect their ordering in roles.conf.
> Finally, you can specify your domain name once and it will append that
> to each host entry in your roles.conf.
>
> It is in a slightly hacky state. I've been too lazy to modify the
> object that I use to store the host/role relationships... mostly
> because it works well enough as is. If people find it useful, perhaps
> I'll clean the code up a bit. I've included an example YAML file for
> you to mess around with, and there are some very basic test cases in
> test_rolegen.py. Be afraid ;-)
>
>
http://slack-users.googlegroups.com/web/rolegen-0.1.tar.gz?gda=0_Dx_U...