66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
---
|
|
- name: Install git server packages
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
with_items:
|
|
- gitweb
|
|
- highlight
|
|
- perl-Digest-MD5
|
|
|
|
- name: Fix SELinux context from data directory
|
|
community.general.sefcontext:
|
|
path: /export/git(/.*)?
|
|
setype: git_sys_content_t
|
|
|
|
- name: Create git directory
|
|
ansible.builtin.file:
|
|
path: /export/git
|
|
state: directory
|
|
mode: "0755"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: Link git directory
|
|
ansible.builtin.file:
|
|
path: /srv/git
|
|
src: /export/git
|
|
state: link
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: Create gitweb config
|
|
ansible.builtin.copy:
|
|
dest: /etc/gitweb.conf
|
|
src: gitweb.conf
|
|
mode: "0644"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: Create robots.txt
|
|
ansible.builtin.copy:
|
|
dest: /var/www/git/robots.txt
|
|
content: "User-agent: *\nDisallow:\n"
|
|
mode: "0644"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
|
|
- name: Copy local layout files
|
|
ansible.builtin.copy:
|
|
dest: "/var/www/git/static/{{ item }}"
|
|
src: "{{ item }}"
|
|
mode: "0644"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
with_items:
|
|
- logo.png
|
|
- gitweb-local.css
|
|
|
|
- name: Create apache git config
|
|
ansible.builtin.copy:
|
|
dest: /etc/httpd/conf.local.d/git.conf
|
|
src: git.conf
|
|
mode: "0644"
|
|
owner: root
|
|
group: "{{ ansible_wheel }}"
|
|
notify: Restart apache
|