ansible-ops-management/tasks/mantis/mantis.yml

112 lines
3 KiB
YAML
Raw Normal View History

2022-02-27 03:19:20 +00:00
---
# Configure mantis
- name: Configure SELinux booleans
ansible.posix.seboolean:
name: "{{ item }}"
persistent: true
state: true
with_items:
- httpd_can_network_connect_db
- httpd_can_network_connect
- httpd_can_sendmail
- name: Install necessary packages
2022-03-28 05:01:23 +00:00
ansible.builtin.dnf:
2022-02-27 03:19:20 +00:00
name: "{{ mantis_pkg }}"
state: present
tags:
- packages
- name: Download the bugtracker
2023-07-15 07:10:52 +00:00
ansible.builtin.get_url:
2022-02-27 03:19:20 +00:00
url: "http://downloads.sourceforge.net/mantisbt/mantisbt-{{ mantis_version }}.tar.gz"
dest: "/tmp/mantisbt-{{ mantis_version }}.tar.gz"
checksum: "{{ mantis_checksum }}"
- name: Extract mantis
2023-07-15 07:10:52 +00:00
ansible.builtin.unarchive:
2022-02-27 03:19:20 +00:00
src: "/tmp/mantisbt-{{ mantis_version }}.tar.gz"
dest: "/var/www"
owner: apache
group: apache
mode: '0644'
remote_src: true
- name: Generate crypto salt
2023-07-15 07:10:52 +00:00
ansible.builtin.shell: "set -o pipefail && cat /dev/urandom | head -c 64 | base64 --wrap=0"
2022-02-27 03:19:20 +00:00
changed_when: "1 != 1"
register: cryptosalt_string
- name: Configure mantis
2022-03-28 05:01:23 +00:00
ansible.builtin.template:
2022-02-27 03:19:20 +00:00
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'
2022-08-11 02:45:58 +00:00
- name: Configure custom strings
ansible.builtin.template:
src: "var/www/mantis/config/{{ item }}.j2"
dest: "/var/www/mantisbt-{{ mantis_version }}/config/{{ item }}"
owner: apache
group: apache
mode: '0644'
with_items:
- "custom_constants_inc.php"
- "custom_strings_inc.php"
2022-02-27 03:19:20 +00:00
- name: Deploy plugins from Mantis GitHub
2023-07-15 07:10:52 +00:00
ansible.builtin.git:
2022-02-27 03:19:20 +00:00
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
2023-07-15 07:10:52 +00:00
ansible.builtin.git:
2022-02-27 03:19:20 +00:00
repo: "https://github.com/nazunalika/mantisbt-libravatar.git"
dest: "/var/www/mantisbt-{{ mantis_version }}/plugins/Libravatar"
update: true
version: main
- name: Deploy custom mattermost plugin
2023-07-15 07:10:52 +00:00
ansible.builtin.git:
2022-02-27 03:19:20 +00:00
repo: "https://github.com/nazunalika/mantisbt-mattermost.git"
dest: "/var/www/mantisbt-{{ mantis_version }}/plugins/Mattermost"
update: true
version: main
- name: Configure httpd
2022-03-28 05:01:23 +00:00
ansible.builtin.template:
2022-02-27 03:19:20 +00:00
src: "etc/httpd/conf.d/mantis.conf.j2"
dest: "/etc/httpd/conf.d/mantis.conf"
owner: root
group: root
mode: '0644'
- name: Database import template
2022-03-28 05:01:23 +00:00
ansible.builtin.template:
2022-02-27 03:19:20 +00:00
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
2023-07-15 07:10:52 +00:00
ansible.builtin.import_tasks: mantispatch.yml
2022-02-27 03:19:20 +00:00
...