mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
DCD-224: Generalise and expand testing of product base role.
This commit is contained in:
5
roles/product_base/defaults/main.yml
Normal file
5
roles/product_base/defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
java_version: "1.8.0"
|
||||
java_major_version: "8"
|
||||
postgres_version: "9.6"
|
||||
git_version: "2.14.4"
|
||||
@@ -6,8 +6,10 @@ driver:
|
||||
lint:
|
||||
name: yamllint
|
||||
platforms:
|
||||
- name: instance
|
||||
image: centos:7
|
||||
- name: amazon_linux2
|
||||
image: amazonlinux:2
|
||||
- name: ubuntu_lts
|
||||
image: ubuntu:bionic
|
||||
provisioner:
|
||||
name: ansible
|
||||
lint:
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
atl_product_home: "/opt/atlassian/product"
|
||||
atl_installer_temp: "/opt/atlassian/temp"
|
||||
roles:
|
||||
- role: linux_common
|
||||
- role: product_base
|
||||
|
||||
@@ -13,11 +13,19 @@ def test_user_created(host):
|
||||
|
||||
|
||||
@pytest.mark.parametrize('target', [
|
||||
'/opt/atlassian/product',
|
||||
'/opt/atlassian/temp'
|
||||
'/opt/atlassian/product',
|
||||
'/opt/atlassian/temp'
|
||||
])
|
||||
def test_dirs_created(host, target):
|
||||
d = host.file(target)
|
||||
assert d.exists
|
||||
assert d.is_directory
|
||||
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
|
||||
|
||||
8
roles/product_base/tasks/amazon.yml
Normal file
8
roles/product_base/tasks/amazon.yml
Normal 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
|
||||
@@ -1,5 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Perform distro-specific tasks
|
||||
include: "{{ ansible_distribution|lower }}.yml"
|
||||
|
||||
- name: Create product user
|
||||
user:
|
||||
name: "{{ atl_product_user }}"
|
||||
|
||||
8
roles/product_base/tasks/ubuntu.yml
Normal file
8
roles/product_base/tasks/ubuntu.yml
Normal 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
|
||||
Reference in New Issue
Block a user