abn / molecule-common-resources

Common resources for molecule scenarios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Molecule: Common Resources for Scenarios

This repository provides commonly used resources for molecule test scenarios. Initial development was based on work done for the test suite used by the Molecule Project itself.

Usage Examples

Git Submodule

Initialisation

Resources can be consumed as a submodule within your project's molecule directory. This can be done as shown below.

# assuming you are currently within your project directory
git submodule add https://github.com/abn/molecule-common-resources.git ./molecule/resources
git commit -m "git: add molecule-common-resources submodule"

Once this is done you can, within a scenario's molecule.yml file refer to a resource.

provisioner:
  name: ansible
  playbooks:
    create: ../resources/playbooks/docker/create.yml
    prepare: prepare.yml
    destroy: ../resources/playbooks/docker/destroy.yml
  lint:
    name: ansible-lint

Update

In order to consume an updated version of the resources in your project, you will have to update the submodule commit. You can do this using the update sub-command.

git submodule update --remote
git add ./molecule/resources
git commit -m "update common resources"

About

Common resources for molecule scenarios

License:Apache License 2.0