Add ensure-java role
Change-Id: Ibaf45bd09a47d55ce21af34763563c20f9396cd2
This commit is contained in:
parent
d0591ad98f
commit
bfb3507c5b
4
doc/source/java-roles.rst
Normal file
4
doc/source/java-roles.rst
Normal file
@ -0,0 +1,4 @@
|
||||
Java Roles
|
||||
==========
|
||||
|
||||
.. zuul:autorole:: ensure-java
|
@ -12,6 +12,7 @@ Roles
|
||||
deprecated-roles
|
||||
galaxy-roles
|
||||
go-roles
|
||||
java-roles
|
||||
js-roles
|
||||
launchpad-roles
|
||||
puppet-roles
|
||||
|
10
roles/ensure-java/README.rst
Normal file
10
roles/ensure-java/README.rst
Normal 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.
|
1
roles/ensure-java/defaults/main.yaml
Normal file
1
roles/ensure-java/defaults/main.yaml
Normal file
@ -0,0 +1 @@
|
||||
java_version: 8
|
5
roles/ensure-java/tasks/main.yaml
Normal file
5
roles/ensure-java/tasks/main.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
- name: Install JDK
|
||||
become: true
|
||||
package:
|
||||
name: openjdk-{{ java_version }}-jdk
|
||||
state: present
|
6
test-playbooks/ensure-java.yaml
Normal file
6
test-playbooks/ensure-java.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- ensure-java
|
||||
tasks:
|
||||
- name: Print java version
|
||||
command: java -fullversion
|
14
zuul-tests.d/java-jobs.yaml
Normal file
14
zuul-tests.d/java-jobs.yaml
Normal 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
|
Loading…
Reference in New Issue
Block a user