forked from adoptium/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-jck.yml
55 lines (54 loc) · 1.57 KB
/
ubuntu-jck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###############################################
# AdoptOpenJDK - Ansible JCK Playbook for: #
# Ubuntu 16 on x86 (depends on openjdk-8-jre) #
###############################################
- hosts: "{{ groups['Vendor_groups'] | default('jck-*-ubuntu*') }}"
remote_user: root
become: yes
tasks:
- block:
- name: Load AdoptOpenJDKs variable file
include_vars: adoptopenjdk_variables.yml
- name: OS update -- apt-get upgrade
apt: upgrade=safe update_cache=yes
tags: patch_update
- name: Install JCK prerequisistes
apt: pkg={{ item }} state=latest
with_items:
- ant
- acl
- gcc
- gedit
- gnome-terminal
- git
- gv
- make
- unzip
- openjdk-8-jre
- printer-driver-cups-pdf
- vnc4server
- xvfb
- xterm
- name: Create Jenkins user
action: user name="{{ Jenkins_Username }}" state=present
ignore_errors: yes
tags: jenkins_user
- name: Set ssh key for jenkins user
authorized_key:
user: "{{ Jenkins_Username }}"
state: present
key: "{{ lookup('file', '{{ Jenkins_User_SSHKey }}') }}"
- name: Start virtual X display on :1
shell: Xvfb :1 -screen 0 1280x1024x24 &
args:
creates: /tmp/.X1-lock
become: yes
become_user: jenkins
- name: Add cron job to check for updates
cron: name="Check for Updates every Sunday at 5am"
weekday="6"
minute="0"
hour="5"
user=root
job="/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade"
state=present