AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

Is Ansible/Python compatible with AIX Servers

  • 1.  Is Ansible/Python compatible with AIX Servers

    Posted Thu January 19, 2023 12:51 AM
    We are installing Python, Ansible and ibmsecurity on AIX Servers to run the Ansible Playbooks to configure ISVA Servers.

    At this moment we are stuck here

    bash-5.1$ /opt/freeware/bin/ansible-playbook -i /home/ivmgr/ISVA/inventories/non-prod/ /home/ivmgr/Ansible_prepwork/isam-ansible-collection/playbooks/base/create_snapshot.yml -e "comment=test"

    PLAY [all] ********************************************************************************************************************************************

    TASK [ibm.isam.create_snapshot : Help INFO (-e help=true)] ********************************************************************************************
    skipping: [brksva168.xxx.com]

    TASK [ibm.isam.create_snapshot : Snapshot Appliance [-e comment=<snapshots_comment>]] *****************************************************************

    [ERROR]: User interrupted execution
    bash-5.1$
    bash-5.1$ /opt/freeware/bin/ansible-playbook -i /home/ivmgr/ISVA/inventories/non-prod/ /home/ivmgr/Ansible_prepwork/isam-ansible-collection/playbooks/base/create_snapshot.yml -e "comment=test" -vvv | more
    host_list declined parsing /home/ivmgr/ISVA/inventories/non-prod/hosts as it did not pass its verify_file() method
    script declined parsing /home/ivmgr/ISVA/inventories/non-prod/hosts as it did not pass its verify_file() method
    auto declined parsing /home/ivmgr/ISVA/inventories/non-prod/hosts as it did not pass its verify_file() method
    Parsed /home/ivmgr/ISVA/inventories/non-prod/hosts inventory source with ini plugin
    Skipping callback 'actionable', as we already have a stdout callback.
    Skipping callback 'counter_enabled', as we already have a stdout callback.
    Skipping callback 'debug', as we already have a stdout callback.
    Skipping callback 'dense', as we already have a stdout callback.
    Skipping callback 'dense', as we already have a stdout callback.
    Skipping callback 'full_skip', as we already have a stdout callback.
    Skipping callback 'json', as we already have a stdout callback.
    Skipping callback 'minimal', as we already have a stdout callback.
    Skipping callback 'null', as we already have a stdout callback.
    Skipping callback 'oneline', as we already have a stdout callback.
    Skipping callback 'selective', as we already have a stdout callback.
    Skipping callback 'skippy', as we already have a stdout callback.
    Skipping callback 'stderr', as we already have a stdout callback.
    Skipping callback 'unixy', as we already have a stdout callback.
    Skipping callback 'yaml', as we already have a stdout callback.

    PLAYBOOK: create_snapshot.yml *************************************************************************************************************************
    1 plays in /home/ivmgr/Ansible_prepwork/isam-ansible-collection/playbooks/base/create_snapshot.yml

    PLAY [all] ********************************************************************************************************************************************
    META: ran handlers

    TASK [ibm.isam.create_snapshot : Help INFO (-e help=true)] ********************************************************************************************
    task path: /home/ivmgr/.ansible/collections/ansible_collections/ibm/isam/roles/base/create_snapshot/tasks/main.yml:4
    skipping: [brksva168.xxxx.com] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
    }

    TASK [ibm.isam.create_snapshot : Snapshot Appliance [-e comment=<snapshots_comment>]] *****************************************************************
    task path: /home/ivmgr/.ansible/collections/ansible_collections/ibm/isam/roles/base/create_snapshot/tasks/main.yml:33


    Not sure if there is any issue with ansible_python_interpretor but we are unable to proceed further.

    ------------------------------
    Manideep Yechuri
    ------------------------------


  • 2.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Thu January 19, 2023 09:24 AM
    It could be ansible_python_interpreter. It appears that you have warnings about that turned off in the ansible.cfg. If you turn it on, then you might get more info.

    My first guess would have been format problems in the inventory. I'm guessing this runs elsewhere? We run ours from RHEL 8 Linux.

    Grabbing the correct python with ansible can be challenging on AIX. 7.2 required the 32 bit interpreter from /opt/freeware. 7.3 comes with python that is useable. Ansible can guess correctly in AIX 7.3 though it doesn't know very much about the AIX platform and falls back to default locations. I don't declare any python interpreter and it just works. 7.2 is a different story. You need to declare the python on AIX 7.2.

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



  • 3.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 09:23 AM
    This is what my ansible.cfg config looks like

    bash-5.1$ cat ansible.cfg
    [defaults]
    roles_path = /home/ivmgr/isam-ansible-collection
    ansible_python_interpreter = /usr/bin/python

    Also, the hosts file looks like below.

    [all]
    brksva168.navistar.com
    brksva179.navistar.com

    Not sure if there is anything wrong here. But for python when I check the path this is what I'm seeing.

    bash-5.1$ which python
    /usr/bin/python

    I have the same referenced in vars.yml for below.

    ansible_python_interpreter: /usr/bin/python





    ------------------------------
    Manideep Yechuri
    ------------------------------



  • 4.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 10:21 AM
    Try

    ansible_python_interpreter = auto

    in the ansible.cfg.

    Try putting some debug code at the top of your playbook to see which python you've picked up.

    tasks:
    - name: simple debug
      ansible.builtin.debug:
        msg: python interpreter {{ ansible_python.executable }}


    If your'e still getting errors, force an interpreter for AIX 7.2.

    You could group those hosts together in the inventory and then specify the interpreter for them.

    [aix72]
    foo
    bar
    baz
    
    [aix72:vars]
    ansible_python_interpreter=/opt/freeware/bin/python3_32


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



  • 5.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 10:44 AM
    Just to add that I have an AIX 7200-05-05-2246 box that automatically discovers /opt/freeware/bin/python3.7 which is a symlink to python3.7_64, and it seems to work fine. I recall having to force it to python3_32 on older versions of AIX 7.2.

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



  • 6.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 12:18 PM
    right now you have to use Redhat linux OS with Ansible then from there you run playbook for AIX. right now I do not think AIX ansible exist.

    ------------------------------
    minesh patel
    ------------------------------



  • 7.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 12:35 PM
    Oh yes, that is an issue. I see ansible 2.7.0 in the aixtoolbox, but I'm using ansible-core 2.13.3 on RedHat. That's a huge difference.

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



  • 8.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Fri January 20, 2023 04:19 PM
    Are you saying running Ansible is not supported on AIX systems?

    ------------------------------
    PRUDHVICHOWDARY ARE
    ------------------------------



  • 9.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Sat January 21, 2023 08:58 PM
    I don't know if it works as the controlling node. I run my ansible from a Red Hat box against AIX nodes successfully. Based on the versions available and the kind of support that ansible gets on the two platforms, you're better off running it from a Linux box against your AIX boxes.

    As to "officially supported", well none of this open source stuff is. See here. https://www.ibm.com/support/pages/node/6586968

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



  • 10.  RE: Is Ansible/Python compatible with AIX Servers

    Posted Mon January 23, 2023 07:26 AM
    Edited by Stephan Dietl Mon January 23, 2023 07:27 AM

    Hello!

    Since I´m running my playbooks for my AIX 7.1 / 7.2 environment from this machine I would say "NO" ;) :

    ]# oslevel -s
    7200-05-04-2220

    ]# lslpp -L|grep -E "python|ansible|git"

    ansible 2.9.25-1 C R SSH-based configuration
    git 2.38.0-1 C R Core git tools (/bin/rpm)
    git-core 2.38.0-1 C R Core package of git with
    git-core-doc 2.38.0-1 C R Documentation files for
    git-core (/bin/rpm)
    python-requests 2.4.3-1 C R HTTP library, written in
    python3 3.7.15-2 C R An interpreted, interactive,
    python3-certifi 2019.9.11-1 C R Python package for providing
    python3-cffi 1.13.2-1 C R C parser and AST generator
    python3-chardet 3.0.4-1 C R Character encoding
    python3-cryptography 3.4.7-2 C R A small but fast and easy to
    engine written in pure python.
    python3-dateutil 2.8.0-1 C R Extensions to the standard
    python3-devel 3.7.15-2 C R The libraries and header files
    python3-dnf 4.2.17-32_50 C R Python 3 interface to DNF
    ..

    python3-gpg 1.13.1-100 C R gpgme bindings for Python 3
    python3-hawkey 0.39.1-32_51 C R Python 3 bindings for the
    python3-idna 2.8-1 C R Internationalized Domain Names
    python3-jinja2 2.10.3-1 C R General purpose template
    engine for python2 (/bin/rpm)
    python3-jmespath 0.9.4-1 C R A low-level interface to a
    python3-libcomps 0.1.11-101 C R Python 3 bindings for libcomps
    python3-libdnf 0.39.1-32_51 C R Python 3 bindings for the
    python3-librepo 1.11.0-101 C R Python 3 bindings for the
    python3-markupsafe 1.1.1-1 C R Implements a XML/HTML/XHTML
    python3-pycparser 2.19-1 C R C parser and AST generator
    python3-pycurl 7.44.1-1 C R A Python interface to libcurl
    python3-pyyaml 5.4.1.1-1 C R YAML parser and emitter for
    python3-requests 2.27.1-1 C R HTTP library, written in
    python3-six 1.13.0-1 C R Python 2 and 3 compatibility
    python3-urllib3 1.26.7-1 C R HTTP library with thread-safe
    rpm-python3 4.15.1-32_1 C R This package contains files to
    for python developements.

    ]# python3.7 -m pip list
    Package Version
    ------------------- ---------
    ansible 2.9.25
    ansible-builder 0.6.0
    ansible-cmdb 1.31
    ansible-generator 2.1.4
    ansible-runner 1.4.7
    bitmath 1.3.3.1
    cachez 0.1.2
    certifi 2019.9.11
    cffi 1.13.2
    chardet 3.0.4
    charset-normalizer 2.0.12
    cryptography 3.4.7
    dataclasses 0.6
    docutils 0.17.1
    gpg 1.13.1
    idna 2.8
    Jinja2 2.10.3
    jmespath 0.9.4
    jsonxs 0.6
    lockfile 0.12.2
    lxml 4.9.1
    Mako 1.1.4
    MarkupSafe 1.1.1
    persist-queue 0.8.0
    pexpect 4.8.0
    pip 22.2.2
    psutil 5.8.0
    ptyprocess 0.7.0
    pycparser 2.19
    pycurl 7.44.1
    python-daemon 2.3.0
    python-dateutil 2.8.2
    python-tss-sdk 1.0.1
    PyYAML 5.4.1
    requests 2.27.1
    requirements-parser 0.2.0
    retryz 0.1.9
    sentry-sdk 1.1.0
    setuptools 47.1.0
    six 1.13.0
    storops 1.2.11
    toml 0.10.2
    urllib3 1.26.7
    ushlex 0.99.1
    WARNING: You are using pip version 22.2.2; however, version 22.3.1 is available.
    You should consider upgrading via the '/opt/freeware/bin/python3.7 -m pip install --upgrade pip' command.

    ]# python3 --version
    Python 3.7.15

    HTH,

    Ciao,

    Steve



    ------------------------------
    Stephan Dietl
    ------------------------------