Add ensure-java role

Change-Id: Ibaf45bd09a47d55ce21af34763563c20f9396cd2
This commit is contained in:
James E. Blair 2020-02-20 07:33:37 -08:00 committed by Monty Taylor
parent d0591ad98f
commit bfb3507c5b
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