mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 10:23:13 -06:00
Merge remote-tracking branch 'origin/master' into azure_deployments
# Conflicts: # group_vars/aws_node_local.yml # roles/product_startup/molecule/bitbucket/tests/test_default.py # roles/product_startup/molecule/default/tests/test_default.py # roles/product_startup/molecule/synchrony/tests/test_default.py # roles/product_startup/tasks/main.yml
This commit is contained in:
@@ -8,7 +8,10 @@ if [[ $ID = "amzn" ]]; then
|
|||||||
python3-devel \
|
python3-devel \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python2-boto3 \
|
python2-boto3 \
|
||||||
python2-botocore
|
python2-botocore \
|
||||||
|
python-pip
|
||||||
|
|
||||||
|
python -m pip install lxml
|
||||||
|
|
||||||
else
|
else
|
||||||
# FIXME: Currently assumes Debian-based
|
# FIXME: Currently assumes Debian-based
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
|
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
|
||||||
|
|
||||||
java_version: "8"
|
java_major_version: "8"
|
||||||
postgres_version: "9.6"
|
postgres_version: "9.6"
|
||||||
git_version: "2.14.4"
|
git_version: "2.14.4"
|
||||||
atl_shared_mountpoint: "/media/atl"
|
atl_shared_mountpoint: "/media/atl"
|
||||||
|
|||||||
@@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
atl_jvm_heap: "2048m"
|
atl_jvm_heap: "2048m"
|
||||||
atl_fonts_fallback_dirs:
|
atl_fonts_fallback_dirs:
|
||||||
- "{{ atl_java_home }}/lib/fonts/fallback/"
|
- "{{ atl_java_home }}/lib/fonts/fallback/"
|
||||||
- "{{ atl_jre_home }}/lib/fonts/fallback/"
|
|
||||||
|
|
||||||
|
|
||||||
atl_autologin_cookie_age: "{{ lookup('env', 'ATL_AUTOLOGIN_COOKIE_AGE') }}"
|
atl_autologin_cookie_age: "{{ lookup('env', 'ATL_AUTOLOGIN_COOKIE_AGE') }}"
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,7 @@ def test_confluence_config_file(host):
|
|||||||
assert f.contains('<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>')
|
assert f.contains('<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>')
|
||||||
|
|
||||||
@pytest.mark.parametrize('font', [
|
@pytest.mark.parametrize('font', [
|
||||||
# '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf',
|
# '/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
||||||
# '/usr/lib/jvm/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
|
||||||
'/opt/atlassian/confluence/current/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
'/opt/atlassian/confluence/current/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
||||||
])
|
])
|
||||||
def test_fonts_installed_and_linked(host, font):
|
def test_fonts_installed_and_linked(host, font):
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ def test_seraph_file(host):
|
|||||||
assert f.contains('<param-value>COOKIEAGE</param-value>')
|
assert f.contains('<param-value>COOKIEAGE</param-value>')
|
||||||
|
|
||||||
@pytest.mark.parametrize('font', [
|
@pytest.mark.parametrize('font', [
|
||||||
'/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf',
|
'/usr/lib/jvm/java/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
||||||
'/usr/lib/jvm/jre/lib/fonts/fallback/NotoSansJavanese-Regular.ttf'
|
|
||||||
])
|
])
|
||||||
def test_fonts_installed_and_linked(host, font):
|
def test_fonts_installed_and_linked(host, font):
|
||||||
f = host.file(font)
|
f = host.file(font)
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
name:
|
name:
|
||||||
- "google-noto-*"
|
- "google-noto-*"
|
||||||
|
|
||||||
- name: Link the language fonts into the JDK/JRE
|
- name: Link the language fonts into the JDK
|
||||||
# Not idiomatic, but cleaner that messing with nested lookups...
|
# Not idiomatic, but cleaner than messing with nested lookups...
|
||||||
shell:
|
shell:
|
||||||
cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/"
|
cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/"
|
||||||
creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
|
creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
|
||||||
|
|||||||
@@ -52,7 +52,6 @@
|
|||||||
insertafter: "EOF"
|
insertafter: "EOF"
|
||||||
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
||||||
|
|
||||||
|
|
||||||
- name: Configure login properties
|
- name: Configure login properties
|
||||||
template:
|
template:
|
||||||
src: seraph-config.xml.j2
|
src: seraph-config.xml.j2
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
name:
|
name:
|
||||||
- "fonts-noto"
|
- "fonts-noto"
|
||||||
|
|
||||||
- name: Link the language fonts into the JDK/JRE
|
- name: Link the language fonts into the JDK
|
||||||
# Not idiomatic, but cleaner that messing with nested lookups...
|
# Not idiomatic, but cleaner than messing with nested lookups...
|
||||||
shell:
|
shell:
|
||||||
cmd: "ln -sf /usr/share/fonts/truetype/noto/* {{ item }}/"
|
cmd: "ln -sf /usr/share/fonts/truetype/noto/* {{ item }}/"
|
||||||
creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
|
creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
|
||||||
|
|||||||
@@ -28,6 +28,9 @@
|
|||||||
remote_src: true
|
remote_src: true
|
||||||
src: "{{ atl_product_home_shared }}/jira-config.properties"
|
src: "{{ atl_product_home_shared }}/jira-config.properties"
|
||||||
dest: "{{ atl_product_home }}/jira-config.properties"
|
dest: "{{ atl_product_home }}/jira-config.properties"
|
||||||
|
owner: "{{ atl_product_user }}"
|
||||||
|
group: "{{ atl_product_user }}"
|
||||||
|
mode: 0644
|
||||||
when: jira_config_properties.stat.exists
|
when: jira_config_properties.stat.exists
|
||||||
|
|
||||||
- name: Override JVM memory settings.
|
- name: Override JVM memory settings.
|
||||||
|
|||||||
@@ -5,3 +5,11 @@ postgres_version: "9.6"
|
|||||||
# Disable these when using the product installer, otherwise we end up
|
# Disable these when using the product installer, otherwise we end up
|
||||||
# fighting with it.
|
# fighting with it.
|
||||||
atl_use_system_jdk: false
|
atl_use_system_jdk: false
|
||||||
|
|
||||||
|
# Ubuntu and Ansible use different architecture nomenclature; provide
|
||||||
|
# an easy method for translating between them
|
||||||
|
debian_architecture_translations:
|
||||||
|
x86_64: amd64
|
||||||
|
aarch64: arm64
|
||||||
|
|
||||||
|
debian_architecture: "{{ debian_architecture_translations[ansible_architecture] | default(ansible_architecture) }}"
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ def test_user_created(host):
|
|||||||
@pytest.mark.parametrize('exe', [
|
@pytest.mark.parametrize('exe', [
|
||||||
'/usr/bin/git',
|
'/usr/bin/git',
|
||||||
'/usr/bin/javac',
|
'/usr/bin/javac',
|
||||||
'/usr/lib/jvm/java/bin/java',
|
'/usr/lib/jvm/java/bin/java'
|
||||||
'/usr/lib/jvm/java/jre/bin/java'
|
|
||||||
])
|
])
|
||||||
def test_package_exes(host, exe):
|
def test_package_exes(host, exe):
|
||||||
assert host.file(exe).exists
|
assert host.file(exe).exists
|
||||||
|
|||||||
@@ -1,10 +1,33 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Install JDK if necessary on Amazon Linux
|
- name: Add AdoptOpenJDK repo and install if necessary on Amazon Linux
|
||||||
yum:
|
block:
|
||||||
name:
|
|
||||||
- java-1.{{ java_major_version }}.0-openjdk-devel
|
- name: Add AdoptOpenJDK yum repository
|
||||||
|
yum_repository:
|
||||||
|
name: AdoptOpenJDK
|
||||||
|
file: adoptopenjdk
|
||||||
|
description: AdoptOpenJDK Repo
|
||||||
|
baseurl: "https://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/amazonlinux/{{ ansible_distribution_version }}/{{ ansible_architecture }}/"
|
||||||
|
gpgkey: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
|
||||||
|
gpgcheck: yes
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install AdoptOpenJDK
|
||||||
|
yum:
|
||||||
|
name: "adoptopenjdk-{{ java_major_version }}-hotspot"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Ensure common JDK symlink exists
|
||||||
|
alternatives:
|
||||||
|
link: "/usr/lib/jvm/java"
|
||||||
|
name: "java_sdk"
|
||||||
|
path: "/usr/lib/jvm/adoptopenjdk-{{ java_major_version }}-hotspot"
|
||||||
|
priority: 99
|
||||||
|
|
||||||
when: atl_use_system_jdk
|
when: atl_use_system_jdk
|
||||||
|
tags:
|
||||||
|
- runtime_pkg
|
||||||
|
|
||||||
- name: Install other base packages on Amazon Linux
|
- name: Install other base packages on Amazon Linux
|
||||||
yum:
|
yum:
|
||||||
|
|||||||
@@ -1,25 +1,35 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Install JDK if necessary on Ubuntu
|
- name: Add AdoptOpenJDK repo and install if necessary on Ubuntu
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Install JDK package
|
- name: Install gnupg
|
||||||
package:
|
apt:
|
||||||
name:
|
name: gnupg
|
||||||
- openjdk-{{ java_major_version }}-jdk-headless
|
state: present
|
||||||
|
|
||||||
|
- name: Add AdoptOpenJDK debian repo public key
|
||||||
|
apt_key:
|
||||||
|
url: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add AdoptOpenJDK debian repository
|
||||||
|
apt_repository:
|
||||||
|
repo: "deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb {{ ansible_distribution_release }} main"
|
||||||
|
state: present
|
||||||
|
filename: adoptopenjdk
|
||||||
|
|
||||||
|
- name: Install AdoptOpenJDK
|
||||||
|
apt:
|
||||||
|
name: "adoptopenjdk-{{ java_major_version }}-hotspot"
|
||||||
|
update_cache: yes
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Ensure common JDK symlink exists
|
- name: Ensure common JDK symlink exists
|
||||||
alternatives:
|
alternatives:
|
||||||
link: "/usr/lib/jvm/java"
|
link: "/usr/lib/jvm/java"
|
||||||
name: "java_sdk"
|
name: "java_sdk"
|
||||||
path: "/usr/lib/jvm/java-8-openjdk-amd64"
|
path: "/usr/lib/jvm/adoptopenjdk-{{ java_major_version }}-hotspot-{{ debian_architecture }}"
|
||||||
priority: 99
|
|
||||||
|
|
||||||
- name: Ensure common JRE symlink exists
|
|
||||||
alternatives:
|
|
||||||
link: "/usr/lib/jvm/jre"
|
|
||||||
name: "jre"
|
|
||||||
path: "/usr/lib/jvm/java-8-openjdk-amd64/jre"
|
|
||||||
priority: 99
|
priority: 99
|
||||||
|
|
||||||
when: atl_use_system_jdk
|
when: atl_use_system_jdk
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ atl_startup_exec_path: "{{ atl_product_installation_current }}/{{ atl_startup_sc
|
|||||||
atl_startup_exec_options: ["-fg"]
|
atl_startup_exec_options: ["-fg"]
|
||||||
atl_startup_systemd_params: []
|
atl_startup_systemd_params: []
|
||||||
|
|
||||||
|
atl_systemd_service_dir_map:
|
||||||
|
amazon: "/usr/lib/systemd/system"
|
||||||
|
ubuntu: "/lib/systemd/system"
|
||||||
|
atl_systemd_service_dir: "{{ atl_systemd_service_dir_map[ansible_distribution|lower] }}"
|
||||||
|
|
||||||
atl_systemd_service_name: "{{ atl_product_edition }}.service"
|
atl_systemd_service_name: "{{ atl_product_edition }}.service"
|
||||||
|
|
||||||
atl_systemd_service_target: "multi-user.target"
|
atl_systemd_service_target: "multi-user.target"
|
||||||
|
|||||||
@@ -29,8 +29,11 @@
|
|||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Create systemd dir if necessary
|
- name: Create systemd dir if necessary
|
||||||
file:
|
file:
|
||||||
path: '/usr/lib/systemd/system/'
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- '/usr/lib/systemd/system/'
|
||||||
|
- '/lib/systemd/system/'
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: product_startup
|
- role: product_startup
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
|
|
||||||
def test_service_file(host):
|
def test_service_file(host):
|
||||||
f = host.file('/lib/systemd/system/bitbucket.service')
|
systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib"
|
||||||
|
f = host.file(systemd_prefix+'/systemd/system/bitbucket.service')
|
||||||
assert f.contains("^ExecStart=/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh -fg --no-search$")
|
assert f.contains("^ExecStart=/opt/atlassian/bitbucket/current/bin/start-bitbucket.sh -fg --no-search$")
|
||||||
assert f.contains("^UMask=0027$")
|
assert f.contains("^UMask=0027$")
|
||||||
assert f.contains("^LimitNOFILE=4096$")
|
assert f.contains("^LimitNOFILE=4096$")
|
||||||
|
|||||||
@@ -12,8 +12,11 @@
|
|||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Create systemd dir if necessary
|
- name: Create systemd dir if necessary
|
||||||
file:
|
file:
|
||||||
path: '/usr/lib/systemd/system/'
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- '/usr/lib/systemd/system/'
|
||||||
|
- '/lib/systemd/system/'
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: product_startup
|
- role: product_startup
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
|
|
||||||
def test_service_file(host):
|
def test_service_file(host):
|
||||||
f = host.file('/lib/systemd/system/jira-software.service')
|
systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib"
|
||||||
|
f = host.file(systemd_prefix+'/systemd/system/jira-software.service')
|
||||||
assert f.contains("^ExecStart=/opt/atlassian/jira-software/current/bin/start-jira.sh -fg$")
|
assert f.contains("^ExecStart=/opt/atlassian/jira-software/current/bin/start-jira.sh -fg$")
|
||||||
assert f.user == 'root'
|
assert f.user == 'root'
|
||||||
assert f.group == 'root'
|
assert f.group == 'root'
|
||||||
|
|||||||
@@ -20,8 +20,11 @@
|
|||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Create systemd dir if necessary
|
- name: Create systemd dir if necessary
|
||||||
file:
|
file:
|
||||||
path: '/usr/lib/systemd/system/'
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- '/usr/lib/systemd/system/'
|
||||||
|
- '/lib/systemd/system/'
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: product_startup
|
- role: product_startup
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
|
|
||||||
def test_service_file(host):
|
def test_service_file(host):
|
||||||
f = host.file('/lib/systemd/system/synchrony.service')
|
systemd_prefix = "/lib" if host.system_info.distribution == "ubuntu" else "/usr/lib"
|
||||||
|
f = host.file(systemd_prefix+'/systemd/system/synchrony.service')
|
||||||
assert f.contains("^ExecStart=/opt/atlassian/bin/start-synchrony$")
|
assert f.contains("^ExecStart=/opt/atlassian/bin/start-synchrony$")
|
||||||
assert f.contains("^EnvironmentFile=/etc/atl$")
|
assert f.contains("^EnvironmentFile=/etc/atl$")
|
||||||
assert f.contains("^EnvironmentFile=/etc/atl.synchrony$")
|
assert f.contains("^EnvironmentFile=/etc/atl.synchrony$")
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: "Set the systemd_dir"
|
|
||||||
set_fact:
|
|
||||||
systemd_dir: "{% if ansible_distribution|lower=='ubuntu' %}/lib/systemd/system{% else %}/usr/lib/systemd/system{% endif %}"
|
|
||||||
|
|
||||||
- name: "systemd_dir debug"
|
|
||||||
debug:
|
|
||||||
msg: "systemd_dir {{ systemd_dir }}"
|
|
||||||
|
|
||||||
- name: "Install systemd service file"
|
- name: "Install systemd service file"
|
||||||
template:
|
template:
|
||||||
src: "product.service.j2"
|
src: "product.service.j2"
|
||||||
dest: "{{ systemd_dir }}/{{ atl_systemd_service_name }}"
|
dest: "{{ atl_systemd_service_dir }}/{{ atl_systemd_service_name }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
|||||||
Reference in New Issue
Block a user