From fcce6de9deb28a4e715844b22e89b316be5f1c8f Mon Sep 17 00:00:00 2001 From: Joe deKoning Date: Fri, 24 May 2019 15:45:14 -0400 Subject: [PATCH] Initial modification for IBM playbook usage Signed-off-by: Joe deKoning --- .../group_vars/all/ibm_variables.yml | 19 ++++++ .../playbooks/ibm_unix_playbook/ibm_main.yml | 46 ++++++++++++++ .../main.yml | 0 .../NVidia_Cuda_Toolkit_75}/tasks/main.yml | 8 +-- .../roles/gcc_48/tasks/main.yml | 0 .../roles/gcc_7/tasks/main.yml | 61 ++----------------- 6 files changed, 75 insertions(+), 59 deletions(-) create mode 100644 ansible/playbooks/ibm_unix_playbook/group_vars/all/ibm_variables.yml create mode 100644 ansible/playbooks/ibm_unix_playbook/ibm_main.yml rename ansible/playbooks/{vendor_unix_playbook => ibm_unix_playbook}/main.yml (100%) rename ansible/playbooks/{vendor_unix_playbook/roles/NVidia_Cuda_Toolkit => ibm_unix_playbook/roles/NVidia_Cuda_Toolkit_75}/tasks/main.yml (92%) rename ansible/playbooks/{vendor_unix_playbook => ibm_unix_playbook}/roles/gcc_48/tasks/main.yml (100%) rename ansible/playbooks/{vendor_unix_playbook => ibm_unix_playbook}/roles/gcc_7/tasks/main.yml (51%) diff --git a/ansible/playbooks/ibm_unix_playbook/group_vars/all/ibm_variables.yml b/ansible/playbooks/ibm_unix_playbook/group_vars/all/ibm_variables.yml new file mode 100644 index 0000000000..73399ac96f --- /dev/null +++ b/ansible/playbooks/ibm_unix_playbook/group_vars/all/ibm_variables.yml @@ -0,0 +1,19 @@ +--- +########################## +# ibm_variables # +########################## + +Domain: IBM +Jenkins_Username: jenkins +Jenkins_User_SSHKey: /Vendor_Files/jenkins/id_rsa.pub +bootjdk: openj9 + +Jenkins_Win_Passwd: /Vendor_Files/jenkins/jenkins_win_passwd +Nagios_Monitoring: Disabled +Nagios_Plugins: Disabled +Security: Disabled +Slack_Notification: Disabled +Superuser_Account: Disabled +ansible_connection: ssh +ansible_port: 22 + diff --git a/ansible/playbooks/ibm_unix_playbook/ibm_main.yml b/ansible/playbooks/ibm_unix_playbook/ibm_main.yml new file mode 100644 index 0000000000..cb0f309edc --- /dev/null +++ b/ansible/playbooks/ibm_unix_playbook/ibm_main.yml @@ -0,0 +1,46 @@ +--- +################################### +# AdoptOpenJDK - Ansible Playbook # +################################### +- hosts: all + gather_facts: yes + tasks: + - block: + # Set standard variables + - name: Load IBM variable file + include_vars: group_vars/all/ibm_variables.yml + environment: + PATH: "/usr/local/bin:{{ ansible_env.PATH }}" + + ######### + # Roles # + ######### + roles: + - gcc_7 + - NVidia_Cuda_Toolkit_75 + - ../AdoptOpenJDK_Unix_Playbook/roles/Debug + - ../AdoptOpenJDK_Unix_Playbook/roles/Version + - ../AdoptOpenJDK_Unix_Playbook/roles/Common + - ../AdoptOpenJDK_Unix_Playbook/roles/autoconf + - ../AdoptOpenJDK_Unix_Playbook/roles/curl + - ../AdoptOpenJDK_Unix_Playbook/roles/Jenkins_User # AdoptOpenJDK Infrastructure + - ../AdoptOpenJDK_Unix_Playbook/roles/freemarker # OpenJ9 + - ../AdoptOpenJDK_Unix_Playbook/roles/ant # Testing + - ../AdoptOpenJDK_Unix_Playbook/roles/Ant-Contrib # Testing + - ../AdoptOpenJDK_Unix_Playbook/roles/GIT_Source + - ../AdoptOpenJDK_Unix_Playbook/roles/CPAN + - ../AdoptOpenJDK_Unix_Playbook/roles/cmake # OpenJ9 / OpenJFX + - ../AdoptOpenJDK_Unix_Playbook/roles/gmake + - ../AdoptOpenJDK_Unix_Playbook/roles/Docker # Testing + - ../AdoptOpenJDK_Unix_Playbook/roles/NVidia_Cuda_Toolkit # OpenJ9 + - ../AdoptOpenJDK_Unix_Playbook/roles/Swap_File + - ../AdoptOpenJDK_Unix_Playbook/roles/Crontab + - ../AdoptOpenJDK_Unix_Playbook/roles/NTP_TIME + - ../AdoptOpenJDK_Unix_Playbook/roles/Python3_Source + - ../AdoptOpenJDK_Unix_Playbook/roles/ccache + - {role: ../AdoptOpenJDK_Unix_Playbook/roles/nasm, when: ansible_architecture == 'x86_64'} # OpenJ9 + - ../AdoptOpenJDK_Unix_Playbook/roles/adoptopenjdk11 # JDK12 build bootstrap + - ../AdoptOpenJDK_Unix_Playbook/roles/adoptopenjdk12 # JDK13 build bootstrap + - ../AdoptOpenJDK_Unix_Playbook/roles/Protobuf + - ../AdoptOpenJDK_Unix_Playbook/roles/OpenSSL102 # OpenJ9 + - ../AdoptOpenJDK_Unix_Playbook/roles/Clean_Up diff --git a/ansible/playbooks/vendor_unix_playbook/main.yml b/ansible/playbooks/ibm_unix_playbook/main.yml similarity index 100% rename from ansible/playbooks/vendor_unix_playbook/main.yml rename to ansible/playbooks/ibm_unix_playbook/main.yml diff --git a/ansible/playbooks/vendor_unix_playbook/roles/NVidia_Cuda_Toolkit/tasks/main.yml b/ansible/playbooks/ibm_unix_playbook/roles/NVidia_Cuda_Toolkit_75/tasks/main.yml similarity index 92% rename from ansible/playbooks/vendor_unix_playbook/roles/NVidia_Cuda_Toolkit/tasks/main.yml rename to ansible/playbooks/ibm_unix_playbook/roles/NVidia_Cuda_Toolkit_75/tasks/main.yml index 893b4caa4b..3fd49723ca 100644 --- a/ansible/playbooks/vendor_unix_playbook/roles/NVidia_Cuda_Toolkit/tasks/main.yml +++ b/ansible/playbooks/ibm_unix_playbook/roles/NVidia_Cuda_Toolkit_75/tasks/main.yml @@ -12,7 +12,7 @@ when: - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14") or (ansible_distribution == "RedHat" or ansible_distribution == "CentOS") - ansible_architecture == "x86_64" - tags: vendor_nvidia_cuda_toolkit + tags: nvidia_cuda_toolkit_75 - name: Download NVidia CUDA 7.5 toolkit get_url: @@ -23,7 +23,7 @@ - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14") or (ansible_distribution == "RedHat" or ansible_distribution == "CentOS") - ansible_architecture == "x86_64" - cuda75_installed.stat.exists == False - tags: vendor_nvidia_cuda_toolkit + tags: nvidia_cuda_toolkit_75 - name: Install NVidia CUDA 7.5 toolkit shell: sh /tmp/cuda_75_linux-run --silent --toolkit --override @@ -31,7 +31,7 @@ - (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14") or (ansible_distribution == "RedHat" or ansible_distribution == "CentOS") - ansible_architecture == "x86_64" - cuda75_installed.stat.exists == False - tags: vendor_nvidia_cuda_toolkit + tags: nvidia_cuda_toolkit_75 - name: Clean up downloaded packages file: @@ -44,4 +44,4 @@ - ansible_architecture == "x86_64" - cuda75_installed.stat.exists == False ignore_errors: yes - tags: vendor_nvidia_cuda_toolkit + tags: nvidia_cuda_toolkit_75 diff --git a/ansible/playbooks/vendor_unix_playbook/roles/gcc_48/tasks/main.yml b/ansible/playbooks/ibm_unix_playbook/roles/gcc_48/tasks/main.yml similarity index 100% rename from ansible/playbooks/vendor_unix_playbook/roles/gcc_48/tasks/main.yml rename to ansible/playbooks/ibm_unix_playbook/roles/gcc_48/tasks/main.yml diff --git a/ansible/playbooks/vendor_unix_playbook/roles/gcc_7/tasks/main.yml b/ansible/playbooks/ibm_unix_playbook/roles/gcc_7/tasks/main.yml similarity index 51% rename from ansible/playbooks/vendor_unix_playbook/roles/gcc_7/tasks/main.yml rename to ansible/playbooks/ibm_unix_playbook/roles/gcc_7/tasks/main.yml index 38a3c3afe4..a899c2520c 100644 --- a/ansible/playbooks/vendor_unix_playbook/roles/gcc_7/tasks/main.yml +++ b/ansible/playbooks/ibm_unix_playbook/roles/gcc_7/tasks/main.yml @@ -48,67 +48,18 @@ - ansible_architecture == "x86_64" - devtoolset7_installed.stat.exists == False - devtoolset7_repo_installed.stat.exists == False - tags: vendor_gcc_7 + tags: gcc_7 - name: Install devtoolset-7 packages yum: name: devtoolset-7-gcc-c++ - state: installed + state: installed when: - ansible_distribution == "RedHat" - ansible_architecture == "x86_64" - devtoolset7_installed.stat.exists == False - tags: vendor_gcc_7 - -# Install at11 (IBMAdvanced Tools) on RHEL7 PPCLE + tags: gcc_7 -- name: Check if IBMAdvanced Tools 11 is installed on RHEL7 PPCLE - stat: - path: /opt/at11.0 - register: at11_installed - when: - - ansible_distribution == "RedHat" - - ansible_architecture == "ppc64le" - - ansible_distribution_major_version == "7" - tags: vendor_gcc_7 - -- name: Check if att11.0.repo exists - stat: - path: /etc/yum.repos.d/at11.0.repo - when: - - ansible_distribution == "RedHat" - - ansible_architecture == "ppc64le" - - ansible_distribution_major_version == "7" - - at11_installed.stat.exists == False - register: att11_repo_installed - tags: vendor_gcc_7 - -- name: Add att11 to yum repo - get_url: - url: "ftp://ftp.unicamp.br/pub/linuxpatch/toolchain/at/redhat/RHEL7" - dest: /etc/yum.repos.d/at11.0.repo - timeout: 25 - when: - - ansible_distribution == "RedHat" - - ansible_architecture == "ppc64le" - - ansible_distribution_major_version == "7" - - at11_installed.stat.exists == False - - att11_repo_installed.stat.exists == False - tags: vendor_gcc_7 - -- name: Install att11.0 packages - yum: - name: "{{ packages }}" - vars: - packages: - - environment-modules - - advance-toolchain-at11.0-runtime - - advance-toolchain-at11.0-devel - - advance-toolchain-at11.0-perf - state: installed - when: - - ansible_distribution == "RedHat" - - ansible_architecture == "ppc64le" - - ansible_distribution_major_version == "7" - - at11_installed.stat.exists == False - tags: vendor_gcc_7 +- lineinfile: + path: ~/.bashrc + line: 'source /opt/rh/devtoolset-7/enable'