diff --git a/ansible/inventory.yml b/ansible/inventory.yml index a30893aa3e..0b2fcc92c3 100644 --- a/ansible/inventory.yml +++ b/ansible/inventory.yml @@ -86,6 +86,7 @@ hosts: - azure: ubuntu2204-x64-1: {ip: 52.180.147.157, description: Xeon Platinum 8272CL, 16 cores, 64GB} + ubuntu2204-x64-2: {ip: 20.83.24.86, description: 16 cores, 64GB} - equinix: ubuntu2204-x64-1: {ip: 145.40.113.173, description: Intel Xeon Gold 40 core} diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles/Dockerfile.sles12 b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles/Dockerfile.sles12 index 60543bfac4..64bcca423a 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles/Dockerfile.sles12 +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/Dockerfiles/Dockerfile.sles12 @@ -2,7 +2,7 @@ FROM registry.suse.com/suse/sles12sp5:latest RUN zypper ar https://download.opensuse.org/distribution/leap/15.4/repo/oss/ sles15oss RUN zypper --gpg-auto-import-keys refresh -RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip +RUN zypper update -y && zypper install -y wget perl openssh-server unzip zip tar gzip hostname RUN wget 'https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk' -O /tmp/jdk17.tar.gz RUN mkdir -p /usr/lib/jvm/jdk17 && tar -xpzf /tmp/jdk17.tar.gz -C /usr/lib/jvm/jdk17 --strip-components=1 diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/tasks/main.yml index a44b457739..040fa3d221 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/DockerStatic/tasks/main.yml @@ -1,7 +1,7 @@ --- -################################################# -# Build basic test images for each distribution # -################################################# +########################################## +# Config changes for Dockerhost machines # +########################################## - name: Enable ipv6 on Dockerhost lineinfile: @@ -13,224 +13,6 @@ notify: - Restart docker service -- name: Send Dockerfiles to remote machine - copy: - src: Dockerfiles/ - dest: /tmp/Dockerfiles/ - -- name: Collate all Dockerfile names - find: - paths: "/tmp/Dockerfiles/" - patterns: "Dockerfile.*" - register: dockerfiles - -# Defaulting to x64 in Dockerfiles means no need to special case that one -# since API architecture = ansible_architecture everywhere else we use this -- name: Translate architecture name in dockerfiles - replace: dest={{ item.path }} regexp="arch=x64" replace="arch={{ ansible_architecture }}" - with_items: "{{ dockerfiles.files }}" - when: ansible_architecture != "x86_64" - -- name: Set jenkins authorized_Key in dockerfiles - replace: dest={{ item.path }} regexp="Jenkins_User_SSHKey" replace="{{ Jenkins_User_SSHKey }}" - with_items: "{{ dockerfiles.files }}" - -- name: Create docker images for each distribution for test - command: docker build --cpu-period=100000 --cpu-quota=800000 -t aqa_{{ item }} --memory=8G -f /tmp/Dockerfiles/Dockerfile.{{ item }} /tmp/Dockerfiles - with_items: - - u1604 - - u1804 - - u2004 - - u2104 - - f33 - - f34 - - f35 - - alp311 - - alp312 - - alp313 - - alp314 - - ubi8 - - deb11 - -############################################################## -# Start the containers # -# If startallcontainers is skipped, only start three of them # -# ignore_errors simplest way to ignore if already started # -# # -# TODO: Check if started rather than ignore error? # -# hard to 'docker_container_info depends on start time # -# TODO: Use a calculated value instead of 2 core/6Gb # -############################################################## - -- name: Start Ubuntu 16.04 container if not already started - community.docker.docker_container: - name: U1604_2222 - image: aqa_u1604 - ports: - - "2222:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start Ubuntu 18.04 container if not already started - community.docker.docker_container: - name: U1804_2223 - image: aqa_u1804 - ports: - - "2223:22" - cpus: 4.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers, startallcontainers - failed_when: false - -- name: Start Ubuntu 20.04 container if not already started - community.docker.docker_container: - name: U2004_2224 - image: aqa_u2004 - ports: - - "2224:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start Ubuntu 21.04 container if not already started - community.docker.docker_container: - name: U2104_2225 - image: aqa_aqa_u2104u2004 - ports: - - "2225:22" - cpus: 4.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers, startallcontainers - failed_when: false - -- name: Start Ubuntu 22.04 container if not already started - command: docker run --restart unless-stopped -p 2226:22 --cpus=4.0 --memory=6G --detach --name U2204_2226 aqa_u2204 - tags: startcontainers, startallcontainers - failed_when: false - -- name: Start fedora 33 container if not already started - community.docker.docker_container: - name: f33.2227 - image: aqa_f33 - ports: - - "2227:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start fedora 34 container if not already started - community.docker.docker_container: - name: f34.2232 - image: aqa_f34 - ports: - - "2232:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start fedora 35 container if not already started - community.docker.docker_container: - name: f35.2233 - image: aqa_f35 - ports: - - "2233:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start Alpine 3.11 container if not already started - community.docker.docker_container: - name: alp311.2228 - image: aqa_alp311 - ports: - - "2228:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers, startallcontainers - failed_when: false - -- name: Start Alpine 3.12 container if not already started - community.docker.docker_container: - name: alp312.2229 - image: aqa_alp312 - ports: - - "2229:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start Alpine 3.13 container if not already started - community.docker.docker_container: - name: alp313.2230 - image: aqa_alp313 - ports: - - "2230:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start Alpine 3.14 container if not already started - community.docker.docker_container: - name: alp314.2231 - image: aqa_alp314 - ports: - - "2231:22" - cpus: 2.0 - memory: 6G - state: started # Make sure container is presented (if not exist then start it) - restart: yes # Use restart to force a matching container to be stopped and restarted (if exist then restart it) - detach: yes - tags: startcontainers - failed_when: false - -- name: Start UBI8 container if not already started - command: docker run --restart unless-stopped -p 2235:22 --cpus=2.0 --memory=6G --detach --name ubi8.2235 aqa_ubi8 - tags: startcontainers - failed_when: false - -- name: Start Deb11 container if not already started - command: docker run --restart unless-stopped -p 2211:22 --cpus=2.0 --memory=6G --detach --name deb11.2211 aqa_deb11 - tags: startcontainers - failed_when: false - # lineinfile does not work here - similar to the operation in /var/log in adopt_etc # lineinfile: path /proc/sys/kernel/core_pattern state: present: regexp: . line: core.%p # therefore the following section wil not become live prior to a reboot diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Xcode_offline/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Xcode_offline/tasks/main.yml index 043c6d8398..b56194efa2 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Xcode_offline/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Xcode_offline/tasks/main.yml @@ -3,7 +3,7 @@ # Xcdde offline install # ######################### -# Install Xcode withou need to login with appleID +# Install Xcode without needing to login with appleID # Path /Applications/Xcode.app/ # Requires the following variable: # xcode_version: 12.4 | 13.1 | 13.2.1 | 13.4 | 14.3.1 | 15.0.1 diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/brew/tasks/brew.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/brew/tasks/brew.yml index f2ecaaf3d0..a85ac3c981 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/brew/tasks/brew.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/brew/tasks/brew.yml @@ -1,13 +1,13 @@ --- -- name: Check if Homebrew is already installed +- name: Check if Homebrew is already installed (x86_64) stat: path: /usr/local/bin/brew register: b when: ansible_architecture == "x86_64" tags: brew -- name: Check if Homebrew is already installed +- name: Check if Homebrew is already installed (arm64) stat: path: /opt/homebrew/bin/brew register: b @@ -23,7 +23,7 @@ when: not brew_is_installed tags: brew block: - - name: Add user j9admin to sudoers + - name: Add ansible user to sudoers template: src: sudoers dest: /etc/sudoers.d/{{ ansible_user }} diff --git a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml index 57f2c2a4b7..3a548b5dc1 100644 --- a/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/disable_gui/tasks/main.yml @@ -25,3 +25,31 @@ - desktop_installed.stat.exists - gui_disabled.stdout == '' tags: disable_gui + +# Restart NTPD On Centos 7 after gui disablement + +- name: Gather Facts About The Services Present + service_facts: + tags: disable_gui + +- name: Check If NTPD Exists In The Service Facts + set_fact: + ntpd_entry_exists: "{{ 'ntpd.service' in services }}" + when: ansible_facts.services is defined + tags: disable_gui + +- name: Set Fact Where NTPD Is Not Available As A Service + set_fact: + ntpd_entry_exists: "false" + when: ansible_facts.services is not defined + tags: disable_gui + +- name: Start NTP for CentOS7 following GUI disablement + service: + name: ntpd + state: restarted + enabled: yes + when: + - ntpd_entry_exists | default(false) | bool + - (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" ) + tags: disable_gui