DCD-224: Generalise and expand testing of product base role.

This commit is contained in:
Steve Smith
2019-04-09 16:18:47 +10:00
parent 1823f5891e
commit c639ad2bbb
7 changed files with 39 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
java_version: "1.8.0"
java_major_version: "8"
postgres_version: "9.6"
git_version: "2.14.4"

View File

@@ -6,8 +6,10 @@ driver:
lint: lint:
name: yamllint name: yamllint
platforms: platforms:
- name: instance - name: amazon_linux2
image: centos:7 image: amazonlinux:2
- name: ubuntu_lts
image: ubuntu:bionic
provisioner: provisioner:
name: ansible name: ansible
lint: lint:

View File

@@ -6,4 +6,5 @@
atl_product_home: "/opt/atlassian/product" atl_product_home: "/opt/atlassian/product"
atl_installer_temp: "/opt/atlassian/temp" atl_installer_temp: "/opt/atlassian/temp"
roles: roles:
- role: linux_common
- role: product_base - role: product_base

View File

@@ -21,3 +21,11 @@ def test_dirs_created(host, target):
assert d.exists assert d.exists
assert d.is_directory assert d.is_directory
assert d.user == 'testuser' assert d.user == 'testuser'
@pytest.mark.parametrize('target', [
'/usr/bin/git',
'/usr/bin/psql',
'/usr/bin/javac'
])
def test_package_exes(host, exe):
assert host.file(exe).exists

View File

@@ -0,0 +1,8 @@
---
- name: Install Java and other base packages on Amazon Linux
yum:
name:
- java-{{ java_version }}-openjdk-devel
- git-{{ git_version }}
- postgresql

View File

@@ -1,5 +1,8 @@
--- ---
- name: Perform distro-specific tasks
include: "{{ ansible_distribution|lower }}.yml"
- name: Create product user - name: Create product user
user: user:
name: "{{ atl_product_user }}" name: "{{ atl_product_user }}"

View File

@@ -0,0 +1,8 @@
---
- name: Install Java and other base packages on Ubuntu
package:
name:
- openjdk-{{ java_major_version }}-jdk-headless
- postgresql-client
- git