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

Playbook for AIX #2449

Closed
aixtools opened this issue Oct 1, 2020 · 7 comments
Closed

Playbook for AIX #2449

aixtools opened this issue Oct 1, 2020 · 7 comments

Comments

@aixtools
Copy link

aixtools commented Oct 1, 2020

I have volunteered to be AIX admin at OSU, and as part of that am also looking at redoing the ansible playbooks for other projects. I do not find any direct action since PR #784 - although I am sure there has been some.

See adoptium/infrastructure#1582 or adoptium/infrastructure#1583 for info on how I would proceed, roughly speaking.

@mhdawson
Copy link
Member

mhdawson commented Oct 8, 2020

our ansible playbooks are integrated and share where possible across platforms. We can tweak the AIX specific parts but we still want them to share with the scripts we have for other platforms which will constrain how/what you can change.

Not sure if that fits with what you had in mind.

@aixtools
Copy link
Author

aixtools commented Oct 9, 2020

It fits fine. I would not have it any other way. I might have a difference of opinion over some things - but my key goal is to be able to have things as similar as possible. in other words, wherever possible minimize/remove AIX idiosyncrasies.

Ansible - built-in/collection support for AIX misses many elements - and I hope to make a difference in that area.

Where differences are unavoidable - then I hope to present compelling arguments from an AIX expert - for change.

@aixtools
Copy link
Author

So, here is an example of a playbook I wrote to install bash - without needing all the prequisites needed to use the Ansible yum: statement. (roughly 50 different packages and updates - not including the 3 to 5 extra needed to even get yum to be downloadable).

Note: I am testing with Ansible 2.10 (on AIX as Control Node) - but I expect this should work with lower levels of Ansible.

Note 2: This is a template I used to learn Ansible - I am actually working on a role - working name/title "aixpm/AIX Package Manager". Using the role the statement would just be:

- roles:
  role: aixpm:
    vars: bash
  role: aixpm
    vars: cmake

Which - of course - will be even simplified more - as I improve my knowledge of Ansible.

Note 3: I have an example, per above, working locally - just not sure how to organize how to publish it on github - under aixtools.

# Install bash when /usr/bin/bash does not exist
# Or it is a symbolic link pointing at nothing
- hosts: wip
  gather_facts: no

  vars:
    tools:  "http://download.aixtools.net/tools/gnu/"
    lpp:    "aixtools.gnu.bash"
    vrmf:   "5.0.18.0"
    chksum: "md5:E6106A3CF9A82B4E8785003F587ECA13"
    idem:   "/opt/bin/bash"

  tasks:
    - name: "Check for existing {{ lpp }}"
      stat:
        path: "{{ idem }}"
      register: tgt

    - name: "Download and Install {{ lpp }}"
      block:
        - get_url:
            url: "{{ tools }}{{ lpp }}.{{ vrmf }}.I"
            dest: "/tmp"
            checksum: "{{ chksum }}"
        - command: "/usr/sbin/installp -d /tmp/{{ lpp }}.{{ vrmf }}.I -aYX all"
          register: installp
        - file: "path=/tmp/{{ lpp }}.{{ vrmf }}.I state=absent"
        - file: "path=/tmp/.toc state=absent"
        - file:
            src: /opt/bin/bash
            dest: /usr/bin/bash
            state: link
        - debug:
            var: "{{ item }}.stdout_lines"
          with_items:
            - installp
      when: tgt.stat.exists == false

@richardlau
Copy link
Member

@aixtools sounds good if we end up with something like Note 2.

@AshCripps
Copy link
Member

Yes note 2 is what we would like to implement - it should be a very simple cut n paste in replacement of yum. How would it handle in place updates? for example most AIX boxes we use come with bash 4 installed and we update to bash 5

@aixtools
Copy link
Author

Aside note: while testing the current playbook - ran into - 'does not work with python3' - which I had already installed.

Have added the following so that yum.sh can be run:

Installation Summary
--------------------
Name                        Level           Part        Event       Result
-------------------------------------------------------------------------------
tcl.base                    8.4.7.1         USR         APPLY       SUCCESS
bos.net.tcp.ftp             7.2.4.0         USR         APPLY       SUCCESS
bos.net.tcp.ftp             7.2.4.0         ROOT        APPLY       SUCCESS
tk.base                     8.4.7.1         USR         APPLY       SUCCESS
expect.base                 5.42.1.1        USR         APPLY       SUCCESS

Re: have bash4 - but want bash5.

My bash can be installed side-by-side - has always been a premise of mine to not step on /opt/freeware for standard AIX software. The exe is placed in /opt/bin. What the playbook also does is add a symbolic link from /usr/bin/bash to /opt/bin/bash. This is a playbook option - not something done/enforced by the installp package.

An additional playbook (as I am guessing you have now - could be used to rpm -e bash to remove any previously installed version.

@github-actions
Copy link

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

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

No branches or pull requests

4 participants