--- # tasklist for setting up the CGit file list - name: Install semanage ansible.builtin.package: name=/usr/sbin/semanage state=present tags: cgit - name: Create the git root directory (/srv/git) ansible.builtin.file: dest=/srv/git state=directory mode=0755 tags: cgit - name: Ensure the repo list file exists ansible.builtin.copy: content="" dest=/srv/git/pkgs-git-repos-list force=no owner=apache group=apache mode=0644 tags: cgit - name: Install the script ansible.builtin.copy: src=make-cgit-pkgs-list.sh dest=/usr/local/bin/make-cgit-pkgs-list.sh mode=0755 when: inventory_hostname.startswith('pkgs') tags: cgit - name: Install the script for fedorapeople ansible.builtin.copy: src=make-people-git.sh dest=/usr/local/bin/make-people-git.sh mode=0755 when: inventory_hostname.startswith('people') tags: cgit # # For the batcave we just have a small static list # - name: Install the file for batcave ansible.builtin.copy: src=cgit-projects-batcave dest=/etc/cgit-projects-batcave mode=0644 when: inventory_hostname.startswith('batcave') tags: cgit - 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 make-cgit-pkgs-list 1d 2>&1'" when: inventory_hostname.startswith('pkgs') tags: cgit - name: Install the cron job for fedora people cgit cron: > name="make-people-git" cron_file="make-people-git" minute=*/10 user=root job="/usr/local/bin/lock-wrapper make-people-git '/usr/local/bin/make-people-git.sh | /usr/local/bin/nag-once make-people-git 1d 2>&1'" when: inventory_hostname.startswith('people') tags: cgit - name: Check the selinux context of the repo list ansible.builtin.command: matchpathcon /srv/git/pkgs-git-repos-list register: gitlistcontext check_mode: no changed_when: false tags: - config - cgit - selinux - name: Set the SELinux policy for the repo list ansible.builtin.command: semanage fcontext -a -t git_content_t "/srv/git/pkgs-git-repos-list" when: gitlistcontext.stdout.find('git_content_t') == -1 tags: - config - cgit - selinux