Merge "Add ensure-java role"

This commit is contained in:
Zuul 2020-02-21 15:49:30 +00:00 committed by Gerrit Code Review
commit 2aa8ef9f41
7 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Java Roles
==========
.. zuul:autorole:: ensure-java

View File

@ -12,6 +12,7 @@ Roles
deprecated-roles
galaxy-roles
go-roles
java-roles
js-roles
launchpad-roles
puppet-roles

View File

@ -0,0 +1,10 @@
Ensure that Java is installed
Installs the specified version of the JDK.
**Role Variables**
.. zuul:rolevar:: java_version
:default: 8
Version of Java to install.

View File

@ -0,0 +1 @@
java_version: 8

View File

@ -0,0 +1,5 @@
- name: Install JDK
become: true
package:
name: openjdk-{{ java_version }}-jdk
state: present

View File

@ -0,0 +1,6 @@
- hosts: all
roles:
- ensure-java
tasks:
- name: Print java version
command: java -fullversion

View File

@ -0,0 +1,14 @@
- job:
name: zuul-jobs-test-ensure-java
description: Test the ensure-java role
files:
- roles/ensure-java/.*
- test-playbooks/ensure-java.yaml
run: test-playbooks/ensure-java.yaml
- project:
check:
jobs: &id001
- zuul-jobs-test-ensure-java
gate:
jobs: *id001