Skip to content

vbotka/ansible-freebsd-postinstall

Repository files navigation

freebsd_postinstall

quality Build Status Documentation Status GitHub tag

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.

Contributions are welcome.

Supported platforms

This role has been developed and tested with FreeBSD Supported Releases.

Requirements and dependencies

Collections

Packages

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 installs packages if this option is set.

#freebsd_install_method: packages
freebsd_install_method: ports
freebsd_use_packages: true

Workflow

  1. 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'
  1. 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
  1. Fit variables to your needs.

  2. Create the playbook freebsd-postinstall.yml

- hosts: host
  roles:
    - vbotka.freebsd_postinstall

See the Best practice.

  1. 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.

Ansible Galaxy Import log lint errors v2.7.8

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?!

License

license

Author Information

Vladimir Botka

References

Cloud providers

About

Ansible role. Post-install configuration of FreeBSD.

Resources

License

Stars

Watchers

Forks

Packages

No packages published