Skip to content

Commit f378136

Browse files
y6vmeqtgadiev
authored andcommitted
Add SapMachine: EPMLDI-1738 (#97) (#98)
* Add SapMachine (Linux): EPMLDI-1738 (#97) * fix tests: EPMLDI-1738 (#97) * fix s3: EPMLDI-1738 (#97) * add win: EPMLDI-1738 (#97) * fix verison: EPMLDI-1738 (#97) * fix tag for gitlab-ci: EPMLDI-1738 (#97)
1 parent 38ebbb5 commit f378136

File tree

22 files changed

+1111
-19
lines changed

22 files changed

+1111
-19
lines changed

.gitlab-ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,48 @@ AWS adoptopenjdk Windows:
249249
- molecule test -s cloud-aws-adoptopenjdk-windows
250250
tags:
251251
- aws
252+
253+
AWS sapmachine-10:
254+
variables:
255+
AWS_REGION: us-east-1
256+
stage: deployment test
257+
script:
258+
- molecule test -s cloud-aws-sapmachine-10
259+
tags:
260+
- aws
261+
262+
AWS sapmachine-11:
263+
variables:
264+
AWS_REGION: us-east-1
265+
stage: deployment test
266+
script:
267+
- molecule test -s cloud-aws-sapmachine-11
268+
tags:
269+
- aws
270+
271+
AWS sapmachine-12:
272+
variables:
273+
AWS_REGION: us-east-1
274+
stage: deployment test
275+
script:
276+
- molecule test -s cloud-aws-sapmachine-12
277+
tags:
278+
- aws
279+
280+
AWS sapmachine-13:
281+
variables:
282+
AWS_REGION: us-east-1
283+
stage: deployment test
284+
script:
285+
- molecule test -s cloud-aws-sapmachine-13
286+
tags:
287+
- aws
288+
289+
AWS sapmachine-windows:
290+
variables:
291+
AWS_REGION: us-east-1
292+
stage: deployment test
293+
script:
294+
- molecule test -s cloud-aws-sapmachine-windows
295+
tags:
296+
- aws

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ This Ansible role has the following features for:
3535
- Install JDK, JRE
3636
- Additional opportunity to install from adoptopenjdk-fallback, repositories, web, local source, s3, chocolatey.
3737

38+
39+
**SapMachine**
40+
41+
- Install JDK, JRE
42+
- Additional opportunity to install from sapmachine-fallback, web, local source, s3.
43+
3844
DISCLAIMER: usage of any version of this role implies you have accepted the
3945
[Oracle Binary Code License Agreement for Java SE](http://www.oracle.com/technetwork/java/javase/terms/license/index.html).
4046

@@ -89,6 +95,11 @@ Requirements
8995
- 11
9096
- 12
9197
- 13
98+
- **Supported SapMachine version**:
99+
- 10
100+
- 11
101+
- 12
102+
- 13
92103
- **Supported OS**:
93104
- Ubuntu
94105
- bionic
@@ -112,6 +123,7 @@ Requirements
112123
- `sapjvm`
113124
- `zulu`
114125
- `adoptopenjdk`
126+
- `sapmachine`
115127

116128
**Notice**: this variable is mandatory in case of installing other distribution than 'openjdk'.
117129

@@ -121,7 +133,7 @@ Requirements
121133
- `jdk` (default)
122134
- `jre`
123135

124-
- `transport` Artifact source transport. Use `openjdk-fallback`(OpenJDK only), `repositories`(OpenJDK only), `sapjvm-fallback`(SAPJVM only), `adoptopenjdk-fallback`(AdoptOpenJDK only), `zulu-fallback`(ZULU only), `local`, `web` or `s3` for more predictable result.
136+
- `transport` Artifact source transport. Use `openjdk-fallback`(OpenJDK only), `repositories`(OpenJDK only), `sapjvm-fallback`(SAPJVM only), `adoptopenjdk-fallback`(AdoptOpenJDK only),`sapmachine-fallback`(SapMachine only), `zulu-fallback`(ZULU only), `local`, `web` or `s3` for more predictable result.
125137

126138
Available:
127139
- `repositories` Installing OpenJDK java from system repositories (yum or apt, Linux only)
@@ -132,6 +144,7 @@ Requirements
132144
- `sapjvm-fallback` fetching artifact from SAP site.
133145
- `zulu-fallback` fetching artifact from AZUL site.
134146
- `adoptopenjdk-fallback` fetching artifact from adoptopenjdk site.
147+
- `sapmachine-fallback` fetching artifact from SapMachine site.
135148
- `openjdk-fallback` fetching artifact from jdk.java.net.
136149
This is default value for `transport` variable
137150

@@ -318,6 +331,18 @@ https://docs.ansible.com/ansible/latest/modules/aws_s3_module.html#requirements
318331
adoptopenjdk_impl: openj9
319332
java_major_version: 8
320333
```
334+
### Installing SapMachine sapmachine-jre-10 from sapmachine-fallback:
335+
```yaml
336+
- name: Install SapMachine
337+
hosts: all
338+
339+
roles:
340+
- role: lean_delivery.java
341+
java_distribution: sapmachine
342+
transport: sapmachine-fallback
343+
java_package: jre
344+
java_major_version: 10
345+
```
321346
License
322347
-------
323348

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
# - sapjvm
66
# - zulu
77
# - adoptopenjdk (not supported 9/10)
8+
# - sapmachine (suported only 10/11/12/13)
89
java_distribution: openjdk
910

1011
# OpenJDK tarball supported only jdk
1112
# Oracle java supported jre/server-jre/jdk
1213
# AdoptOpenJDK supported jdk/jre
14+
# SapMachine supported jdk/jre
1315
java_package: jdk
1416

1517
# AdoptOpenJDK Implementation (hotspot/openj9)
1618
adoptopenjdk_impl: hotspot
1719

18-
# OpenJDK Redhat: 8 (packages) / 11 (package for centos7, tarball for all other) / 12 (tarball)
20+
# OpenJDK Redhat: 8 (packages) / 11 (package for centos7, tarball for all other) / 12 (tarball)
1921
# OpenJDK Debian: 8 (packages) / 11 (package for ubuntu18, tarball for all other) / 12 (tarball)
2022
# Oracle java: 8 (jre/server-jre/jdk) / 11 (jdk)
2123
java_major_version: 12
@@ -46,6 +48,7 @@ transport: openjdk-fallback
4648
# - "adoptopenjdk-fallback" Install from artifact downloaded from adoptopenjdk site
4749
# - "sapjvm-fallback" Install from artifact downloaded from SAP site
4850
# - "zulu-fallback" Install from artifact downloaded from AZUL site
51+
# - "sapmachine-fallback" Install from artifact downloaded from SapMachine site
4952

5053
transport_web: '{{ transport_web_default }}'
5154
transport_local: "/tmp/openjdk-11.0.2_linux-x64_bin.tar.gz"

molecule/cloud-aws-adoptopenjdk-12/prepare.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,3 @@
5959
register: status
6060
until: status is succeeded
6161
become: true
62-
63-
- name: Prepare host to S3 transport
64-
hosts: localhost
65-
vars:
66-
transport_s3_bucket: java-molecule-s3-test
67-
transport_s3_path: /java/adoptopenjdk/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz
68-
java_download_path: /tmp
69-
tasks:
70-
- name: Download artifact from s3
71-
aws_s3:
72-
bucket: '{{ transport_s3_bucket }}'
73-
object: '{{ transport_s3_path }}'
74-
dest: '{{ java_download_path }}/{{ transport_s3_path | basename }}'
75-
mode: get
76-
overwrite: different
77-
retries: 5
78-
delay: 2
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
options:
5+
role-file: requirements.yml
6+
driver:
7+
name: ec2
8+
lint:
9+
name: yamllint
10+
options:
11+
config-file: .yamllint
12+
platforms:
13+
- name: test-aws-centos7-sapmachine-jdk-tarball-10
14+
image: ami-9887c6e7
15+
platform: centos7
16+
instance_type: m5.large
17+
region: us-east-1
18+
vpc_subnet_id: subnet-0f2b9cd66faea38af
19+
assign_public_ip: false
20+
spot_price: 0.04
21+
security_group_name:
22+
- default
23+
wait_timeout: 1800
24+
ssh_user: centos
25+
groups:
26+
- rhel_family
27+
- sapmachine
28+
- jdk
29+
- sapmachine_fallback
30+
31+
- name: test-aws-centos8-sapmachine-jre-tarball-10
32+
image: ami-0ed2ad9dc845b42b6
33+
platform: centos8
34+
instance_type: m5.large
35+
region: us-east-1
36+
vpc_subnet_id: subnet-0f2b9cd66faea38af
37+
assign_public_ip: false
38+
spot_price: 0.04
39+
security_group_name:
40+
- default
41+
wait_timeout: 1800
42+
ssh_user: centos
43+
groups:
44+
- rhel_family
45+
- sapmachine
46+
- jre
47+
- sapmachine_fallback
48+
49+
- name: test-aws-Debian9-sapmachine-jre-tarball-10
50+
image: ami-003f19e0e687de1cd
51+
platform: debian9
52+
instance_type: m5.large
53+
region: us-east-1
54+
vpc_subnet_id: subnet-0f2b9cd66faea38af
55+
assign_public_ip: false
56+
spot_price: 0.04
57+
security_group_name:
58+
- default
59+
wait_timeout: 1800
60+
ssh_user: admin
61+
groups:
62+
- debian_family
63+
- sapmachine
64+
- jre
65+
- sapmachine_fallback
66+
67+
- name: test-aws-ubuntu18-sapmachine-jdk-tarball-10
68+
image: ami-012fd5eb46f56731f
69+
platform: ubuntu18
70+
instance_type: m5.large
71+
region: us-east-1
72+
vpc_subnet_id: subnet-0f2b9cd66faea38af
73+
assign_public_ip: false
74+
spot_price: 0.04
75+
security_group_name:
76+
- default
77+
wait_timeout: 1800
78+
ssh_user: ubuntu
79+
groups:
80+
- debian_family
81+
- sapmachine
82+
- jdk
83+
- sapmachine_fallback
84+
85+
- name: test-aws-ubuntu18-sapmachine-s3-10
86+
image: ami-012fd5eb46f56731f
87+
profile_name: epmldi-instance-profile
88+
platform: ubuntu18
89+
instance_type: m5.large
90+
region: us-east-1
91+
vpc_subnet_id: subnet-0f2b9cd66faea38af
92+
assign_public_ip: false
93+
spot_price: 0.04
94+
security_group_name:
95+
- default
96+
wait_timeout: 1800
97+
ssh_user: ubuntu
98+
groups:
99+
- debian_family
100+
- sapmachine
101+
- s3
102+
103+
provisioner:
104+
name: ansible
105+
log: false
106+
config_options:
107+
defaults:
108+
callback_whitelist: profile_tasks,timer
109+
inventory:
110+
group_vars:
111+
sapmachine:
112+
java_distribution: sapmachine
113+
java_major_version: 10
114+
jdk:
115+
java_package: jdk
116+
jre:
117+
java_package: jre
118+
sapmachine_fallback:
119+
transport: sapmachine-fallback
120+
s3:
121+
transport: s3
122+
transport_s3_bucket: java-molecule-s3-test
123+
transport_s3_path: /java/sapmachine/sapmachine-jdk-10.0.2.13_linux-x64_bin.tar.gz
124+
transport_s3_aws_access_key: "{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
125+
transport_s3_aws_secret_key: "{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
126+
playbooks:
127+
create: ../resources/provisioning/AWS/create.yml
128+
prepare: ../cloud-aws-sapmachine-10/prepare.yml
129+
destroy: ../resources/provisioning/AWS/destroy.yml
130+
verify: ../resources/tests/verify.yml
131+
lint:
132+
name: ansible-lint
133+
scenario:
134+
name: cloud-aws-sapmachine-10
135+
verifier:
136+
name: ansible
137+
lint:
138+
name: ansible-lint
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
roles:
5+
- role: ansible-role-java
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
- name: Include common prepare
3+
import_playbook: ../resources/provisioning/AWS/prepare.yml
4+
5+
- name: Prepare Debian
6+
hosts: debian_family
7+
tasks:
8+
9+
- name: Add universe repository for bionic
10+
apt_repository:
11+
repo: deb http://archive.ubuntu.com/ubuntu bionic universe
12+
state: present
13+
when: ansible_distribution_release == 'bionic'
14+
become: true
15+
16+
- name: Install python packages
17+
apt:
18+
name:
19+
- python-setuptools
20+
state: present
21+
register: status
22+
until: status is succeeded
23+
become: true
24+
25+
- name: Prepare RHEL
26+
hosts: rhel_family
27+
tasks:
28+
29+
- name: Enable EPEL repository
30+
yum:
31+
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-\
32+
{{ ansible_distribution_major_version }}.noarch.rpm"
33+
state: 'present'
34+
register: status
35+
until: status is succeeded
36+
become: true
37+
38+
- name: Prepare host to S3 transport
39+
hosts: s3
40+
tasks:
41+
42+
- name: Install pip package
43+
package:
44+
name: 'python-pip'
45+
state: present
46+
register: status
47+
until: status is succeeded
48+
become: true
49+
50+
- name: Install boto module
51+
pip:
52+
name:
53+
- botocore
54+
- boto
55+
- boto3
56+
state: present
57+
executable: 'pip'
58+
extra_args: --upgrade
59+
register: status
60+
until: status is succeeded
61+
become: true

0 commit comments

Comments
 (0)