A simple Playbook to configure a new FreeBSD based server.
To run this Playbook on a FreeBSD system, the system in question must have Python installed. This can be done via pkg for example:
target# pkg install python- Clone/download this repository
- Unpack/cd into the directory
- Run
$ ansible-playbook main.yml (-Kk)
- The target will reboot when the playbook is finished running
- Done
All tasks can be selected via Tags, so you can pick whatever tasks you want to run.
Following, a couple of use cases:
- Run all tasks
$ ansible-playbook main.yml --tags all (-Kk)
- Only run a subset of tasks
ansible-playbook main.yml --tags "upgrade,doas,sshd,loader,ports" (-Kk)
- Run only one task
ansible-playbook main.yml --tags "fail2ban" (-Kk)
All available Tags:
upgrade
ntp
pkg
login_conf
rc
doas
packages
sshd
sysctl
fail2ban
hushlogin
loader
ports
rebootBefore running this Playbook, be sure to check the variables in the vars/main.yml directory.
Also: Make sure you have set the correct IP/Hostname in the hosts file.
If Python is not already installed on the destionation host, you can run the supplied bootstrap.yml Playbook to do just that.
$ ansible-playbook bootstrap.yml (-Kk)BEWARE: do NOT run this Playbook blindly!
Juraj „otis“ Lutter (https://twitter.com/jurajlutter) - For suggesting to only rebuild the login.conf db when necessary.