How to develop an Ansible agent for another OS

98 views
Skip to first unread message

k3c...@gmail.com

unread,
Oct 24, 2018, 8:39:10 AM10/24/18
to Ansible Project
Hello

I am looking for some docs explaining how to develop  an agent for another Operating System

I noticed in

/usr/local/python2.7/dist-packages:ansible/modules-utils/facts/hardware

some files like 
aix.py
sunos.py
netbsd.py
linux.py
hpux.py

and so

It seems ansible_distribution may be the name of the OS, according to


Thanks for any hint

joba...@redhat.com

unread,
Oct 24, 2018, 11:36:59 AM10/24/18
to Ansible Project
Hi,

Could you please explain what you are trying to achieve, so we can guide you?

The existing code supports most common Operating Systems even if their isn't a specific Python file for that Operating System.

Kind regards,
gundalow

k3c palmi

unread,
Oct 24, 2018, 12:02:31 PM10/24/18
to ansible...@googlegroups.com
Hello

I was trying to port Ansible to OpenVMS Itanium.

Ansible is written in Python, and Python is available for OpenVMS 

I thought I had read some time ago some Ansible  doc explaining how to deal with another OS, but I can't find it in the docs.

Regards

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9ad684c1-016f-456e-ae9c-1ba8811a80c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

joba...@redhat.com

unread,
Oct 24, 2018, 12:28:42 PM10/24/18
to Ansible Project
Hi,
Thanks for the detail.

So, just to clarify some things:
  • ansible-playbook will still be run on a standard Linux machine, that's the controller
  • Ansible doesn't have an agent. It communicates over ssh, nothing to install on the remote-node
  • We are talking about supporting OpenVMS/Itanium as a remote-node

Assuming you have an inventory file that defines openvms-01

1) If we start with the simplest task:
ansible openvms-01 -m ping
This ensure we have connectivity

2) Then look at 
ansible openvms-01 -m setup -a 'gather_subset=!min'
Which should return something like

SUCCESS => {
    "ansible_facts": {
        "gather_subset": [
            "!min"
        ], 
        "module_setup": true
    }, 
    "changed": false

You can play around with the various gather_subset as defined on https://docs.ansible.com/ansible/latest/modules/setup_module.html 

3) Then
ansible openvms-01 -m setup -a 'gather_subset=min'


How do those commands seem?


If any fail add -vv and rerun


This should give us an indication of what works "out of the box".


You can see the code for the existing for facts in https://github.com/ansible/ansible/tree/devel/lib/ansible/module_utils/facts

Kind regards,
gundalow

k3c...@gmail.com

unread,
Oct 25, 2018, 5:54:36 AM10/25/18
to Ansible Project
Hello

Thanks for your valuable inputs

after setting up SSH between the Linux and OpenVMS node, the

ansible openvms-01 -m ping

succesfully connects to the remote system (via ssh), then 
sends
'/bin/sh -c '"'"'echo ~SYSTEM && sleep 0'"'"''

but this is an illegal command on OpenVMS which has a specific shell named DCL.

So, now, how to specifiy a correct command for the OpenVMS host and check the reply.

Brian Coca

unread,
Oct 26, 2018, 3:32:55 PM10/26/18
to ansible...@googlegroups.com
use the 'raw' module:

ansible openvms-01 -m raw -a "command"

----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages