From a29f50a19a3839c12e609a22f8cd319e553da7a0 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Tue, 27 Jan 2015 15:31:17 +0100 Subject: [PATCH] distgit: Merge in the cgit/make_pkgs_list role Having it split out was causing trouble, because distgit depends on it, but it depends on the /srv/git folder being created, which is created in the distgit role... Nothing else uses this though, so merging it is the easy way out. --- roles/cgit/make_pkgs_list/tasks/main.yml | 33 ------------------- .../files/make-cgit-pkgs-list.sh | 0 roles/distgit/tasks/main.yml | 30 +++++++++++++++++ 3 files changed, 30 insertions(+), 33 deletions(-) delete mode 100644 roles/cgit/make_pkgs_list/tasks/main.yml rename roles/{cgit/make_pkgs_list => distgit}/files/make-cgit-pkgs-list.sh (100%) diff --git a/roles/cgit/make_pkgs_list/tasks/main.yml b/roles/cgit/make_pkgs_list/tasks/main.yml deleted file mode 100644 index c2e699d6ca..0000000000 --- a/roles/cgit/make_pkgs_list/tasks/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# tasklist for setting up the CGit file list - -- name: install the script - copy: src=make-cgit-pkgs-list.sh dest=/usr/local/bin/make-cgit-pkgs-list.sh mode=0755 - -- name: install the cron job - cron: > - name="make-cgit-pkgs-list" cron_file="ansible-make-cgit-pkgs-list" - minute=*/10 - user=root - job="/usr/local/bin/lock-wrapper make-cgit-pkgs-list '/usr/local/bin/make-cgit-pkgs-list.sh | /usr/local/bin/nag-once fassync 1d 2>&1'" - -- name: ensure the repo list file exists - file: path=/srv/git/pkgs-git-repos-list state=touch owner=apache group=apache mode=0644 - -- name: check the selinux context of the repo list - command: matchpathcon /srv/git/pkgs-git-repos-list - register: gitlistcontext - always_run: yes - changed_when: false - tags: - - config - - cgit - - selinux - -- name: set the SELinux policy for the repo list - command: semanage fcontext -a -t httpd_git_content_t "/srv/git/pkgs-git-repos-list" - when: gitlistcontext.stdout.find('httpd_git_content_t') == -1 - tags: - - config - - cgit - - selinux diff --git a/roles/cgit/make_pkgs_list/files/make-cgit-pkgs-list.sh b/roles/distgit/files/make-cgit-pkgs-list.sh similarity index 100% rename from roles/cgit/make_pkgs_list/files/make-cgit-pkgs-list.sh rename to roles/distgit/files/make-cgit-pkgs-list.sh diff --git a/roles/distgit/tasks/main.yml b/roles/distgit/tasks/main.yml index 4a78126a98..f6140dcc99 100644 --- a/roles/distgit/tasks/main.yml +++ b/roles/distgit/tasks/main.yml @@ -210,6 +210,36 @@ notify: - restart httpd +- name: install the script to generate the repo list + copy: src=make-cgit-pkgs-list.sh dest=/usr/local/bin/make-cgit-pkgs-list.sh mode=0755 + +- name: install the cron job + cron: > + name="make-cgit-pkgs-list" cron_file="ansible-make-cgit-pkgs-list" + minute=*/10 + user=root + job="/usr/local/bin/lock-wrapper make-cgit-pkgs-list '/usr/local/bin/make-cgit-pkgs-list.sh | /usr/local/bin/nag-once fassync 1d 2>&1'" + +- name: ensure the repo list file exists + file: path=/srv/git/pkgs-git-repos-list state=touch owner=apache group=apache mode=0644 + +- name: check the selinux context of the repo list + command: matchpathcon /srv/git/pkgs-git-repos-list + register: gitlistcontext + always_run: yes + changed_when: false + tags: + - config + - cgit + - selinux + +- name: set the SELinux policy for the repo list + command: semanage fcontext -a -t httpd_git_content_t "/srv/git/pkgs-git-repos-list" + when: gitlistcontext.stdout.find('httpd_git_content_t') == -1 + tags: + - config + - cgit + - selinux # -- Lookaside Cache ------------------------------------- # This is the annex to Dist Git, where we host source tarballs.