This role is included in the collection vbotka.freebsd as vbotka.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.
This role has been developed and tested with FreeBSD Supported Releases.
-
fqdn required by community.general.fqdn_valid
-
jc required by community.general.jc
-
rsync required by ansible.posix.synchronize
-
See the dictionaries pkg_dict_* in defaults/main/pkgdict_*.yml
Review defaults and examples in vars.
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.
Role freebsd_ports installs packages if this option is set.
#freebsd_install_method: packages
freebsd_install_method: ports
freebsd_use_packages: true
- 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 role
ansible-galaxy role install vbotka.freebsd_postinstall
and install the collections if necessary
ansible-galaxy collection install ansible.posix
ansible-galaxy collection install ansible.utils
ansible-galaxy collection install community.general
ansible-galaxy collection install vbotka.freebsd
-
Fit variables to your needs.
-
Create the playbook freebsd-postinstall.yml
- hosts: host
roles:
- vbotka.freebsd_postinstall
See the Best practice.
- Configure the system
ansible-playbook freebsd-postinstall.yml
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
The playbook .configure.yml provides blocks of tasks to configure the role. Read it to understand the details.
Ansible itself causes the following lint errors:
- Wrong indentation
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:639: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:642: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:689: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:691: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:693: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
ansible-freebsd-postinstall/docs/annotation/annotation-tasks.yml:1443: yaml[indentation][/]: Wrong indentation: expected 8 but found 6
The filter to_nice_yaml creates invalid YAML output. For example,
- debug:
msg: "{{ foo | to_nice_yaml(indent=2) }}"
vars:
foo:
bar: [alice, bob]
gives
msg: |-
bar:
- alice
- bob
- galaxy_info.platforms[0].versions[0] 13.4 is not one of ['6.1', '7.1', '7.2', 'all']
FreeBSD 13.4 is not one of (very probably RH versions). Of course, it isn't. The error message also says:
See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-role-dependencies
This link has nothing to do with this error.
- unknown-module - couldn't resolve module/action 'community.general.sysrc'
The module community.general.sysrc is unknown?!
- FreeBSD handbook: Post-Installation
- aliases - FreeBSD handbook: Sendmail Configuration Files
- apcupsd - FreeBSD diary: Configuring a UPS daemon
- cron - FreeBSD handbook: Configuring cron
- devd - man 8
- devd.conf - man 5
- 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: Dynamic Host Configuration Protocol (DHCP)
- dhclient - man 8
- dhclient.conf - man 5
- dhclient-script - man 8
- 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