FreeBSD does not come with python preinstalled and programmatically installing it via ansible from a control machine may be tricky.
During the first invocation of
pkg, it will ask you whether you want to bootstrap the pkg system on your machine:
The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]:
This happens even if you are invoking the pkg command with the
-y switch and so Ansible will be hanging on your control machine.
The trick is to use the
ASSUME_ALWAYS_YES environment variable and set it to
yes once you are bootstrapping a system:
$ ansible freebsd -m raw -a "setenv ASSUME_ALWAYS_YES yes; pkg install -y python27"
I'm a Ruby/JS dev/trainer with a focus on quality. An ex-Londoner, @terracycle, @ubxd, @lastfm. Follow me at http://twitter.com/attilagyorffy