Skip to content

Commit 71d9c8d

Browse files
authored
Merge branch 'master' into xcode_offline_role
2 parents c1f579b + b26a406 commit 71d9c8d

File tree

4 files changed

+33
-222
lines changed

4 files changed

+33
-222
lines changed

ansible/inventory.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ hosts:
8686

8787
- azure:
8888
ubuntu2204-x64-1: {ip: 52.180.147.157, description: Xeon Platinum 8272CL, 16 cores, 64GB}
89+
ubuntu2204-x64-2: {ip: 20.83.24.86, description: 16 cores, 64GB}
8990

9091
- equinix:
9192
ubuntu2204-x64-1: {ip: 145.40.113.173, description: Intel Xeon Gold 40 core}

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles/Dockerfile.sles12

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM registry.suse.com/suse/sles12sp5:latest
22

33
RUN zypper ar https://download.opensuse.org/distribution/leap/15.4/repo/oss/ sles15oss
44
RUN zypper --gpg-auto-import-keys refresh
5-
RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip
5+
RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip hostname
66

77
RUN wget 'https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk' -O /tmp/jdk17.tar.gz
88
RUN mkdir -p /usr/lib/jvm/jdk17 && tar -xpzf /tmp/jdk17.tar.gz -C /usr/lib/jvm/jdk17 --strip-components=1

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/tasks/main.yml

Lines changed: 3 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
#################################################
3-
# Build basic test images for each distribution #
4-
#################################################
2+
##########################################
3+
# Config changes for Dockerhost machines #
4+
##########################################
55

66
- name: Enable ipv6 on Dockerhost
77
lineinfile:
@@ -13,224 +13,6 @@
1313
notify:
1414
- Restart docker service
1515

16-
- name: Send Dockerfiles to remote machine
17-
copy:
18-
src: Dockerfiles/
19-
dest: /tmp/Dockerfiles/
20-
21-
- name: Collate all Dockerfile names
22-
find:
23-
paths: "/tmp/Dockerfiles/"
24-
patterns: "Dockerfile.*"
25-
register: dockerfiles
26-
27-
# Defaulting to x64 in Dockerfiles means no need to special case that one
28-
# since API architecture = ansible_architecture everywhere else we use this
29-
- name: Translate architecture name in dockerfiles
30-
replace: dest={{ item.path }} regexp="arch=x64" replace="arch={{ ansible_architecture }}"
31-
with_items: "{{ dockerfiles.files }}"
32-
when: ansible_architecture != "x86_64"
33-
34-
- name: Set jenkins authorized_Key in dockerfiles
35-
replace: dest={{ item.path }} regexp="Jenkins_User_SSHKey" replace="{{ Jenkins_User_SSHKey }}"
36-
with_items: "{{ dockerfiles.files }}"
37-
38-
- name: Create docker images for each distribution for test
39-
command: docker build --cpu-period=100000 --cpu-quota=800000 -t aqa_{{ item }} --memory=8G -f /tmp/Dockerfiles/Dockerfile.{{ item }} /tmp/Dockerfiles
40-
with_items:
41-
- u1604
42-
- u1804
43-
- u2004
44-
- u2104
45-
- f33
46-
- f34
47-
- f35
48-
- alp311
49-
- alp312
50-
- alp313
51-
- alp314
52-
- ubi8
53-
- deb11
54-
55-
##############################################################
56-
# Start the containers #
57-
# If startallcontainers is skipped, only start three of them #
58-
# ignore_errors simplest way to ignore if already started #
59-
# #
60-
# TODO: Check if started rather than ignore error? #
61-
# hard to 'docker_container_info depends on start time #
62-
# TODO: Use a calculated value instead of 2 core/6Gb #
63-
##############################################################
64-
65-
- name: Start Ubuntu 16.04 container if not already started
66-
community.docker.docker_container:
67-
name: U1604_2222
68-
image: aqa_u1604
69-
ports:
70-
- "2222:22"
71-
cpus: 2.0
72-
memory: 6G
73-
state: started # Make sure container is presented (if not exist then start it)
74-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
75-
detach: yes
76-
tags: startcontainers
77-
failed_when: false
78-
79-
- name: Start Ubuntu 18.04 container if not already started
80-
community.docker.docker_container:
81-
name: U1804_2223
82-
image: aqa_u1804
83-
ports:
84-
- "2223:22"
85-
cpus: 4.0
86-
memory: 6G
87-
state: started # Make sure container is presented (if not exist then start it)
88-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
89-
detach: yes
90-
tags: startcontainers, startallcontainers
91-
failed_when: false
92-
93-
- name: Start Ubuntu 20.04 container if not already started
94-
community.docker.docker_container:
95-
name: U2004_2224
96-
image: aqa_u2004
97-
ports:
98-
- "2224:22"
99-
cpus: 2.0
100-
memory: 6G
101-
state: started # Make sure container is presented (if not exist then start it)
102-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
103-
detach: yes
104-
tags: startcontainers
105-
failed_when: false
106-
107-
- name: Start Ubuntu 21.04 container if not already started
108-
community.docker.docker_container:
109-
name: U2104_2225
110-
image: aqa_aqa_u2104u2004
111-
ports:
112-
- "2225:22"
113-
cpus: 4.0
114-
memory: 6G
115-
state: started # Make sure container is presented (if not exist then start it)
116-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
117-
detach: yes
118-
tags: startcontainers, startallcontainers
119-
failed_when: false
120-
121-
- name: Start Ubuntu 22.04 container if not already started
122-
command: docker run --restart unless-stopped -p 2226:22 --cpus=4.0 --memory=6G --detach --name U2204_2226 aqa_u2204
123-
tags: startcontainers, startallcontainers
124-
failed_when: false
125-
126-
- name: Start fedora 33 container if not already started
127-
community.docker.docker_container:
128-
name: f33.2227
129-
image: aqa_f33
130-
ports:
131-
- "2227:22"
132-
cpus: 2.0
133-
memory: 6G
134-
state: started # Make sure container is presented (if not exist then start it)
135-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
136-
detach: yes
137-
tags: startcontainers
138-
failed_when: false
139-
140-
- name: Start fedora 34 container if not already started
141-
community.docker.docker_container:
142-
name: f34.2232
143-
image: aqa_f34
144-
ports:
145-
- "2232:22"
146-
cpus: 2.0
147-
memory: 6G
148-
state: started # Make sure container is presented (if not exist then start it)
149-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
150-
detach: yes
151-
tags: startcontainers
152-
failed_when: false
153-
154-
- name: Start fedora 35 container if not already started
155-
community.docker.docker_container:
156-
name: f35.2233
157-
image: aqa_f35
158-
ports:
159-
- "2233:22"
160-
cpus: 2.0
161-
memory: 6G
162-
state: started # Make sure container is presented (if not exist then start it)
163-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
164-
detach: yes
165-
tags: startcontainers
166-
failed_when: false
167-
168-
- name: Start Alpine 3.11 container if not already started
169-
community.docker.docker_container:
170-
name: alp311.2228
171-
image: aqa_alp311
172-
ports:
173-
- "2228:22"
174-
cpus: 2.0
175-
memory: 6G
176-
state: started # Make sure container is presented (if not exist then start it)
177-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
178-
detach: yes
179-
tags: startcontainers, startallcontainers
180-
failed_when: false
181-
182-
- name: Start Alpine 3.12 container if not already started
183-
community.docker.docker_container:
184-
name: alp312.2229
185-
image: aqa_alp312
186-
ports:
187-
- "2229:22"
188-
cpus: 2.0
189-
memory: 6G
190-
state: started # Make sure container is presented (if not exist then start it)
191-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
192-
detach: yes
193-
tags: startcontainers
194-
failed_when: false
195-
196-
- name: Start Alpine 3.13 container if not already started
197-
community.docker.docker_container:
198-
name: alp313.2230
199-
image: aqa_alp313
200-
ports:
201-
- "2230:22"
202-
cpus: 2.0
203-
memory: 6G
204-
state: started # Make sure container is presented (if not exist then start it)
205-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
206-
detach: yes
207-
tags: startcontainers
208-
failed_when: false
209-
210-
- name: Start Alpine 3.14 container if not already started
211-
community.docker.docker_container:
212-
name: alp314.2231
213-
image: aqa_alp314
214-
ports:
215-
- "2231:22"
216-
cpus: 2.0
217-
memory: 6G
218-
state: started # Make sure container is presented (if not exist then start it)
219-
restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it)
220-
detach: yes
221-
tags: startcontainers
222-
failed_when: false
223-
224-
- name: Start UBI8 container if not already started
225-
command: docker run --restart unless-stopped -p 2235:22 --cpus=2.0 --memory=6G --detach --name ubi8.2235 aqa_ubi8
226-
tags: startcontainers
227-
failed_when: false
228-
229-
- name: Start Deb11 container if not already started
230-
command: docker run --restart unless-stopped -p 2211:22 --cpus=2.0 --memory=6G --detach --name deb11.2211 aqa_deb11
231-
tags: startcontainers
232-
failed_when: false
233-
23416
# lineinfile does not work here - similar to the operation in /var/log in adopt_etc
23517
# lineinfile: path /proc/sys/kernel/core_pattern state: present: regexp: . line: core.%p
23618
# therefore the following section wil not become live prior to a reboot

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,31 @@
2525
- desktop_installed.stat.exists
2626
- gui_disabled.stdout == ''
2727
tags: disable_gui
28+
29+
# Restart NTPD On Centos 7 after gui disablement
30+
31+
- name: Gather Facts About The Services Present
32+
service_facts:
33+
tags: disable_gui
34+
35+
- name: Check If NTPD Exists In The Service Facts
36+
set_fact:
37+
ntpd_entry_exists: "{{ 'ntpd.service' in services }}"
38+
when: ansible_facts.services is defined
39+
tags: disable_gui
40+
41+
- name: Set Fact Where NTPD Is Not Available As A Service
42+
set_fact:
43+
ntpd_entry_exists: "false"
44+
when: ansible_facts.services is not defined
45+
tags: disable_gui
46+
47+
- name: Start NTP for CentOS7 following GUI disablement
48+
service:
49+
name: ntpd
50+
state: restarted
51+
enabled: yes
52+
when:
53+
- ntpd_entry_exists | default(false) | bool
54+
- (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" )
55+
tags: disable_gui

0 commit comments

Comments
 (0)