some WIP for adding bitbucket mesh support

This commit is contained in:
Geoff Jacobs
2022-08-30 13:16:37 +10:00
parent 4854676d50
commit 6df489e579
4 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
mesh_install_dir: /opt/atlassian/mesh
bitbucket_mesh_maven_repo: https://packages.atlassian.com/maven-external
bitbucket_mesh_version: "1.3.1"

View File

@@ -0,0 +1,51 @@
---
- name: set up the bitbucket mesh group
ansible.builtin.group:
name: "{{ atl_product_user }}"
gid: 1001
state: present
- name: set up the bitbucket mesh user
ansible.builtin.user:
name: "{{ atl_product_user }}"
uid: 1001
state: present
comment: "mesh_runtime_user"
groups: "{{ atl_product_user }}"
home: "{{ mesh_install_dir }}"
- name: Create Bitbucket dirs if necessary
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0750
state: directory
with_items:
- "{{ atl_home_base }}/{{ atl_product_edition }}"
- "{{ mesh_install_dir }}"
- name: Template out the mesh service file
ansible.builtin.template:
src: mesh.service.j2
dest: "/usr/lib/systemd/system/mesh.service"
owner: "root"
group: "root"
mode: 0740
- name: download the mesh distribution using maven
community.general.maven_artifact:
group_id: "com.atlassian.bitbucket.mesh"
artifact_id: "mesh-distribution"
extension: "tar.gz"
repository_url: "{{ bitbucket_mesh_maven_repo }}"
dest: "{{ mesh_install_dir }}"
mode: "0644"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
register: maven_download
- name: debug
debug:
var: maven_download

View File

@@ -0,0 +1,26 @@
[Unit]
Description=Atlassian bitbucket-mesh
After=syslog.target network-online.target
[Service]
Type=forking
UMask=0027
User={{ atl_product_user }}
Group={{ atl_product_user }}
StandardOutput=journal+console
StandardError=journal+console
LimitNOFILE=65336
Environment=MESH_HOME={{ atl_home_base }}/{{ atl_product_edition }}
Environment=JAVA_HOME=/usr/lib/jvm/java
Environment=JRE_HOME=/usr/lib/jvm/java
Environment=JMX_REMOTE_AUTH=password
Environment=JMX_PASSWORD_FILE=/var/atlassian/application-data/jmx/jmx.access
Environment="JVM_SUPPORT_RECOMMENDED_ARGS=-Dmesh.enabled=true -Dplugin.bitbucket-git.mesh.sidecar.child-process=false -Dcom.sun.management.jmxremote.port=4444 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath={{ atl_home_base }}/{{ atl_product_edition }}/log"
Environment=JVM_MAXIMUM_MEMORY={{ atl_jvm_heap }}
PIDFile={{ atl_home_base }}/{{ atl_product_edition }}/log/mesh.pid
PassEnvironment=JMX_REMOTE_AUTH JMX_PASSWORD_FILE JAVA_HOME
ExecStart={{ mesh_install_dir }}/current/bin/start-mesh.sh
ExecStop={{ mesh_install_dir }}/current/bin/stop-mesh.sh
[Install]
WantedBy=multi-user.target