Skip to content

Instantly share code, notes, and snippets.

@smiklosovic
Forked from tomster/gist:7585211
Last active August 29, 2015 14:27
Show Gist options
  • Save smiklosovic/183c5929d38acfe29282 to your computer and use it in GitHub Desktop.
Save smiklosovic/183c5929d38acfe29282 to your computer and use it in GitHub Desktop.
bootstrap a freebsd 9.2 host with ansible. it requires a password for the root user to be set for which it will prompt you (-k). you must use the paramiko transport to allow password based login. based on https://gist.github.com/illenseer/6390361
---
# run this with ansible-playbook -i ansible_hosts bootstrap.yml -k -c paramiko
- hosts: jails_host
gather_facts: false
remote_user: root
tasks:
- name: install pkgng
raw: "pkg_info | grep -v 'pkg-' > /dev/null ; if $? pkg_add -r pkg; rehash ; pkg2ng; echo 'WITH_PKGNG=yes' >> /etc/make.conf; echo 'packagesite: http://pkgbeta.freebsd.org/freebsd%3A9%3Ax86%3A64/latest' >> /usr/local/etc/pkg.conf; pkg update ; pkg upgrade -y"
- name: install python27
raw: "pkg install -y python27"
- name: add ansible ssh-key
authorized_key: user=root key="{{ item }}"
with_file:
- ~/.ssh/identity.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment