From 7bac46cc914491fa3e053a41efedc1ae65be1cbe Mon Sep 17 00:00:00 2001 From: UNiXMIT <4117073+UNiXMIT@users.noreply.github.com> Date: Wed, 29 Jan 2025 08:20:46 +0000 Subject: [PATCH] Install MQ client on RHEL --- rhel/main.yml | 12 ++++++++++++ rhel/mq.yml | 37 +++++++++++++++++++++++++++++++++++++ win/main.yml | 2 +- win/mq.yml | 4 ++-- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 rhel/mq.yml diff --git a/rhel/main.yml b/rhel/main.yml index dad9ddf..af6bb7a 100644 --- a/rhel/main.yml +++ b/rhel/main.yml @@ -101,6 +101,18 @@ import_tasks: fail.yml tags: default +- name: Install IBM MQ Client + hosts: awsEC2 + gather_facts: no + tasks: + - block: + - name: Import mq.yml + import_tasks: mq.yml + rescue: + - name: Import fail.yml + import_tasks: fail.yml + tags: default + - name: Create Support Files and Directories hosts: awsEC2 gather_facts: no diff --git a/rhel/mq.yml b/rhel/mq.yml new file mode 100644 index 0000000..d01aa51 --- /dev/null +++ b/rhel/mq.yml @@ -0,0 +1,37 @@ +- name: Create Directory for MQ + file: + path: "/opt/ibm/mq" + state: directory + mode: '0755' + become: yes + +- name: Download IBM MQ Client + ansible.builtin.get_url: + url: https://ibm.biz/IBM-MQC-Redist-LinuxX64targz + dest: /opt/ibm/mq/IBM-MQC-Redist-LinuxX64.tar.gz + mode: '0755' + become: yes + +- name: Extract IBM MQ Client + ansible.builtin.unarchive: + src: /opt/ibm/mq/IBM-MQC-Redist-LinuxX64.tar.gz + dest: /opt/ibm/mq + remote_src: yes + become: yes + +- name: Change Ownership of /opt/ibm/mq Directory + file: + path: /opt/ibm/mq + state: directory + recurse: yes + mode: '0755' + become: yes + +- name: Set MQ Environment + copy: + dest: /etc/profile.d/mq.sh + content: | + #!/bin/bash + export PATH=$PATH:/opt/ibm/mq/bin + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ibm/mq/lib64 + become: yes \ No newline at end of file diff --git a/win/main.yml b/win/main.yml index 6277d4b..b0e4b4e 100644 --- a/win/main.yml +++ b/win/main.yml @@ -109,7 +109,7 @@ import_tasks: fail.yml tags: default -- name: Install IBM MQ Client Libraries +- name: Install IBM MQ Client hosts: awsEC2 gather_facts: no tasks: diff --git a/win/mq.yml b/win/mq.yml index 8baf339..147f91b 100644 --- a/win/mq.yml +++ b/win/mq.yml @@ -1,9 +1,9 @@ -- name: Download IBM MQ Client Libraries +- name: Download IBM MQ Client ansible.windows.win_get_url: url: https://ibm.biz/IBM-MQC-Redist-Win64zip dest: C:\Users\Public\Documents\IBM-MQC-Redist-Win64.zip -- name: Unzip IBM MQ Client Libraries +- name: Unzip IBM MQ Client community.windows.win_unzip: src: C:\Users\Public\Documents\IBM-MQC-Redist-Win64.zip dest: C:\Program Files\IBM\MQ