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:
|
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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
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
|
- name: Create product user
|
||||||
user:
|
user:
|
||||||
name: "{{ atl_product_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