IBM Support

MustGather - Ansible for IBM i

Question & Answer


Question

What data should I collect when I have an Ansible for IBM i issue?

Answer

If you encounter issues with Ansible for IBM i, please complete the following steps and upload the data to IBM Support for review.

1) Update or Install the QMGTOOLS utility to the latest build level and then execute the QMGTOOLS/GETANSIBLE command.
 
i.
 

On the IBM i command line, type the following command:

  ADDLIBLE QMGTOOLS

If the library is found, follow steps B and C below. If the library is not found, we will want to do steps A - C to install QMGTOOLS and update it:

A) On the IBM i command line type the following to restore the QMGTOOLS library (NOTE: QALWOBJRST system value needs to be set to *ALL):

  RSTLIB SAVLIB(QMGTOOLS) DEV(*SAVF) SAVF(QSYS/QESMGTSAVF) MBROPT(*ALL) ALWOBJDIF(*ALL)

B) Then run the following commands:

  ADDLIBLE QMGTOOLS    GO MG

C) Take an opt. 13 to check for an update and follow the prompts to automatically download and restore the updated library. 
It is required the QMGTOOLS utility be updated to the 072920 build level or later to obtain the GETANSIBLE utility.

NOTE: If the system cannot connect to IBM please perform 'Method 1' from the following document to manually update the QMGTOOLS library: 
Mustgather-how-obtain-and-install-qmgtools-and-keep-it-current

ii.

Once QMGTOOLS is updated, execute the following command :

  QMGTOOLS/GETANSIBLE

*The above command will run for around 5-10 minutes. 
After the command has finished, you will need to upload the /tmp/ansible/snaps/ANSIBLESYSSNAP_YYYYMMDDHHMMSS.zip file to IBM for review.

iii.
Upload the /tmp/ansible/snaps/ANSIBLESYSSNAP_YYYYMMDDHHMMSS.zip file using the following command.

Note: The following command has parameter, CASENBR, which assumes you are using a case number. If using a PMR or RCMS case, prompt on the command to get additional parameters. After prompting, there should be parameters for PMR and RCMS number. The CASENBR parameter should be blank.
  QMGTOOLS/FTP2IBMCMD FTPTYPE(*IBMSDDUU) INPUT(*IFS) CASENBR(TSXXXXXXXXX) IFSFILE('/tmp/ansible/snaps/ANSIBLESYSSNAP_YYYYMMDDHHMMSS.zip')
IBM Blue Diamond clients:
  QMGTOOLS/FTP2IBMCMD FTPTYPE(*IBMSDDUU) IBMID('BD User ID') IBMPWD(<BD password>) INPUT(*IFS) CASENBR(TSXXXXXXXXX) IFSFILE('/tmp/ansible/snaps/ANSIBLESYSSNAP_YYYYMMDDHHMMSS.zip')

If the local IBM i does not have FTP access, the FTP2IBMCMD will fail to upload, and the '/tmp/ansible/snaps/ANSIBLESYSSNAP_YYYYMMDDHHMMSS.zip file' file will need to be downloaded to your PC and then uploaded manually using the URL, https://www.secure.ecurep.ibm.com/app/upload_sf.
Optional - Log SSHD activity:
The SSH Server configuration file ('/QOpenSys/QIBM/UserData/SC1/OpenSSH/etc/sshd_config') builds the environment for every inbound connection to the LPAR. In order to have SSHD write the most information to the SYSLOG Server as possible, set the following options in sshd_config:
SyslogFacility DAEMON
LogLevel DEBUG
Subsystem sftp /QOpenSys/QIBM/ProdData/SC1/OpenSSH/libexec/sftp-server -l DEBUG
The first two directives are specific to all inbound connections. The last directive is specific to inbound SFTP connections only.
Ensure the settings in '/QOpenSys/etc/syslog.conf' match the first two directives in sshd_config:
daemon.debug
2)  Gather the appropriate Ansible files and logs from your Ansible Control Node.
(This is where the ansible/ansible-playbook commands or Ansible Tower are running)
Ansible command-line utlities
  • For IBM i modules, add the "joblog=true" module input parameter and upload the resulting job log output data.
    • i.e.
      ansible ibmi -m ibmi_cl_command -a "cmd='crtlib lib(TESTA)' joblog=true"
  • Add "-vvv" to the ansible/ssh command for very verbose debug logging.
    • i.e.
      ansible ibmi -m ibmi_cl_command -a "cmd='crtlib lib(TESTA)' joblog=true" -vvv
      ssh user@system -vvv
  • Provide the full scroll output from your SSH session including the ansible command and all output data.
  • If executing a playbook (ansible-playbook command), provide the failing *.yml Ansible Playbook file being executed.
Ansible Tower
  • Under Resources -> Templates -> Select your template -> Set "Verbosity" to "3(Debug)" -> Save.
  • Then, launch your Template.
  • Provide the full output log for your launched Job that is displayed.  Your jobs can be accessed under Views -> Jobs -> Click on your specific job that is failing.
    • The output log from your Tower Job can be download by clicking the icon highlighted in the image below when viewing your Job details.
      image 5151
  • Provide the failing *.yml Ansible Playbook file being executed with your Template.
     
3) Upload the data to IBM Support for review.

     MustGather: Instructions for Sending Data to IBM i Support
     https://www.ibm.com/support/pages/node/644037

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001j6bAAA","label":"Ansible for IBM i"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

Modified date:
19 May 2025

UID

ibm16250061