ansiblebit.wkhtmltopdf

wkhtmltopdf

License Build Status

Platform

Project Stats

This is an Ansible role to install wkhtmltopdf.

This repository was created from AerisCloud/ansible-wkhtmltopdf but has changed a lot from the original version.

Tests

The following table shows the testing status for various Debian distributions:

Family Distribution Version Test Status
Debian Debian Jessie x86_64
Debian Debian Wheezy x86_64
Debian Ubuntu Yakkety x86_64
Debian Ubuntu Xenial x86_64
Debian Ubuntu Wily x86_64
Debian Ubuntu Trusty x86_64
Debian Ubuntu Precise x86_64

Requirements

  • Ansible version 2.0 or higher

Role Variables

  • debug: a flag to enable debug tasks.
  • wkhtmltopdf_dir_install: the directory where wkhtmltox commands will be installed.
  • wkhtmltopdf_installation: the method of installation (package or source).
  • wkhtmltopdf_version: the version to be installed.
  • wkhtmltopdf_mm_version: the major and minor version to be installed (no need to manually set).
  • wkhtmltopdf_user: the user account used to build the software.

Build

Variables used during the building installation process:

  • wkhtmltopdf_architecture: the architecture of the system (i386 or amd64).
  • wkhtmltopdf_build: the method to download the software (tarball or git).
  • wkhtmltopdf_build_args: arguments for build.py to build the software.
  • wkhtmltopdf_chroot_args: arguments for build.py to set up the chroot environment.
  • wkhtmltopdf_default_version: a flag to indicate if this version is the default.
  • wkhtmltopdf_dir_chroot: the directory to set up the chroot environment.
  • wkhtmltopdf_dir_source: the directory to store the source tarball.
  • wkhtmltopdf_dir_source_version: the directory to extract the tarball or clone the git repository.
  • wkhtmltopdf_force_build: to force the software compilation.
  • wkhtmltopdf_runtime_dependencies: a list of required packages to run the software.
  • wkhtmltopdf_tarball_download_url: the URL to download the tarball.
  • wkhtmltopdf_slug: the git repository slug to be cloned.
  • wkhtmltopdf_tarball: the base name of the tarball.

Package

  • wkhtmltopdf_package_download_url: the URL to download the Debian package.

Dependencies

  • ansiblebit/git if you want to install using wkhtmltopdf_installation=source and wkhtmltopdf_build=git.

Playbooks

Package

This option is available only for versions 0.12.1 and 0.12.2 on:

  • ubuntu/trusty
  • ubuntu/precise
  • debian/wheezy

Example playbook:

- hosts: servers
  vars:
    wkhtmltopdf_installation: package
    wkhtmltopdf_version: 0.12.1

  roles:
     - role: ansiblebit.wkhtmltopdf

Source

You can build wkhtmltopdf from source using either a tarball or git.

For tarball:

- hosts: servers
  vars:
    wkhtmltopdf_build: tarball
    wkhtmltopdf_installation: source

  roles:
     - role: ansiblebit.wkhtmltopdf

For git:

- hosts: servers
  vars:
    git_version: 2.11.0
    wkhtmltopdf_build: git
    wkhtmltopdf_installation: source

  roles:
    - role: ansiblebit.git
    - role: ansiblebit.wkhtmltopdf

Tags

  • configuration: tasks related to configuration.
  • build: tasks related to building the software.
  • debug: tasks for debugging role variables.
  • validation: tasks for validating role variables.

Testing

To run the tests, you'll need to install:

To run all tests for the predefined OS/distributions and Ansible versions:

$ tox

To run tests for trusty64:

$ cd tests
$ bash test_idempotence.sh --box trusty64.vagrant.dev
# Log files will be saved under tests/log

To debug a specific environment:

$ cd tests
$ vagrant up trusty64.vagrant.dev

# Use the test.yml playbook for provisioning (as many times as needed)
$ vagrant provision trusty64.vagrant.dev

# Access the Vagrant box
$ vagrant ssh trusty64.vagrant.dev
Informazioni sul progetto

Ansible role to install wkhtmltopdf.

Installa
ansible-galaxy install ansiblebit.wkhtmltopdf
Licenza
bsd-3-clause
Download
750
Proprietario