Skip to content

vbotka/ansible-freebsd-poudriere

Repository files navigation

freebsd_poudriere

quality Build Status Documentation Status GitHub tag

Ansible role. FreeBSD. Install and configure Poudriere Build System.

Documentation at readthedocs.io

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

Collections

  • community.crypto
  • community.general

Variables

Review the defaults and examples in vars.

Workflow

  • Change the login shell for the remote_user at the remote host build.example.com to /bin/sh if necessary
shell> ansible build.example.com -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod admin -s /bin/sh'
  • Install the role and the collection
shell> ansible-galaxy role install vbotka.freebsd_poudriere

Install the collections if necessary

shell> ansible-galaxy collection install community.crypto
shell> ansible-galaxy collection install community.general
  • Fit variables to your needs.

  • Create the playbook

shell> cat freebsd-poudriere.yml
- hosts: build.example.com
  roles:
    - vbotka.freebsd_poudriere
  • Check syntax
shell> ansible-playbook freebsd-poudriere.yml --syntax-check
  • Display variables
shell> ansible-playbook freebsd-poudriere.yml -t poudriere_debug -e poudriere_debug=true
  • Install packages
shell> ansible-playbook freebsd-poudriere.yml -t poudriere_pkg -e poudriere_install=true
  • Run the playbook and configure poudriere
shell> ansible-playbook freebsd-poudriere.yml

Example: Build 14.1-RELEASE packages for amd64

  • ssh to the host build.example.com

  • Optionally copy existing PORT_DBDIR to the directory /usr/local/etc/poudriere.d/options and review the options.

  • Create the jail 14Ramd64 from the FreeBSD 14.1-RELEASE tree

shell> poudriere jail -c -j 141Ramd64 -v 14.1-RELEASE -a amd64
  • Create ports
shell> poudriere ports -c -m git+https -B main
  • Take a look at the packages lists. See tasks/pkglist.yml (default: {{ poudriere_pkglist_dir }}/{{ pkg_arch }})
shell: ls -la /usr/local/etc/poudriere.d/pkglist/amd64

For example,

shell> cat /usr/local/etc/poudriere.d/pkglist/amd64/minimal
shells/bash
devel/git
archivers/gtar
ports-mgmt/pkg
ports-mgmt/portmaster
ports-mgmt/portupgrade
net/rsync
ftp/wget
  • Optionally configure the options for the packages pkglist. This will supersede the options from step 2. See Handbook: Building Packages with poudriere. Using Sets
shell> poudriere options -j 141Ramd64 -z <setname> -f pkglist
  • Build the set of packages setname listed in the file /usr/local/etc/poudriere.d/pkglist/amd64/minimal
shell> poudriere bulk -j 141Ramd64 -z devel -f /usr/local/etc/poudriere.d/pkglist/amd64/minimal
  • Provide the clients with the certificate. (default poudriere_cert_path)
/usr/local/etc/ssl/crt/poudriere.crt
  • Install a web server and publish the packages
/usr/local/poudriere/data/packages/14amd64-local-setname

Clients

  • Use Ansible role freebsd_packages to configure the repositories and to install the packages using Ansible module community.general.pkgng.

  • Alternatively set freebsd_use_packages=true and use Ansible role freebsd_ports to install the packages using Ansible module community.general.portinstall.

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

References

License

license

Author Information

Vladimir Botka

About

Install and configure Poudriere Build System in FreeBSD.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages