Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emgr module is not idempotent with list_file #386

Open
syahrul-aiman opened this issue Dec 10, 2023 · 0 comments
Open

emgr module is not idempotent with list_file #386

syahrul-aiman opened this issue Dec 10, 2023 · 0 comments
Assignees

Comments

@syahrul-aiman
Copy link
Contributor

for normal installation (not using -f option), it has been fixed in this issue #331

however,

- name: install fixes
  ibm.power_aix.emgr:
    action: install
    from_epkg: true
    list_file: /tmp/ansible.t_bj2few.txt
    extend_fs: true
  register: results

Content of file:

/usr/sys/inst.images/IJ43869m5b.230216.epkg.Z
/usr/sys/inst.images/IJ42339s5a.221212.epkg.Z

Results:

    {
        "changed": false,
        "failed": true,
        "ifix_details": [],
        "msg": "",
        "stderr": "emgr: 0645-065 An efix with label \"IJ42339s5a\" is already installed.\nemgr: 0645-033 Error installing efix package.\nATTENTION: system reboot is required. Please see the \"Reboot Processing\"\nsections in the output above or in the /var/adm/ras/emgr.log file.\n",
        "stderr_lines": [
            "emgr: 0645-065 An efix with label \"IJ42339s5a\" is already installed.",
            "emgr: 0645-033 Error installing efix package.",
            "ATTENTION: system reboot is required. Please see the \"Reboot Processing\"",
            "sections in the output above or in the /var/adm/ras/emgr.log file."
        ],
        "stdout": "+-----------------------------------------------------------------------------+\nEfix Manager Initialization\n+-----------------------------------------------------------------------------+\nInitializing log /var/adm/ras/emgr.log ...\n\n+-----------------------------------------------------------------------------+\nProcessing Efix Package 1 of 2.\n+-----------------------------------------------------------------------------+\nEfix package file is: /usr/sys/inst.images/IJ43869m5b.230216.epkg.Z\nMD5 generating command is /usr/bin/csum\nMD5 checksum is b7881a3552d51ff2586331c5cf642a69\nAccessing efix metadata ...\nProcessing efix label \"IJ43869m5b\" ...\nVerifying efix control file ...\n\n+-----------------------------------------------------------------------------+\nInstallp Prerequisite Verification\n+-----------------------------------------------------------------------------+\nVerifying prerequisite file ...\nChecking prerequisites ...\n\nPrerequisite Number: 1\n   Fileset: bos.mp64\n   Minimal Level: 7.2.5.201\n   Maximum Level: 7.2.5.201\n   Actual Level: 7.2.5.201\n   Type: PREREQ\n   Requisite Met: yes\n\nAll prerequisites have been met.\n\n+-----------------------------------------------------------------------------+\nProcessing APAR reference file\n+-----------------------------------------------------------------------------+\nATTENTION: Interim fix is enabled for automatic removal by installp.\n\n+-----------------------------------------------------------------------------+\nEfix Attributes\n+-----------------------------------------------------------------------------+\nLABEL:            IJ43869m5b\nPACKAGING DATE:   Thu Feb 16 10:55:34 CST 2023\nABSTRACT:         IJ43869 POTENTIAL SECURITY ISSUE\nPACKAGER VERSION: 7\nVUID:             00F7CD554C00021610023423\nREBOOT REQUIRED:  yes\nBUILD BOOT IMAGE: yes\nLU CAPABLE:       yes\nPRE-REQUISITES:   yes\nSUPERSEDE:        no\nPACKAGE LOCKS:    no\nE2E PREREQS:      no\nFIX TESTED:       no\nALTERNATE PATH:   None\nEFIX FILES:       1\n\nInstall Scripts:\n   PRE_INSTALL:   no\n   POST_INSTALL:  no\n   PRE_REMOVE:    no\n   POST_REMOVE:   no\n\nFile Number:      1\n   LOCATION:      /usr/lib/boot/unix_64\n   FILE TYPE:     Standard (file or executable)\n   INSTALLER:     installp\n   SIZE:          88832\n   ACL:           DEFAULT\n   CKSUM:         19137\n   PACKAGE:       bos.mp64\n   MOUNT INST:    no\n\n+-----------------------------------------------------------------------------+\nEfix Description\n+-----------------------------------------------------------------------------+\nIJ43869 - a potential security issue exists\nIJ45423 - some cmds may fail for non root users post lku\n\n+-----------------------------------------------------------------------------+\nEfix Lock Management\n+-----------------------------------------------------------------------------+\nChecking locks for file /usr/lib/boot/unix_64 ...\n\nAll files have passed lock checks.\n\n+-----------------------------------------------------------------------------+\nSpace Requirements\n+-----------------------------------------------------------------------------+\nChecking space requirements ...\n\nSpace statistics (in 512 byte-blocks):\nFile system: /usr, Free: 5538728, Required: 223324, Deficit: 0.\nFile system: /tmp, Free: 8374472, Required: 173009, Deficit: 0.\n\n+-----------------------------------------------------------------------------+\nEfix Installation Setup\n+-----------------------------------------------------------------------------+\nUnpacking efix package file ...\nInitializing efix installation ...\n\n+-----------------------------------------------------------------------------+\nEfix State\n+-----------------------------------------------------------------------------+\nSetting efix state to: INSTALLING\n\n+-----------------------------------------------------------------------------+\nFile Archiving\n+-----------------------------------------------------------------------------+\nSaving all files that will be replaced ...\nSave directory is: /usr/emgrdata/efixdata/IJ43869m5b/save\nFile 1: Saving /usr/lib/boot/unix_64 as EFSAVE1 ...\n\n+-----------------------------------------------------------------------------+\nEfix File Installation\n+-----------------------------------------------------------------------------+\nInstalling all efix files:\nInstalling efix file #1 (File: /usr/lib/boot/unix_64) ...\n\nTotal number of efix files installed is 1.\nAll efix files installed successfully.\n\n+-----------------------------------------------------------------------------+\nPackage Locking\n+-----------------------------------------------------------------------------+\nProcessing package locking for all files.\nFile 1: locking installp fileset bos.mp64.\n\nAll package locks processed successfully.\n\n+-----------------------------------------------------------------------------+\nReboot Processing\n+-----------------------------------------------------------------------------+\n\n*** NOTICE ***\nThis efix package requires the target system to be rebooted after the current\noperation is complete. It is recommended that you reboot the target system as\nsoon as possible after installation to avoid disruption of current functionality.\n\n+-----------------------------------------------------------------------------+\nEfix State\n+-----------------------------------------------------------------------------+\nSetting efix state to: REBOOT REQUIRED\n\n+-----------------------------------------------------------------------------+\nProcessing Efix Package 2 of 2.\n+-----------------------------------------------------------------------------+\nEfix package file is: /usr/sys/inst.images/IJ42339s5a.221212.epkg.Z\nMD5 generating command is /usr/bin/csum\nMD5 checksum is 8b031d96b4ca6af98c170dfda411b861\nAccessing efix metadata ...\nProcessing efix label \"IJ42339s5a\" ...\n\n+-----------------------------------------------------------------------------+\nBoot Image Processing\n+-----------------------------------------------------------------------------+\nRebuilding boot image ...\nbosboot: Boot image is 61468 512 byte blocks.\nSuccessfully rebuilt boot image.\n\n+-----------------------------------------------------------------------------+\nOperation Summary\n+-----------------------------------------------------------------------------+\nLog file is /var/adm/ras/emgr.log\n\nEPKG NUMBER       LABEL               OPERATION              RESULT            \n===========       ==============      =================      ==============    \n1                 IJ43869m5b          INSTALL                SUCCESS           \n2                 IJ42339s5a          INSTALL                FAILURE           \n\n\nReturn Status: FAILURE\n",
        "stdout_lines": [
            "+-----------------------------------------------------------------------------+",
            "Efix Manager Initialization",
            "+-----------------------------------------------------------------------------+",
            "Initializing log /var/adm/ras/emgr.log ...",
            "",
            "+-----------------------------------------------------------------------------+",
            "Processing Efix Package 1 of 2.",
            "+-----------------------------------------------------------------------------+",
            "Efix package file is: /usr/sys/inst.images/IJ43869m5b.230216.epkg.Z",
            "MD5 generating command is /usr/bin/csum",
            "MD5 checksum is b7881a3552d51ff2586331c5cf642a69",
            "Accessing efix metadata ...",
            "Processing efix label \"IJ43869m5b\" ...",
            "Verifying efix control file ...",
            "",
            "+-----------------------------------------------------------------------------+",
            "Installp Prerequisite Verification",
            "+-----------------------------------------------------------------------------+",
            "Verifying prerequisite file ...",
            "Checking prerequisites ...",
            "",
            "Prerequisite Number: 1",
            "   Fileset: bos.mp64",
            "   Minimal Level: 7.2.5.201",
            "   Maximum Level: 7.2.5.201",
            "   Actual Level: 7.2.5.201",
            "   Type: PREREQ",
            "   Requisite Met: yes",
            "",
            "All prerequisites have been met.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Processing APAR reference file",
            "+-----------------------------------------------------------------------------+",
            "ATTENTION: Interim fix is enabled for automatic removal by installp.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix Attributes",
            "+-----------------------------------------------------------------------------+",
            "LABEL:            IJ43869m5b",
            "PACKAGING DATE:   Thu Feb 16 10:55:34 CST 2023",
            "ABSTRACT:         IJ43869 POTENTIAL SECURITY ISSUE",
            "PACKAGER VERSION: 7",
            "VUID:             00F7CD554C00021610023423",
            "REBOOT REQUIRED:  yes",
            "BUILD BOOT IMAGE: yes",
            "LU CAPABLE:       yes",
            "PRE-REQUISITES:   yes",
            "SUPERSEDE:        no",
            "PACKAGE LOCKS:    no",
            "E2E PREREQS:      no",
            "FIX TESTED:       no",
            "ALTERNATE PATH:   None",
            "EFIX FILES:       1",
            "",
            "Install Scripts:",
            "   PRE_INSTALL:   no",
            "   POST_INSTALL:  no",
            "   PRE_REMOVE:    no",
            "   POST_REMOVE:   no",
            "",
            "File Number:      1",
            "   LOCATION:      /usr/lib/boot/unix_64",
            "   FILE TYPE:     Standard (file or executable)",
            "   INSTALLER:     installp",
            "   SIZE:          88832",
            "   ACL:           DEFAULT",
            "   CKSUM:         19137",
            "   PACKAGE:       bos.mp64",
            "   MOUNT INST:    no",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix Description",
            "+-----------------------------------------------------------------------------+",
            "IJ43869 - a potential security issue exists",
            "IJ45423 - some cmds may fail for non root users post lku",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix Lock Management",
            "+-----------------------------------------------------------------------------+",
            "Checking locks for file /usr/lib/boot/unix_64 ...",
            "",
            "All files have passed lock checks.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Space Requirements",
            "+-----------------------------------------------------------------------------+",
            "Checking space requirements ...",
            "",
            "Space statistics (in 512 byte-blocks):",
            "File system: /usr, Free: 5538728, Required: 223324, Deficit: 0.",
            "File system: /tmp, Free: 8374472, Required: 173009, Deficit: 0.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix Installation Setup",
            "+-----------------------------------------------------------------------------+",
            "Unpacking efix package file ...",
            "Initializing efix installation ...",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix State",
            "+-----------------------------------------------------------------------------+",
            "Setting efix state to: INSTALLING",
            "",
            "+-----------------------------------------------------------------------------+",
            "File Archiving",
            "+-----------------------------------------------------------------------------+",
            "Saving all files that will be replaced ...",
            "Save directory is: /usr/emgrdata/efixdata/IJ43869m5b/save",
            "File 1: Saving /usr/lib/boot/unix_64 as EFSAVE1 ...",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix File Installation",
            "+-----------------------------------------------------------------------------+",
            "Installing all efix files:",
            "Installing efix file #1 (File: /usr/lib/boot/unix_64) ...",
            "",
            "Total number of efix files installed is 1.",
            "All efix files installed successfully.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Package Locking",
            "+-----------------------------------------------------------------------------+",
            "Processing package locking for all files.",
            "File 1: locking installp fileset bos.mp64.",
            "",
            "All package locks processed successfully.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Reboot Processing",
            "+-----------------------------------------------------------------------------+",
            "",
            "*** NOTICE ***",
            "This efix package requires the target system to be rebooted after the current",
            "operation is complete. It is recommended that you reboot the target system as",
            "soon as possible after installation to avoid disruption of current functionality.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Efix State",
            "+-----------------------------------------------------------------------------+",
            "Setting efix state to: REBOOT REQUIRED",
            "",
            "+-----------------------------------------------------------------------------+",
            "Processing Efix Package 2 of 2.",
            "+-----------------------------------------------------------------------------+",
            "Efix package file is: /usr/sys/inst.images/IJ42339s5a.221212.epkg.Z",
            "MD5 generating command is /usr/bin/csum",
            "MD5 checksum is 8b031d96b4ca6af98c170dfda411b861",
            "Accessing efix metadata ...",
            "Processing efix label \"IJ42339s5a\" ...",
            "",
            "+-----------------------------------------------------------------------------+",
            "Boot Image Processing",
            "+-----------------------------------------------------------------------------+",
            "Rebuilding boot image ...",
            "bosboot: Boot image is 61468 512 byte blocks.",
            "Successfully rebuilt boot image.",
            "",
            "+-----------------------------------------------------------------------------+",
            "Operation Summary",
            "+-----------------------------------------------------------------------------+",
            "Log file is /var/adm/ras/emgr.log",
            "",
            "EPKG NUMBER       LABEL               OPERATION              RESULT            ",
            "===========       ==============      =================      ==============    ",
            "1                 IJ43869m5b          INSTALL                SUCCESS           ",
            "2                 IJ42339s5a          INSTALL                FAILURE           ",
            "",
            "",
            "Return Status: FAILURE"
        ]
    }

In the above case, one is already installed, which is causing the failure.

Expectation:

  • failed should be false
  • changed should be true if at least 1 ifix is installed

Alternative solution would just install them 1 by 1 using loop instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants