# How to develop an Ansible agent for another OS

**URL:** <https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862>\
**Category:** Ansible Project\
**Created:** [October 24, 2018, 12:39pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862 "2018-10-24T12:39:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![k3ck3c](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@k3ck3c](https://forum.ansible.com/u/k3ck3c)\
**Post date:** [October 24, 2018, 12:39pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/1 "2018-10-24T12:39:10Z")

</div>

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

[https://docs.ansible.com/ansible/2.6/user\_guide/playbooks\_best\_practices.html?highlight=operating%20system](https://docs.ansible.com/ansible/2.6/user_guide/playbooks_best_practices.html?highlight=operating%20system)

Thanks for any hint

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [October 24, 2018, 3:36pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/2 "2018-10-24T15:36:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![k3ck3c](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@k3ck3c](https://forum.ansible.com/u/k3ck3c)\
**Post date:** [October 24, 2018, 4:02pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/3 "2018-10-24T16:02:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [October 24, 2018, 4:28pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/4 "2018-10-24T16:28:42Z")

</div>

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

1. 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](https://docs.ansible.com/ansible/latest/modules/setup_module.html)

1. 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](https://github.com/ansible/ansible/tree/devel/lib/ansible/module_utils/facts)

Kind regards,  
gundalow

---

<div class="post-metadata">

**Author:** ![k3ck3c](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@k3ck3c](https://forum.ansible.com/u/k3ck3c)\
**Post date:** [October 25, 2018, 9:54am UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/5 "2018-10-25T09:54:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [October 26, 2018, 7:32pm UTC](https://forum.ansible.com/t/how-to-develop-an-ansible-agent-for-another-os/28862/6 "2018-10-26T19:32:14Z")

</div>

use the 'raw' module:

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