vbotka.freebsd_postinstall

freebsd_postinstall

质量
构建状态
文档状态
GitHub 标签

Ansible 角色 vbotka.freebsd_postinstall 在 galaxy.ansible.com

FreeBSD 后安装配置:别名、apcupsd、授权密钥、cron、devfs、dhclient、freebsd-update、fstab、组、hostapd、主机名、hosts、inetd、libmap、Linux 兼容性、login.conf、loader.conf、make.conf、motd、nfsd、ntpd、ntpdate、procmail、qemu、resolvconf.conf、smartd、snmpd、sudoers、ssh、sshd、交换、sysctl、syslog、时区、tmpmfs、用户、软件包和端口、periodic.conf、覆盖、wpa_supplicant,以及更多(开发中)...

文档 Ansible 角色 FreeBSD postinstall 在 readthedocs.io

该角色和文档仍在更新中。如果某个任务的文档缺失,需要查看 源代码 来了解如何使用。如果某个功能缺失,可以考虑角色 config_light。请查看各种 示例。如果 config_light 无法满足你的需求,可以创建新的任务。

欢迎 分享你的反馈和报告问题

欢迎贡献

支持的平台

该角色已在 FreeBSD 支持的版本 上开发和测试。

要求和依赖

角色

集合

软件包

查看默认值中的 pkg_dict_* 在 defaults/main/pkgdict_*.yml.

变量

查看 vars 中的默认值和示例。

freebsd_install_method

默认情况下 freebsd_install_method 设置为安装 软件包,安装更快。但是,在从端口升级后 (portmaster -a),将方法切换到 ports

freebsd_install_method: packages
#freebsd_install_method: ports
#freebsd_use_packages: true

可选地,可以通过 freebsd_poudriere 构建软件包并通过 freebsd_packages 安装。

freebsd_use_packages

如果设置此选项,则角色 freebsd_ports 将安装软件包。

#freebsd_install_method: packages
freebsd_install_method: ports
freebsd_use_packages: true

工作流程

  1. 在远程主机上,如有必要,将远程用户的 shell 更改为 /bin/sh。
ansible host -e ansible_shell_type=csh -e ansible_shell_executable=/bin/csh -a 'sudo pw usermod user -s /bin/sh'
  1. 安装角色
ansible-galaxy role install vbotka.freebsd_postinstall
ansible-galaxy role install vbotka.ansible_lib

如有必要,安装集合。

ansible-galaxy collection install ansible.posix
ansible-galaxy collection install community.general
  1. 根据需求调整变量。

  2. 创建 playbook。

cat freebsd-postinstall.yml
- hosts: host
  roles:
    - vbotka.freebsd_postinstall

参见 最佳实践

  1. 配置系统。
ansible-playbook freebsd-postinstall.yml

Ansible lint

在运行 ansible-lint 时,请使用配置文件 .ansible-lint.local。某些规则可能被禁用,某些警告可能被忽略。请查看配置文件中的说明。

shell> ansible-lint -c .ansible-lint.local

配置角色

playbook .configure.yml 提供了配置角色的任务块。阅读它以了解细节。

注意事项

  1. devfs

"/etc/rc.d/devfs rcvar" 返回未定义的变量,因此模块 "system" 会失败。

fatal: [srv.example.com]: FAILED! => changed=false
  msg: unable to determine rcvar

为了解决此问题,请应用以下补丁。

--- 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=':'

许可证

许可证

作者信息

Vladimir Botka

参考资料

云提供商

安装
ansible-galaxy install vbotka.freebsd_postinstall
许可证
bsd-2-clause
下载
131
拥有者