From 16ffb744be3e4b99cc1f3170b7ea76abdfbe7a53 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Tue, 23 Sep 2014 14:14:24 +0200 Subject: [PATCH] Rearrange some tasks We have a gitolite/check_fedmsg_hooks role, which installs a script and schedules it. Turns out, this script does more than just checking the fedmsg hooks, depending on the command-line arguments used when running it. As such, it makes sense to separate it out into its own role, and make the gitolite/check_fedmsg_hooks role (and any other one using the script) depend on it. For example, this script is used for Fedora Hosted (still in Puppet), and will soon be used for a new distgit hook check. --- .../checks}/files/check-perms.py | 0 roles/git/checks/tasks/main.yml | 14 ++++++++++++++ roles/gitolite/check_fedmsg_hooks/meta/main.yml | 3 +++ roles/gitolite/check_fedmsg_hooks/tasks/main.yml | 10 +--------- 4 files changed, 18 insertions(+), 9 deletions(-) rename roles/{gitolite/check_fedmsg_hooks => git/checks}/files/check-perms.py (100%) create mode 100644 roles/git/checks/tasks/main.yml create mode 100644 roles/gitolite/check_fedmsg_hooks/meta/main.yml diff --git a/roles/gitolite/check_fedmsg_hooks/files/check-perms.py b/roles/git/checks/files/check-perms.py similarity index 100% rename from roles/gitolite/check_fedmsg_hooks/files/check-perms.py rename to roles/git/checks/files/check-perms.py diff --git a/roles/git/checks/tasks/main.yml b/roles/git/checks/tasks/main.yml new file mode 100644 index 0000000000..b16a3972c2 --- /dev/null +++ b/roles/git/checks/tasks/main.yml @@ -0,0 +1,14 @@ +--- +# tasklist for setting up a git check script +# +# The script implements various checks (even though it is named check-perms, +# it checks more than perms), and various other roles can then use it in cron +# jobs, triggered by fedmsg, etc... + +- name: install the needed packages + yum: pkg=git state=present + +- name: install the script + copy: > + src=check-perms.py dest=/usr/local/bin/git-check-perms + owner=root group=root mode=0755 diff --git a/roles/gitolite/check_fedmsg_hooks/meta/main.yml b/roles/gitolite/check_fedmsg_hooks/meta/main.yml new file mode 100644 index 0000000000..edc2fe20eb --- /dev/null +++ b/roles/gitolite/check_fedmsg_hooks/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: +- { role: git/checks } diff --git a/roles/gitolite/check_fedmsg_hooks/tasks/main.yml b/roles/gitolite/check_fedmsg_hooks/tasks/main.yml index 3dcae95441..0bfbc3aea6 100644 --- a/roles/gitolite/check_fedmsg_hooks/tasks/main.yml +++ b/roles/gitolite/check_fedmsg_hooks/tasks/main.yml @@ -1,15 +1,7 @@ --- # tasklist for setting up Gitolite Fedmsg checks -- name: install the needed packages - yum: pkg=git state=present - -- name: install the script - copy: > - src=check-perms.py dest=/usr/local/bin/git-check-perms - owner=root group=root mode=0755 - -- name: install the cron job for the script +- name: schedule check execution cron: > name="git-check-perms" cron_file="ansible-git-check-perms" minute=10 hour=0 weekday=3