AIX

 View Only
  • 1.  dnf_installer.sh question

    Posted 15 days ago

    I was just running an Ansible playbook that includes calling the power_aix_bootstrap role that's part of the ibm.power_aix collection. 

    Under the covers it runs the dnf_installer.sh script.  It's failing after apparently successfully downloading dnf_bundle_aix_73.tar, even when I run the script outside of Ansible.

    ./dnf_installer.sh[70]: usage:  not found.
    Attempting download of dnf_bundle_aix_73.tar ...
    Saving to 'dnf_bundle_aix_73.tar'...
    223 MB received in 49 seconds (4.55 MB/sec)
    Failed to download dnf_bundle_aix_73.tar

    Looking at the underlying code, I see:
        if LDR_CNTRL=MAXDATA=0x80000000@DSA /usr/opt/perl5/bin/lwp-download https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_bundle_aix_
    73.tar; then
            echo "Failed to download dnf_bundle_aix_73.tar"
            cd - >/dev/null 2>&1 || exit 1
            rm -rf "$tmppath"
            exit 1
        fi

    That logic seems backwards to me. Basically to me it's saying if download successful; then say it failed and exit.  Given I'm hardly the first person to run this script, I'm apparently missing something.



    ------------------------------
    Mark Steele
    Guru
    Direct Systems Support
    San Diego CA
    ------------------------------


  • 2.  RE: dnf_installer.sh question

    Posted 15 days ago

    Mark,

    I think you can file the bug at https://github.com/IBM/ansible-power-aix.

    But do you really need the role? The job done by the script can be done by Ansible:

        - name: Download Toolbox bundle
          ansible.builtin.get_url:
            url: "https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_bundle_aix_73.tar"
            dest: "./dnf_bundle_aix_73.tar"
          delegate_to: localhost
          run_once: true
    
            - name: Copy the bundle to server
              ansible.builtin.raw: "scp {{ bundle_name }} {{ ansible_user }}@{{ inventory_hostname }}:"
              delegate_to: localhost
    
            - name: Create a temporary directory
              ansible.builtin.raw: "mkdir -p /tmp/dnf_install"
    
            - name: Unpack the bundle
              ansible.builtin.raw: "tar xf {{ bundle_name }} -C /tmp/dnf_install"
    
            - name: Install RPM packages
              ansible.builtin.raw: "cd /tmp/dnf_install && ./install_dnf.sh -y"
              become: true
              register: rpm_install
    
            - name: Show output
              ansible.builtin.debug:
                var: rpm_install.stdout_lines

    Sorry, the formatting is wrong because this is part of another playbook with more checks and whistles. Of course, the script checks filesystem sizes and does some more jobs. Everything that you can incorporate into your playbook ;-)

    The biggest disadvantage of the role is that it downloads the bundle from the Internet to every AIX server. There is no way to set the source of the bundle file. On AIX 7.3, there is no need for the role at all because Python is usually already installed in the standard installation unless you change it.



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------



  • 3.  RE: dnf_installer.sh question

    Posted 12 days ago

    Thank you so much for the link.



    ------------------------------
    Alder Jude
    ------------------------------



  • 4.  RE: dnf_installer.sh question

    Posted 15 days ago

    The issue might be with the script; the condition should be if ! *************.

    # ./check.sh
    + /usr/opt/perl5/bin/lwp-download https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_bundle_aix_73.tar
    + LDR_CNTRL=MAXDATA=0x80000000@DSA
    Overwrite dnf_bundle_aix_73.tar? [y] y
    223 MB received in 50 seconds (4.46 MB/sec)
    # cat ./check.sh
    set -x
    if ! LDR_CNTRL=MAXDATA=0x80000000@DSA /usr/opt/perl5/bin/lwp-download https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_bundle_aix_73.tar; then
        echo "Failed to download dnf_bundle_aix_73.tar"
        cd - >/dev/null 2>&1 || exit 1
        rm -rf "$tmppath"
        exit 1
    fi
    #



    ------------------------------
    Srikanth Thanneeru
    ------------------------------



  • 5.  RE: dnf_installer.sh question

    Posted 15 days ago

    @Srikanth Thanneeru I completely concur. I made that change and moved on with my life. 
    @Andrey Klyachkin I was wanted to make sure I wasn't going nuts before posting a bug report. Will do that now. As for using the role, figure that's what it's for! :)



    ------------------------------
    Mark Steele
    Guru
    Direct Systems Support
    San Diego CA
    ------------------------------



  • 6.  RE: dnf_installer.sh question

    Posted 13 days ago

    I had the same issue, but now everything is good.  Thank you.



    ------------------------------
    Mason Russell
    ------------------------------