From b97fd84f89df58542ee82215a6d1ef49b1608d85 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 29 Nov 2023 11:51:47 +0000 Subject: [PATCH 01/19] add dnf role, deprecate yum role --- .../AdoptOpenJDK_AIX_Playbook/main.yml | 2 +- .../roles/dnf/tasks/main.yml | 133 ++++++++++++++++++ 2 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml index bcaee22538..2b4766adb3 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml @@ -64,7 +64,7 @@ # Note: AIX File system configuration must be run now as RPM based software # cannot expand filesystem space on demand - aixfs - - yum + - dnf ## additional OSS packages - ant diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml new file mode 100644 index 0000000000..aded6de9fd --- /dev/null +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -0,0 +1,133 @@ +--- + +- name: Check if dnf is installed + +- name: Set install flag + set_fact: + install_flag: "-d" + +- name: Check if yum is installed + +- name: Set install flag is yum is installed + set_fact: + install_flag: "-y" + when: yum is installed + +- name: Install dnf + when: dnf is not installed + block: + - name: Download dnf script + + - name: Install dnf + + - name: Remove dnf script + +- name: Update dnf + dnf: + update_cache: true + name: '*' + state: latest + +- name: Install OSS dev run-time-env using yum + dnf: + name: "{{ item }} " + state: present + update_cache: yes + with_items: + - bash + - autoconf-2.69-1 + - bc + - bison + - coreutils + - cpio + - cups-devel + - cups-libs + - expect + - flex + - freetype2-devel-2.8-1 + - fontconfig-devel + - gawk + - git + - gnupg2-2.0.30 + - grep + - libffi-devel + - make + - m4 + - pcre + - pkg-config + - popt + - sed + - sudo + - tar + - tcl + - unzip + - wget + - xz-libs + - zip + - zsh + +########################################################################## +# Adoptium builds do not work properly with the latest cmake @AIXToolbox # +########################################################################## +# NOTE: Cannot use dnf module here as it will pull in cmake 3.16 which we do not want +- name: Install cmake 3.14.3 prerequisites + command: + cmd: rpm -i "{{ item }}" + creates: /opt/freeware/etc/rpm/macros.cmake + with_items: + - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-filesystem-3.14.3-1.aix7.1.ppc.rpm + - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-rpm-macros-3.14.3-1.aix7.1.ppc.rpm + tags: + - rpm_install + - cmake + +# See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492 for why we are locking this +- name: Install cmake 3.14.3 (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492) + dnf: + name: cmake-3.14.3 + state: present + update_cache: yes + tags: + - rpm_install + - cmake +############################################################################## +# TASK [yum : Install cmake 3.14.3 +# (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492)] +# fatal: [x077]: FAILED! => +# {"changed": false, "msg": "No package matching 'cmake-3.14.3' found available, +# installed or updated", "rc": 126, +# "results": ["No package matching 'cmake-3.14.3' found available, +# installed or updated"} +## If you get this message - you need to remove 'cmake*' from +# /opt/freeware/etc/yum/yum.conf +############################################################################## + +- name: Ensure perl from /opt/freeware/bin is the default in /usr/bin + shell: mv /usr/bin/perl /usr/bin/perl.old && ln -s /opt/freeware/bin/perl /usr/bin/ + failed_when: false + tags: + - rpm_install + +# Create zlib.h and zconf.h links - See https://github.com/adoptium/infrastructure/issues/1952 +- name: Copy zlib.h and zconf.h (See https://github.com/adoptium/infrastructure/issues/1952) + copy: + src: "/opt/freeware/include/{{ item }}" + dest: "/usr/include/" + force: true + remote_src: true + with_items: + - zconf.h + - zlib.h + +############################################################################## +# Prevent accidental updates to 'locked' packages +############################################################################## +- name: Exclude packages from dnf (main) + lineinfile: + dest: /opt/freeware/etc/dnf/dnf.conf + firstmatch: true + insertafter: 'plugins=1' + line: 'exclude=autoconf cmake* freetype2*' + tags: + - cmake + - freetype2 From b501c3282da110f682303e401dfd01050fed9ca4 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 29 Nov 2023 14:09:50 +0000 Subject: [PATCH 02/19] Add check for python3, comments and other steps --- .../roles/dnf/tasks/main.yml | 53 ++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index aded6de9fd..8711175b3e 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -1,26 +1,55 @@ --- -- name: Check if dnf is installed - -- name: Set install flag - set_fact: - install_flag: "-d" +# See https://github.com/adoptium/infrastructure/issues/3142#issuecomment-1658743632 +# Yum is no longer supported on AIX 7.3. Dnf is recommended. Dnf supports AIX 7.1 TL3 and higher +# Dnf needs python3 +# For more information https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2021/05/28/dnf-is-now-available-on-aix-toolbox?CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9&tab=recentcommunityblogsdashboard -- name: Check if yum is installed +# Dnf needs python3 +- name: Fail if python3 is not available + stat: + path: /opt/freeware/bin/python3 + register: python3_installed + failed_when: not python3_installed.stat.exists -- name: Set install flag is yum is installed - set_fact: - install_flag: "-y" - when: yum is installed +- name: Check if dnf is installed + stat: + path: /opt/freeware/bin/dnf + register: dnf_installed - name: Install dnf - when: dnf is not installed + when: not dnf_installed.stat.exists block: + # Installs dnf when yum is not present + - name: Set install flag + set_fact: + install_flag: "-d" + + - name: Check if yum is installed + stat: + path: /opt/freeware/bin/yum + register: yum_installed + + # Installs dnf when yum is present, links yum to dnf + - name: Set install flag if yum is installed + set_fact: + install_flag: "-y" + when: yum_installed.stat.exists + - name: Download dnf script + get_url: + url: "https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh" + mode: 0644 + validate_certs: false + dest: /tmp/dnf_aixtoolbox.sh - name: Install dnf + shell: "/tmp/dnf_aixtoolbox.sh {{ install_flag }}" - name: Remove dnf script + file: + state: absent + path: /tmp/dnf_aixtoolbox.sh - name: Update dnf dnf: @@ -30,7 +59,7 @@ - name: Install OSS dev run-time-env using yum dnf: - name: "{{ item }} " + name: "{{ item }}" state: present update_cache: yes with_items: From 40610ffd6f145aeda0c2a1d7537335e811428605 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 29 Nov 2023 14:11:13 +0000 Subject: [PATCH 03/19] ad dnf tags to role --- ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml index 2b4766adb3..992b027c07 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml @@ -64,7 +64,8 @@ # Note: AIX File system configuration must be run now as RPM based software # cannot expand filesystem space on demand - aixfs - - dnf + - role: dnf + tags: dnf ## additional OSS packages - ant From ffd6be041fca9c9488cc575903b64e18b8080b72 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 29 Nov 2023 14:13:15 +0000 Subject: [PATCH 04/19] linter --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 8711175b3e..a82de36dd9 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -57,10 +57,10 @@ name: '*' state: latest -- name: Install OSS dev run-time-env using yum - dnf: +- name: Install packages + dnf: name: "{{ item }}" - state: present + state: present update_cache: yes with_items: - bash From 0ba33ea071669e8185166e26d03708e15c2e309a Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Wed, 29 Nov 2023 14:22:55 +0000 Subject: [PATCH 05/19] include code about removing unnecessary packages --- .../roles/dnf/tasks/main.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index a82de36dd9..ae9e95de34 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -160,3 +160,23 @@ tags: - cmake - freetype2 + +- name: Remove packages - in case installed historically, or by accident + dnf: + name: "{{ item }}" + state: absent + with_items: + - libXrender-devel + - libXrender + - libXft + - tk + - renderproto + tags: + - adoptopenjdk + +- name: Remove, if exists, reference to libXrender-devel include files + file: + state: absent + path: /opt/freeware/include/X11/extensions + tags: + - adoptopenjdk From 95b7152a2243ca7163db0d9e0159e03e82dee30a Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Thu, 30 Nov 2023 11:35:10 +0000 Subject: [PATCH 06/19] add checksum to dnf install script --- .../playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index ae9e95de34..4f58a8095e 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -42,6 +42,7 @@ mode: 0644 validate_certs: false dest: /tmp/dnf_aixtoolbox.sh + checksum: sha256:7582a79530a30280548bebf6730686ff3c8b4b7259ddf2d1361494be19a193f8 - name: Install dnf shell: "/tmp/dnf_aixtoolbox.sh {{ install_flag }}" From 2ab2084852832d711394a08ee645e4e5fa527c45 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Thu, 30 Nov 2023 12:24:33 +0000 Subject: [PATCH 07/19] debug --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 4f58a8095e..36fa5a76e5 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -36,6 +36,12 @@ install_flag: "-y" when: yum_installed.stat.exists + # debug + + - name: print install flag variable + debug: + msg: "{{ install_flag }}" + - name: Download dnf script get_url: url: "https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh" From 982d1be8d314e6074190502efd62b15680528265 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Thu, 30 Nov 2023 12:33:38 +0000 Subject: [PATCH 08/19] change permissions of dnf script to execute --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 36fa5a76e5..9dfcf6e535 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -36,22 +36,16 @@ install_flag: "-y" when: yum_installed.stat.exists - # debug - - - name: print install flag variable - debug: - msg: "{{ install_flag }}" - - name: Download dnf script get_url: url: "https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh" - mode: 0644 + mode: 0744 validate_certs: false dest: /tmp/dnf_aixtoolbox.sh checksum: sha256:7582a79530a30280548bebf6730686ff3c8b4b7259ddf2d1361494be19a193f8 - name: Install dnf - shell: "/tmp/dnf_aixtoolbox.sh {{ install_flag }}" + command: "/tmp/dnf_aixtoolbox.sh {{ install_flag }}" - name: Remove dnf script file: From 6ba97fac7b82057ea30f5545261ec6beaf203852 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 14:26:09 +0000 Subject: [PATCH 09/19] debug --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 9dfcf6e535..3bab517c59 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -52,11 +52,11 @@ state: absent path: /tmp/dnf_aixtoolbox.sh -- name: Update dnf - dnf: - update_cache: true - name: '*' - state: latest +# - name: Update dnf +# dnf: +# update_cache: true +# name: '*' +# state: latest - name: Install packages dnf: From 9e5d6314f953a23491176fb96ae2119c2bf2a3f0 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 14:41:21 +0000 Subject: [PATCH 10/19] remove debug, remove yum-utils after dnf install and before dnf update --- .../roles/dnf/tasks/main.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 3bab517c59..40bd57cda9 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -52,11 +52,17 @@ state: absent path: /tmp/dnf_aixtoolbox.sh -# - name: Update dnf -# dnf: -# update_cache: true -# name: '*' -# state: latest +# See https://github.com/adoptium/infrastructure/pull/3271#issuecomment-1836227877 +- name: Remove yum-utils before dnf update + dnf: + name: yum-utils + state: absent + +- name: Update dnf + dnf: + update_cache: true + name: '*' + state: latest - name: Install packages dnf: From c4009dbc8570e82ec4509aacbcbd1ef7023dc76b Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 15:30:12 +0000 Subject: [PATCH 11/19] modify ansible_python_interpreter as a test --- ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml index 992b027c07..ed138144a2 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml @@ -10,6 +10,8 @@ PATH: "/opt/IBM/xlC/13.1.3/bin:/opt/freeware/bin:{{ ansible_env.PATH }}" PERL_MB_OPT: "--install_base /opt/freeware" PERL_MM_OPT: "INSTALL_BASE=/opt/freeware" + vars: + ansible_python_interpreter: /opt/freeware/bin/python3 roles: - role: logs From 26644cff13593d4657f4f354d1c0aa89864695aa Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 15:31:46 +0000 Subject: [PATCH 12/19] remove ansible_python_interpreter from main and have as var for test --- ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml | 2 -- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml index ed138144a2..992b027c07 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/main.yml @@ -10,8 +10,6 @@ PATH: "/opt/IBM/xlC/13.1.3/bin:/opt/freeware/bin:{{ ansible_env.PATH }}" PERL_MB_OPT: "--install_base /opt/freeware" PERL_MM_OPT: "INSTALL_BASE=/opt/freeware" - vars: - ansible_python_interpreter: /opt/freeware/bin/python3 roles: - role: logs diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 40bd57cda9..1ddc43f628 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -57,6 +57,8 @@ dnf: name: yum-utils state: absent + vars: + ansible_python_interpreter: /opt/freeware/bin/python3 - name: Update dnf dnf: From 4b8b951d64650a64478967e1953c23961bf19dae Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 15:48:51 +0000 Subject: [PATCH 13/19] change ansible_python_interpreter to /opt/freeware/libexec/python3 to test --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 1ddc43f628..1659ee00aa 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -58,7 +58,7 @@ name: yum-utils state: absent vars: - ansible_python_interpreter: /opt/freeware/bin/python3 + ansible_python_interpreter: /opt/freeware/libexec/python3 - name: Update dnf dnf: From ec47488c182d91fd8b7ee85d891f8467d97c4f96 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 15:54:15 +0000 Subject: [PATCH 14/19] move dnf module tasks into own ansible_interpreter block --- .../roles/dnf/tasks/main.yml | 197 +++++++++--------- 1 file changed, 100 insertions(+), 97 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 1659ee00aa..6af55f8d7b 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -52,93 +52,109 @@ state: absent path: /tmp/dnf_aixtoolbox.sh -# See https://github.com/adoptium/infrastructure/pull/3271#issuecomment-1836227877 -- name: Remove yum-utils before dnf update - dnf: - name: yum-utils - state: absent +# See https://github.com/adoptium/infrastructure/pull/3271#issuecomment-1836343656 +- name: Dnf module needs /opt/freeware/libexec/python3 as its ansible_python_interpreter vars: ansible_python_interpreter: /opt/freeware/libexec/python3 + block: + # See https://github.com/adoptium/infrastructure/pull/3271#issuecomment-1836227877 + - name: Remove yum-utils before dnf update + dnf: + name: yum-utils + state: absent -- name: Update dnf - dnf: - update_cache: true - name: '*' - state: latest - -- name: Install packages - dnf: - name: "{{ item }}" - state: present - update_cache: yes - with_items: - - bash - - autoconf-2.69-1 - - bc - - bison - - coreutils - - cpio - - cups-devel - - cups-libs - - expect - - flex - - freetype2-devel-2.8-1 - - fontconfig-devel - - gawk - - git - - gnupg2-2.0.30 - - grep - - libffi-devel - - make - - m4 - - pcre - - pkg-config - - popt - - sed - - sudo - - tar - - tcl - - unzip - - wget - - xz-libs - - zip - - zsh - -########################################################################## -# Adoptium builds do not work properly with the latest cmake @AIXToolbox # -########################################################################## -# NOTE: Cannot use dnf module here as it will pull in cmake 3.16 which we do not want -- name: Install cmake 3.14.3 prerequisites - command: - cmd: rpm -i "{{ item }}" - creates: /opt/freeware/etc/rpm/macros.cmake - with_items: - - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-filesystem-3.14.3-1.aix7.1.ppc.rpm - - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-rpm-macros-3.14.3-1.aix7.1.ppc.rpm - tags: - - rpm_install - - cmake - -# See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492 for why we are locking this -- name: Install cmake 3.14.3 (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492) - dnf: - name: cmake-3.14.3 - state: present - update_cache: yes - tags: - - rpm_install - - cmake -############################################################################## -# TASK [yum : Install cmake 3.14.3 -# (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492)] -# fatal: [x077]: FAILED! => -# {"changed": false, "msg": "No package matching 'cmake-3.14.3' found available, -# installed or updated", "rc": 126, -# "results": ["No package matching 'cmake-3.14.3' found available, -# installed or updated"} -## If you get this message - you need to remove 'cmake*' from -# /opt/freeware/etc/yum/yum.conf -############################################################################## + - name: Update dnf + dnf: + update_cache: true + name: '*' + state: latest + + - name: Install packages + dnf: + name: "{{ item }}" + state: present + update_cache: yes + with_items: + - bash + - autoconf-2.69-1 + - bc + - bison + - coreutils + - cpio + - cups-devel + - cups-libs + - expect + - flex + - freetype2-devel-2.8-1 + - fontconfig-devel + - gawk + - git + - gnupg2-2.0.30 + - grep + - libffi-devel + - make + - m4 + - pcre + - pkg-config + - popt + - sed + - sudo + - tar + - tcl + - unzip + - wget + - xz-libs + - zip + - zsh + + ########################################################################## + # Adoptium builds do not work properly with the latest cmake @AIXToolbox # + ########################################################################## + # NOTE: Cannot use dnf module here as it will pull in cmake 3.16 which we do not want + - name: Install cmake 3.14.3 prerequisites + command: + cmd: rpm -i "{{ item }}" + creates: /opt/freeware/etc/rpm/macros.cmake + with_items: + - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-filesystem-3.14.3-1.aix7.1.ppc.rpm + - https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.1/cmake/cmake-rpm-macros-3.14.3-1.aix7.1.ppc.rpm + tags: + - rpm_install + - cmake + + # See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492 for why we are locking this + - name: Install cmake 3.14.3 (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492) + dnf: + name: cmake-3.14.3 + state: present + update_cache: yes + tags: + - rpm_install + - cmake + ############################################################################## + # TASK [yum : Install cmake 3.14.3 + # (See https://github.com/AdoptOpenJDK/openjdk-build/issues/2492)] + # fatal: [x077]: FAILED! => + # {"changed": false, "msg": "No package matching 'cmake-3.14.3' found available, + # installed or updated", "rc": 126, + # "results": ["No package matching 'cmake-3.14.3' found available, + # installed or updated"} + ## If you get this message - you need to remove 'cmake*' from + # /opt/freeware/etc/yum/yum.conf + ############################################################################## + + - name: Remove packages - in case installed historically, or by accident + dnf: + name: "{{ item }}" + state: absent + with_items: + - libXrender-devel + - libXrender + - libXft + - tk + - renderproto + tags: + - adoptopenjdk - name: Ensure perl from /opt/freeware/bin is the default in /usr/bin shell: mv /usr/bin/perl /usr/bin/perl.old && ln -s /opt/freeware/bin/perl /usr/bin/ @@ -170,19 +186,6 @@ - cmake - freetype2 -- name: Remove packages - in case installed historically, or by accident - dnf: - name: "{{ item }}" - state: absent - with_items: - - libXrender-devel - - libXrender - - libXft - - tk - - renderproto - tags: - - adoptopenjdk - - name: Remove, if exists, reference to libXrender-devel include files file: state: absent From 124d5d20055594e465e01109a4bd257bf825d1e9 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 19:05:13 +0000 Subject: [PATCH 15/19] ignore gnupg2-2.0.30 for now --- .../AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 6af55f8d7b..d94c621519 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -89,7 +89,7 @@ - fontconfig-devel - gawk - git - - gnupg2-2.0.30 + # - gnupg2-2.0.30 - grep - libffi-devel - make From 3f035c162c8bb56fb02615448add774467576e9b Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 19:14:30 +0000 Subject: [PATCH 16/19] move list of packages outside of with_items, as list --- .../roles/dnf/tasks/main.yml | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index d94c621519..05935773bd 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -71,41 +71,40 @@ - name: Install packages dnf: - name: "{{ item }}" state: present update_cache: yes - with_items: - - bash - - autoconf-2.69-1 - - bc - - bison - - coreutils - - cpio - - cups-devel - - cups-libs - - expect - - flex - - freetype2-devel-2.8-1 - - fontconfig-devel - - gawk - - git - # - gnupg2-2.0.30 - - grep - - libffi-devel - - make - - m4 - - pcre - - pkg-config - - popt - - sed - - sudo - - tar - - tcl - - unzip - - wget - - xz-libs - - zip - - zsh + name: + - bash + - autoconf-2.69-1 + - bc + - bison + - coreutils + - cpio + - cups-devel + - cups-libs + - expect + - flex + - freetype2-devel-2.8-1 + - fontconfig-devel + - gawk + - git + # - gnupg2-2.0.30 + - grep + - libffi-devel + - make + - m4 + - pcre + - pkg-config + - popt + - sed + - sudo + - tar + - tcl + - unzip + - wget + - xz-libs + - zip + - zsh ########################################################################## # Adoptium builds do not work properly with the latest cmake @AIXToolbox # @@ -181,7 +180,7 @@ dest: /opt/freeware/etc/dnf/dnf.conf firstmatch: true insertafter: 'plugins=1' - line: 'exclude=autoconf cmake* freetype2*' + line: 'exclude=autoconf* cmake* freetype2*' tags: - cmake - freetype2 From a1e9147b1747899316e46ba5e9a086fb285ea8eb Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 19:20:39 +0000 Subject: [PATCH 17/19] add disable_excludes --- .../playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 05935773bd..1f5f30794e 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -73,6 +73,7 @@ dnf: state: present update_cache: yes + disable_excludes: all name: - bash - autoconf-2.69-1 From df9538e79a3bb85db7254018c97da2e7882d0191 Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 19:28:54 +0000 Subject: [PATCH 18/19] add disable_excludes to cmake install --- .../playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index 1f5f30794e..cf761e1963 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -128,6 +128,7 @@ name: cmake-3.14.3 state: present update_cache: yes + disable_excludes: all tags: - rpm_install - cmake From 52fff30c1b4c0222f5e7ea6ca7d1e904aef6532b Mon Sep 17 00:00:00 2001 From: Haroon Khel Date: Fri, 1 Dec 2023 19:32:32 +0000 Subject: [PATCH 19/19] reduce time in remove packages task --- .../roles/dnf/tasks/main.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml index cf761e1963..0059f3af3a 100644 --- a/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_AIX_Playbook/roles/dnf/tasks/main.yml @@ -146,14 +146,13 @@ - name: Remove packages - in case installed historically, or by accident dnf: - name: "{{ item }}" state: absent - with_items: - - libXrender-devel - - libXrender - - libXft - - tk - - renderproto + name: + - libXrender-devel + - libXrender + - libXft + - tk + - renderproto tags: - adoptopenjdk