vbotka.freebsd_postinstall
FreeBSD Post-Install
This is an Ansible role called vbotka.freebsd_postinstall available on galaxy.ansible.com.
It helps in configuring FreeBSD after installation, covering settings like aliases, UPS configuration with apcupsd, SSH keys, cron jobs, network settings, and much more.
For more detailed information, check the Ansible Role FreeBSD Postinstall Documentation.
The role and documentation are in active development. If you can't find information on a task, please review the source code for usage instructions. If a feature is missing, you may want to check another role called config_light or various examples.
Feel free to give feedback and report issues.
Supported Platforms
This role works with FreeBSD Supported Releases.
Requirements and Dependencies
Roles
- Ansible Role vbotka.ansible_lib
Collections
- ansible.posix
- ansible.utils
- community.general >= 9.3.0
Packages
See the dictionaries pkg_dict_* in defaults/main/pkgdict_*.yml for available packages.
Variables
Refer to defaults and examples in vars for configuration options.
Installation Method
By default, freebsd_install_method uses packages for installation, which is faster. After upgrading from ports using (portmaster -a), you can switch to using ports.
freebsd_install_method: packages
#freebsd_install_method: ports
#freebsd_use_packages: true
If you want, you can build packages using freebsd_poudriere and install them with freebsd_packages.
Use Packages
The role freebsd_ports will install packages if this option is activated.
#freebsd_install_method: packages
freebsd_install_method: ports
freebsd_use_packages: true
Workflow
- Change the remote user's shell to /bin/sh if needed.
ansible host -e ansible_shell_type=csh -e ansible_shell_executable=/bin/csh -a 'sudo pw usermod user -s /bin/sh'
- Install the roles.
ansible-galaxy role install vbotka.freebsd_postinstall
ansible-galaxy role install vbotka.ansible_lib
Also, install the required collections if needed.
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
Adjust the variables to fit your needs.
Create a playbook.
cat freebsd-postinstall.yml
- hosts: host
roles:
- vbotka.freebsd_postinstall
Refer to the Best Practice Guide.
- Configure the system.
ansible-playbook freebsd-postinstall.yml
Ansible Linting
Use the configuration file .ansible-lint.local when running ansible-lint. Some rules may be disabled, and warnings might be ignored. Check the notes in the configuration file for details.
shell> ansible-lint -c .ansible-lint.local
Configure the Role
The playbook .configure.yml provides sections for configuring the role. Read it for specific details.
Notes
- devfs issues
If "/etc/rc.d/devfs rcvar" returns no variable, it may cause the module "system" to fail. To fix this, apply the provided patch.
--- devfs.orig 2019-07-13 ...
+++ devfs 2019-07-13 ...
@@ -11,6 +11,7 @@
. /etc/rc.subr
name="devfs"
+rcvar="devfs_load_rulesets"
desc="Device filesystem"
start_cmd='devfs_start'
stop_cmd=':'
License
Author Information
References
- FreeBSD Handbook: Post-Installation
- Aliases - FreeBSD Handbook: Sendmail Configuration Files
- Apcupsd - FreeBSD Diary: Configuring a UPS Daemon
- Cron - FreeBSD Handbook: Configuring Cron
- Devfs - Man 5
- DHCP Client Configuration - FreeBSD Handbook
- FreeBSD Update - FreeBSD Handbook
Cloud Providers
Postinstallation configuration of FreeBSD.
ansible-galaxy install vbotka.freebsd_postinstall