Skip to content

Using Ansible

Because Ansible is agentless and the only requirement is python, it works surprisingly well. For non-global zones, ansible works "out of the box".

Ansible in the Global Zone

For the Global Zone you need to have python installed via pkgsrc and in your inventory file you need to set ansible_python_interpreter to /opt/tools/bin/python.

my-smartos-cn    ansible_user=root    ansible_host=198.51.100.37    ansible_python_interpreter=/opt/tools/bin/python

You can either ssh to your SmartOS host and install python manually or install python via ansible using the raw module.

ansible my-smartos-cn -m raw -a 'pkgin -y in python311'

Ansible has some SmartOS Global Zone specific modules:

Once that is done, you may write playbooks and run playbooks. There are examples in the module documentation and on the module author's blog at:

Thanks to Jasper Lievisse Adriaanse for writing and sharing these modules!

References