mono-infrastructure/ansible/playbooks/tasks/mantis.yml

94 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2021-01-10 00:49:05 +00:00
---
# Configure mantis
- name: Configure SELinux booleans
2021-01-23 09:59:28 +00:00
ansible.posix.seboolean:
2021-01-10 00:49:05 +00:00
name: "{{ item }}"
persistent: true
state: true
with_items:
- httpd_can_network_connect_db
- httpd_can_network_connect
- httpd_can_sendmail
- name: Install necessary packages
yum:
name: "{{ mantis_pkg }}"
state: present
tags:
- packages
2021-01-21 00:55:13 +00:00
- name: Download the bugtracker
get_url:
url: "http://downloads.sourceforge.net/mantisbt/mantisbt-{{ mantis_version }}.tar.gz"
dest: "/tmp/mantisbt-{{ mantis_version }}.tar.gz"
checksum: "{{ mantis_checksum }}"
- name: Extract mantis
unarchive:
src: "/tmp/mantisbt-{{ mantis_version }}.tar.gz"
dest: "/var/www"
owner: apache
group: apache
2021-02-09 19:12:22 +00:00
mode: '0644'
2021-01-21 00:55:13 +00:00
remote_src: true
2021-04-03 00:30:42 +00:00
- name: Generate crypto salt
2021-04-03 00:43:12 +00:00
shell: "set -o pipefail && cat /dev/urandom | head -c 64 | base64 --wrap=0"
2021-04-03 00:30:42 +00:00
changed_when: "1 != 1"
register: cryptosalt_string
2021-01-21 00:55:13 +00:00
- name: Configure mantis
template:
src: "var/www/mantis/config/config_inc.php.j2"
dest: "/var/www/mantisbt-{{ mantis_version }}/config/config_inc.php"
owner: apache
group: apache
mode: '0640'
2021-04-03 00:30:42 +00:00
- name: Deploy plugins from Mantis GitHub
git:
repo: "https://github.com/mantisbt-plugins/{{ item }}.git"
dest: "/var/www/mantisbt-{{ mantis_version }}/plugins/{{ item }}"
update: true
version: master
with_items:
- Snippets
- name: Deploy custom libravatar plugin
git:
repo: "https://github.com/nazunalika/mantisbt-libravatar.git"
dest: "/var/www/mantisbt-{{ mantis_version }}/plugins/Libravatar"
update: true
version: main
2021-01-21 00:55:13 +00:00
- name: Configure httpd
template:
src: "etc/httpd/conf.d/mantis.conf.j2"
dest: "/etc/httpd/conf.d/mantis.conf"
owner: root
group: root
mode: '0644'
2021-04-03 00:30:42 +00:00
- name: Database import template
template:
src: "tmp/mantis_import.sql.j2"
dest: "/tmp/mantis_import.sql.j2"
owner: root
group: root
mode: '0600'
# We will need to generate this
# name: Import database if required
# community.general.postgresql_db:
# name: "{{ mantis_db_name }}"
# target: /tmp/mantis_import.sql
# owner: "{{ mantis_db_user }}"
# state: restore
# login_host: "{{ mantis_db_host }}"
# login_user: "{{ mantis_db_user }}"
# login_password: "{{ mantis_db_pass }}"
- name: Patch up some pages
import_tasks: mantispatch.yml
...