Power

 View Only
Expand all | Collapse all

How to install an lpp using ansible from nim server?

  • 1.  How to install an lpp using ansible from nim server?

    Posted Wed September 21, 2022 11:05 AM
    I am writing an ansible playbook to customize an AIX LPAR to the way we like it. One customization is to switch password algorithm to sha512. This part is easy, however the play fails if pwmod lpp is not installed because it is a dependency.

    No prob, you may think, because you would just install pwmod from the NIM server. With Linux, I would just use the yum module to install a needed package, and true, there is an installp module, but there's no nim support. Even the ibm.power_aix collection doesn't have a nimclient  module, or a way to call out to the nim master to install a package. Before I go and write this in the shell, is there something I'm not seeing?

    Does anyone have a method for doing this that they'd like to share?

    Many thanks,

    M.

    ------------------------------
    Mario Stargard
    ------------------------------


  • 2.  RE: How to install an lpp using ansible from nim server?

    Posted Fri October 21, 2022 02:16 PM
    In case anyone goes looking for this answer. Define nim_master somewhere appropriate and include these tasks in your playbook.

    nim takes care of allocating the lpp_source for you, and it will deallocate when it's finished. You'll need the ansible-power-aix collection to gather the lpp_facts.

    - name: Gather lpp facts
      ibm.power_aix.lpp_facts:
        filesets: pwmod.sha512
    
    - name: Add pwmod package
      ansible.builtin.shell: |
        nim -o cust -a lpp_source="{{ lpp_source }}" -a filesets="pwmod" "{{ 'master' if inventory_hostname == nim_master else inventory_hostname }}"
      when: "'pwmod.sha512' not in ansible_facts.filesets"
      delegate_to: "{{ nim_master }}"
    
        ​

    It would be nice to see a nim -o cust in the collection.

    M.

    ------------------------------
    Mario Stargard
    ------------------------------