freebsd_postinstall
freebsd_postinstall
Ansible role vbotka.freebsd_postinstall at galaxy.ansible.com
FreeBSD post-install configuration: aliases, apcupsd, authorized keys, cron, devfs, dhclient, freebsd-update, fstab, groups, hostapd, hostname, hosts, inetd, libmap, linux compatibility, login.conf, loader.conf, make.conf, motd, nfsd, ntpd, ntpdate, procmail, qemu, resolvconf.conf, smartd, snmpd, sudoers, ssh, sshd, swap, sysctl, syslog, timezone, tmpmfs, users, packages and ports, periodic.conf, overlays, wpa_supplicant, (wip) ...
Documentation Ansible role FreeBSD postinstall at readthedocs.io
This role and the documentation is work in progress. If the documentation of a task is missing it's necessary to review the source code to learn how to use it. If a functionality is missing consider role config_light. See various examples. If config_light is not able to do what you want create new tasks.
Feel free to share your feedback and report issues.
Supported platforms
This role has been developed and tested 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
Variables
Review defaults and examples in vars.
freebsd_install_method
By default freebsd_install_method is set to install packages. Installation is faster. But, later, after having upgraded from the ports (portmaster -a) switch the method to ports.
freebsd_install_method: packages
#freebsd_install_method: ports
#freebsd_use_packages: true
Optionally, the packages can be built by freebsd_poudriere and installed by freebsd_packages
freebsd_use_packages
Role freebsd_ports will install packages if this option is set.
#freebsd_install_method: packages
freebsd_install_method: ports
freebsd_use_packages: true
Workflow
- On the remote hosts, change shell to /bin/sh for the remote user if necessary
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
and install the collections if necessary
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
Fit variables to your needs.
Create playbook
cat freebsd-postinstall.yml
- hosts: host
roles:
- vbotka.freebsd_postinstall
See the Best practice.
- Configure the system
ansible-playbook freebsd-postinstall.yml
Ansible lint
Use the configuration file .ansible-lint.local when running ansible-lint. Some rules might be disabled and some warnings might be ignored. See the notes in the configuration file.
shell> ansible-lint -c .ansible-lint.local
Configure the role
The playbook .configure.yml provides blocks of tasks to configure the role. Read it to understand the details.
Notes
- devfs
"/etc/rc.d/devfs rcvar" returns no variable. As a result module "system" fails
fatal: [srv.example.com]: FAILED! => changed=false
msg: unable to determine rcvar
To solve this problem apply the patch below
--- devfs.orig 2019-07-13 20:31:04.688022000 +0200
+++ devfs 2019-07-13 20:34:49.347159000 +0200
@@ -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
- devfs - man 8
- devfs.conf - man
- devfs.rules - man
- devfs rules - FreeBSD Wiki
- devfs rules not applied by default for jails - FreeBSD-SA-14:07.devfs
- dhclient - FreeBSD handbook: Configuring a DHCP Client
- freebsd-update - FreeBSD handbook: FreeBSD Update
- fstab - FreeBSD handbook: Mounting and Unmounting File Systems
- git - FreeBSD forum: How to setup a Git repository
- git - Getting Git on a Server
- hostapd - Atheros wireless driver support
- inetd - FreeBSD handbook: The inetd Super-Server
- login.conf - FreeBSD handbook: Resource Limits
- linux - FreeBSD handbook: Linux Binary Compatibility
- linprocfs - FreeBSD man
- loader.conf - FreeBSD handbook: FreeBSD Boot Process
- make.conf - FreeBSD forum: Prioritizing SSL/TLS in make.conf
- make.conf - FreeBSD wiki: Design for Flavors and Sub Packages
- make.conf - GNU emacs flavours in FreeBSD
- mount - FreeBSD handbook: Mounting and Unmounting File Systems
- nfs - FreeBSD handbook: Network File System (NFS)
- nfsd - FreeBSD forum: NFSv4 without Kerberos
- ntp - FreeBSD handbook: Clock Synchronization with NTP
- ntp - FreeBSD forum: Testing NTP
- ntp - NTP Support Wiki
- ntp - How to use pool.ntp.org
- periodic.conf - FreeBSD forum: periodic and cron doubt
- ports - FreeBSD handbook: Upgrading Ports Using Portmaster
- procmail - Documentation Project
- qemu - FreeBSD Wiki: Qemu on FreeBSD as host
- qemu - QEMU Wiki: Hosts/BSD
- resolv.conf - FreeBSD handbook: Configuration Files
- smartd - FreeBSD forum: camcontrol hdd smart status
- snmp - Install and configure snmp in Freebsd
- snmp - Simple Network Management Protocol (SNMP)
- ssh - FreeBSD handbook: OpenSSH
- ssl - OpenSSL Wiki
- sudo - FreeBSD handbook: Shared Administration with Sudo
- swap - FreeBSD handbook: Adding Swap Space
- sysctl - FreeBSD handbook: Tuning with sysctl
- syslog - FreeBSD handbook: Configuring System Logging
- timezone - How to set up FreeBSD for my region?
- tmpmfs - FreeBSD forum: Questions about ramdisk in FreeBSD
- tmpfs - FreeBSD forum: /dev/shm | md questions
- users - FreeBSD handbook: Adding Users and Groups
- vars - FreeBSD Wiki: Ports/DEFAULT_VERSIONS
- wpa_supplicant - Project site
- wpa_supplicant - FreeBSD handbook: Wireless Networking
Cloud providers
Postinstallation configuration of FreeBSD.
ansible-galaxy install vbotka/ansible-freebsd-postinstall