attilagyorffy.com

Bootstrapping a FreeBSD system with Ansible

Introduction

Attila Györffy

Attila Györffy

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


FreeBSD ansible

Bootstrapping a FreeBSD system with Ansible

Posted by Attila Györffy on .
Featured

FreeBSD ansible

Bootstrapping a FreeBSD system with Ansible

Posted by Attila Györffy on .

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"
Attila Györffy

Attila Györffy

https://attilagyorffy.com

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

View Comments...