IBM License Metric Tool (ILMT)

IBM License Metric Tool (ILMT)

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

Distributing disconnected scanners via Ansible

  • 1.  Distributing disconnected scanners via Ansible

    Posted Tue January 24, 2023 05:50 AM
    Hopefully someone has experienced this issue and can shed some light on a solution.

    A brief review - We've managed to locate the disconnected lmt_scanner files on the LMT server and copy them to the Ansible Control Node. We have created an Ansible Job Template to run the 'install scanner' playbook for Linux and attempted to run it (many times with much troubleshooting and no luck).

    The Problem - The Ansible job to deploy the disconnected scanner to our RHEL server we are using to test this process seems to end each time with the same error: " "Could not find or access...".

    Here is the specific error received in the Job Output within Ansible:
    {  "msg": "Could not find or access './lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz'\nSearched in:\n\t/runner/project/roles/ilmt_scanner/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/tasks/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/tasks/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option",
      "exception": "Traceback (most recent call last):\n  File \"/usr/lib/python3.8/site-packages/ansible/plugins/action/copy.py\", line 466, in run\n    source = self._find_needle('files', source)\n  File \"/usr/lib/python3.8/site-packages/ansible/plugins/action/__init__.py\", line 1364, in _find_needle\n    return self._loader.path_dwim_relative_stack(path_stack, dirname, needle)\n  File \"/usr/lib/python3.8/site-packages/ansible/parsing/dataloader.py\", line 341, in path_dwim_relative_stack\n    raise AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in search])\nansible.errors.AnsibleFileNotFound: Could not find or access './lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz'\nSearched in:\n\t/runner/project/roles/ilmt_scanner/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/tasks/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/roles/ilmt_scanner/tasks/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/files/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz\n\t/runner/project/./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option\n",
      "invocation": {
        "src": "./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz",
        "dest": "/var/opt/ibm/LMTScanner",
        "force": true,
        "mode": "0644",
        "module_args": {
          "src": "./lmt_file_storage/scanner_installers/LMT-DisconnectedScanner-linux-9.2.30.0-20221206-1315.tar.gz",
          "dest": "/var/opt/ibm/LMTScanner",
          "force": true,
          "mode": "0644"
        }
      },

    Problem Analysis - The problem seems to be specific to one of the last 'TASKS' in the Playbook:

    TASK [ilmt_scanner : Upload scanner installer from Control Node to UNIX/Linux endpoints] ***
    task path: /runner/project/roles/ilmt_scanner/tasks/install_scanner_unix.yml:121

     

    In fact, here is the specific section of install_scanner_unix.yml Playbook which seems to be the issue:

        - name: "Upload scanner installer from Control Node to UNIX/Linux endpoints"
          vars:
            source_file: "{{ scanner_package_file }}"
          copy:
            src: "{{ lmt_local_file_storage_path + '/' + lmt_scanner_installers_folder + '/' + scanner_package_file }}"
            dest: "{{ lmt_scanner_path_unix }}"
            force: true
            mode: '0644'

      

    Troubleshooting steps - We have defined each the following variables and even verified that when combined to identify the "SRC" for the files (as the Playbook Task does in the snippet above) the resultant path does indeed point to the location of the files on the Ansible Control Node...and yet, for some reason the Playbook Task does not find them.

    lmt_local_file_storage_path
    lmt_scanner_installers_folder
    scanner_package_file


    We have successfully deployed other software and agents to remote servers in the past using Ansible and have never had an issue with the Playbook being unable to find/resolve the source location for the files. I'm hoping that someone else has had this issue with the LMT Playbooks and can offer some advice as to how to successfully overcome this challenge - I've got 3 experienced RHEL System Admins all scratching their heads in frustration at this point - LOL.

    Sorry for the lengthy post but wanted to ensure we communicated sufficient information to stand a chance of receiving a solution or relevant suggestions.

    Sincerely,
    Gary Latter
    Peraton


    ------------------------------
    Gary Latter
    ------------------------------


  • 2.  RE: Distributing disconnected scanners via Ansible

    Posted Wed January 25, 2023 03:48 AM
    Edited by Grzegorz Szczepanik Wed January 25, 2023 03:48 AM

    Hi Gary,

    Yes, providing an extensive write-up of the issue is much better. Thank you!



    I understand that you have Ansible Control Node and the ILMT server on different machines.



    Please, make sure that the following step was executed:

    • Mark the managed node on which the License Metric Tool server is installed with the lmt_server tag.



    Please, also check the Ansible version that is being used.



    Then, please, try to run lmt_collect_troubleshooting_data against the LMT server.



    Best regards,

    Grzegorz



    ------------------------------
    Grzegorz Szczepanik
    ------------------------------