Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 2.81 KB

File metadata and controls

48 lines (34 loc) · 2.81 KB

Ansible Role: {{cookiecutter.role_name}}

  • Development branch: Build Status
  • Master branch: Build Status

{{cookiecutter.short_description}}

Using the role

Installation

ansible-galaxy install {{ cookiecutter.role_name }}

Example Playbook

  - hosts: all
    roles:
      - {{ cookiecutter.role_name }}

Variables

See defaults/main.yml.

Testing the role

Dependencies

Setup

  1. Install the necessary tools: test/scripts/before-install.sh
  2. Install required gems from inside the root of the project: test/scripts/install.sh
  3. Run lint checks and tests: test/scripts/test-role.sh

Note that after installing the required gems you can run other Test-kitchen commands besides the ones listed in test/scripts/test-role.sh.

Parallel test execution

There are two ways to run builds in parallel:

  1. Use the Travis-CI Build Matrix feature: uncomment the relevant environment variable in test/scripts/test-role.sh and whenever you add a new suite or platform, add all the relevant test instances to .travis.yml, in the env section. This has the advantage that for each instance you will have a separate build job, all part of the same build. Disadvantages are that you have to keep the env section updated every time you add a suite or a platform and that this solution is a Travis-CI-only feature. If you use another CI system in the future, you have to figure out how to configure that system to have parallel builds.
  2. Use the Test-Kitchen parallel build feature: builds are parallelized directly by Test-Kitchen: uncomment the relevant command switch in test/scripts/test-role.sh. You don't have to manage the env section in .travis.yml like the solution above but the stdout and stderr of each build will come unordered in the Travis-CI build output view, so it may be more difficult to check what went wrong. Also this solution is more portable compared to the previous one because it does not depend on the CI system, but only on Test-Kitchen.

Note that parallelization is disabled by default.