We have previously talked about MQ Ansible and how it can streamline the deployment process of IBM MQ on your virtual machines (VMs). Check our previous blog and recording here for a refresher on MQ Ansible.
The MQ developer experience team has continued to work on adding new collections and new resources to make sure that your IBM MQ experience is enjoyable, resourceful, and ultimately, the best experience you could have with an MQ product. They are now pleased to introduce a collection that allows you to automate the download and installation of IBM MQ on Windows.
IBM MQ installation roles for Windows platforms
By Mo Alatoum
Different from Unix-based platforms, Ansible connects to your Windows hosts using Windows remote management (WinRM). Thus, as a requirement, your target machine must be set up to allow the remote connection. Read on to learn how to set up Ansible:
Pre-requesites
-
Set up your target machine
Your target host must:
- Be running either desktop Windows OS 8.1 or later, or server OSs such as Windows Server 2012 or newer.
- Have PowerShell 3.0 or newer and at least .NET 4.0
- Have WinRM configured to have a listener created and activated.
For more information on how to set up your Windows host, please refer to Ansible documentation. You can also run a Configure Remoting for Ansible script to set up your Windows machine and turn on WinRM. For more details of the script, refer to the official Ansible blog here.
-
Set up your local machine
Your local machine, where Ansible Engine will be executing the playbooks, must run Linux. You must also ensure that your local machine has pywinrm
dependencies installed to use WinRM. You can do this by running pip install pywinrm
.
-
Set up Inventory file
To indicate the Ansible Engine to use a WinRM connection, you must configure your ansible_connection
host variable to ```winrm``. If you have set up your target machine with self-sigend certificates, you will also need to configure your host var to ignore certificate validtion. An example inventory file:
[windows]
YOUR_HOSTNAME
[windows:vars]
ansible_user=Administator
ansible_password=YOUR_PASSWORD
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
Note: As installs modify Window's registry, the install can only be performed by the Administrator user.
- Change
YOUR_HOSTNAME
to your server/hostname, e.g. myserver-windows.fyre.com
- Change
YOUR_PASSWORD
to your target machine Administrator's password.Roles for Windows installation
downloadmq
: For Windows, downloads the IBM MQ Advanced developer package to an specified directory. Default directory in our sample playbook is C:\Users\Administrator
.
installmq
: Installs the package.
setupconsole
: Sets up the web console.
startconsole
: Starts the web console.
Implementing the roles on your playbook
Example based in our sample playbook mq-winstall.yml
, specifying the directory, version and download URL:
- hosts: windows
roles:
- role: downloadmq
vars:
directory: C:\Users\Administrator
version: 930
downloadURL: "https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/"
- installmq
- setupconsole
- startconsole
To run the playbook, issue the following command on your local host:
ansible-playbook ./mq-winstall.yml -i inventory.ini -e 'ibmMqLicense=yes'
Troubleshooting
If one of the following errors appears during the run of the playbook, run the following commands according to the problem:
--------
For the original content and more information about MQ Ansible, please visit the team's GitHub.
#IBMMQ