openafs_contrib.openafs.openafs_build (1.9.0) — module

Build OpenAFS binaries from source

Authors: Michael Meffie

preview | supported by community

Install collection

Install with ansible-galaxy collection install openafs_contrib.openafs:==1.9.0


Add to requirements.yml

  collections:
    - name: openafs_contrib.openafs
      version: 1.9.0

Description

Build OpenAFS server and client binaries from source code by running C(regen.sh), C(configure), and C(make). The source code must be already present in the I(srcdir) directory.

The M(openafs_build) module will run the OpenAFS C(regen.sh) command to generate the C(configure) script when the C(configure) script is not already present in the I(srcdir).

Unless the I(configure_options) option is specified, the configure command line arguments are determined automatically, based on the platform and M(openafs_build) options.

The C(make) program is run to build the binaries. Unless the I(target) options is specified, the make target is determined automatically.

A complete set of build log files are written on the I(logdir) directory on the host for build troubleshooting.

Out-of-tree builds are supported by specifying a build directory with the I(builddir) option.

C(git clean) is run in the I(srcdir) when I(clean) is true and a C(.git) directory is found in the C(srcdir). When I(clean) is true but a C(.git) directory is not found, then C(make clean) is run to remove artifacts from a previous build. When I(clean) is true and an out-of-tree build is being done, all of the files and directories are removed from the I(builddir).

An installation file tree is created in the I(destdir) directory when the I(target) starts with C(install) or C(dest). The files in I(destdir) may be installed with the M(openafs_install_bdist) module.

See the C(openafs_devel) role for tasks to install required build tools and libraries on various platforms.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build OpenAFS from source
  openafs_contrib.openafs.openafs_build:
    srcdir: ~/src/openafs
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build OpenAFS binaries for the current system.
  openafs_contrib.openafs.openafs_build:
    srcdir: ~/src/openafs
    clean: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build OpenAFS legacy distribution
  openafs_contrib.openafs.openafs_build:
    srcdir: ~/src/openafs
    clean: yes
    with_transarc_paths: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build OpenAFS server binaries with custom install paths.
  openafs_contrib.openafs.openafs_build:
    srcdir: ~/src/openafs
    clean: yes
    target: install_nolibafs
    destdir: packages/dest
    configure_options:
      prefix: /usr
      bindir: /usr/bin
      libdir: /usr/lib64
      sbindir: /usr/sbin
      disable:
        - strip_binaries
        - kernel_module
      enable:
        - debug
        - redhat_buildsys
        - transarc_paths
      with:
        - krb5: /path/to/krb5.lib
      with_linux_kernel_packaging: true
      with_swig: true

Inputs

    
jobs:
    default: the number of CPUs on the system
    description:
    - Number of parallel make processes.
    - Set this to 0 to disable parallel make.
    type: int

make:
    default: detect
    description:
    - The C(make) program to be executed.
    type: path

clean:
    default: false
    description:
    - Run C(git clean) in the I(srcdir) when it contains a C(.git) directory, otherwise
      run C(make clean).
    - Remove the I(builddir) when using an out of tree build, that is the I(builddir)
      is different than the I(srcdir).
    - A I(clean) build should be done to force a complete rebuild.
    - The I(clean) option will remove any new files you added manually on the remote node
      and did not commit when the I(srcdir) is a git repository.
    type: bool

logdir:
    default: <srcdir>/.ansible
    description:
    - The path to store build log files.
    - The logdir may be a subdirectory of the C(srcdir).
    - The logdir may not be a subdirectory of the C(builddir) when doing an out-of-tree
      build.
    type: path

srcdir:
    description:
    - Source files must have been previously checkout or copied to this path.
    required: true
    type: path

target:
    default: detect
    description:
    - The make target to be run.
    - The make target will be determined automatically when this option is omitted.
    type: str

destdir:
    default: <srcdir>/packages/dest
    description:
    - The destination directory for C(install) and C(dest) targets and variants.
    - The tree staged in this directory may be installed with the M(openafs_install_bdist)
      module.
    type: path

builddir:
    default: <srcdir>
    description:
    - The path for out-of-tree builds.
    type: path

with_rxgk:
    default: false
    description: Include rxgk support.
    type: bool

build_module:
    default: true
    description: Build the OpenAFS kernel module.
    type: bool

with_version:
    description:
    - Version string to embed in program files.
    - The I(version) will be written to the C(.version) file, overwritting the current
      contents, if any.
    type: str

build_bindings:
    default: true
    description: Build program language bindings with swig.
    type: bool

build_manpages:
    default: true
    description: Generate the man pages.
    type: bool

build_userspace:
    default: true
    description: Build userspace programs and libraries.
    type: bool

build_fuse_client:
    default: true
    description: Build fuse client.
    type: bool

configure_options:
    description:
    - The explicit C(configure) command arguments. When present, this option overrides
      the C(build_*) and C(with_*) options.
    - May be specified as a string, list of strings, or a dictionary.
    - When specified as a dictionary, the values of the keys C(enabled), C(disabled),
      C(with), and C(without) may be lists.
    type: raw

with_debug_symbols:
    default: true
    description: Include debug symbols and disable optimizations.
    type: bool

with_transarc_paths:
    default: false
    description: Build binaries which use the legacy Transarc-style paths.
    type: bool

configure_environment:
    description:
    - Extra environment variables to be set when running C(configure).
    type: dict

build_terminal_programs:
    default: true
    description: Build curses-based terminal programs.
    type: bool

Outputs

builddir:
  description: Absolute path to the build directory
  returned: always
  sample: /home/tycobb/projects/myproject
  type: string
destdir:
  description: Absolute path to the installation files.
  returned: when destdir is specified
  sample: /home/tycobb/projects/myproject/packages/dest
  type: string
kmods:
  description: The list of kernel modules built, if any.
  returned: success
  sample:
  - /home/tycobb/projects/myproject/src/libafs/MODLOAD-5.1.0-SP/openafs.ko
  type: list
logdir:
  description: Absolute path to the log files. May be used for M(openafs_install_bdist).
  return: always
  sample: /home/tycobb/projects/myproject/.ansible
  type: string
logfiles:
  description: Log files written for troubleshooting
  returned: always
  sample:
  - /tmp/logs/build.log
  - /tmp/logs/make.out
  - /tmp/logs/make.err
  type: list
srcdir:
  description: Absolute path to the project directory.
  returned: always
  sample: /home/tycobb/projects/myproject
  type: string