Add examples for OpenBSD hosts. (#35691)

* Add examples for OpenBSD hosts.

* Incorporate changes recommended based on feedback from my pull request.
This commit is contained in:
Joshua Smith 2018-02-05 18:21:45 -05:00 committed by Brian Coca
parent 5cce0249f3
commit cee5d420de

View file

@ -25,14 +25,20 @@ Bootstrapping BSD
`````````````````
As mentioned above, you can bootstrap Ansible with the ``raw`` module and remotely install Python on targets. The following example installs Python 2.7 which includes the json library required for full functionality of Ansible.
On your control machine you can simply execute the following for most versions of FreeBSD::
On your control machine you can execute the following for most versions of FreeBSD::
ansible -m raw -a "pkg install -y python27" mybsdhost1
Or for most versions of OpenBSD::
ansible -m raw -a "pkg_add -z python-2.7"
Once this is done you can now use other Ansible modules apart from the ``raw`` module.
.. note::
This example used pkg as used on FreeBSD, however you should be able to substitute the appropriate package tool for your BSD; the package name may also differ. Refer to the package list or documentation of the BSD variant you are using for the exact Python package name you intend to install.
This example demonstrated using pkg on FreeBSD and pkg_add on OpenBSD, however you should be able to substitute the appropriate package tool for your BSD; the package name may also differ. Refer to the package list or documentation of the BSD variant you are using for the exact Python package name you intend to install.
.. _python_location:
@ -43,6 +49,8 @@ To support a variety of Unix/Linux operating systems and distributions, Ansible
[freebsd:vars]
ansible_python_interpreter=/usr/local/bin/python2.7
[openbsd:vars]
ansible_python_interpreter=/usr/local/bin/python2.7
If you use additional plugins beyond those bundled with Ansible, you can set similar variables for ``bash``, ``perl`` or ``ruby``, depending on how the plugin is written. For example::