Usage

Check

class molecule.command.check.Check

Target the default scenario:

>>> molecule check

Targeting a specific scenario:

>>> molecule check --scenario-name foo

Executing with debug:

>>> molecule --debug check

Converge

Converge will execute the sequence necessary to converge the instances.

class molecule.command.converge.Converge

Target the default scenario:

>>> molecule converge

Targeting a specific scenario:

>>> molecule converge --scenario-name foo

Providing additional command line arguments to the ansible-playbook command. Use this option with care, as there is no sanitation or validation of input. Options passed on the CLI override options provided in provisioner’s options section of molecule.yml.

>>> molecule converge -- -vvv -tags foo,bar

Executing with debug:

>>> molecule --debug converge

Create

class molecule.command.create.Create

Target the default scenario:

>>> molecule create

Targeting a specific scenario:

>>> molecule create --scenario-name foo

Targeting a specific driver:

>>> molecule converge --driver-name foo

Executing with debug:

>>> molecule --debug create

Dependency

class molecule.command.dependency.Dependency

Target the default scenario:

>>> molecule dependency

Targeting a specific scenario:

>>> molecule dependency --scenario-name foo

Executing with debug:

>>> molecule --debug dependency

Destroy

class molecule.command.destroy.Destroy

Target the default scenario:

>>> molecule destroy

Target all scenarios:

>>> molecule destroy --all

Targeting a specific scenario:

>>> molecule destroy --scenario-name foo

Targeting a specific driver:

>>> molecule converge --driver-name foo

Executing with debug:

>>> molecule --debug destroy

Idempotence

class molecule.command.idempotence.Idempotence

Target the default scenario:

>>> molecule idempotence

Targeting a specific scenario:

>>> molecule idempotence --scenario-name foo

Executing with debug:

>>> molecule --debug idempotence

Init

class molecule.command.init.role.Role

Initialize a new role:

>>> molecule init role --role-name foo
class molecule.command.init.scenario.Scenario

Initialize a new scenario:

>>> molecule init scenario --scenario-name default --role-name foo

Initialize an existing role with Molecule:

>>> molecule init scenario --scenario-name default --role-name foo
class molecule.command.init.template.Template

Initialize a new role from a Cookiecutter URL:

>>> molecule init template --url https://example.com/user/cookiecutter-repo

Lint

class molecule.command.lint.Lint

Target the default scenario:

>>> molecule lint

Targeting a specific scenario:

>>> molecule lint --scenario-name foo

Executing with debug:

>>> molecule --debug lint

List

class molecule.command.list.List

Target all scenarios:

>>> molecule list

Targeting a specific scenario:

>>> molecule list --scenario-name foo

Machine readable output:

>>> molecule list --format plain
>>> molecule list --format yaml

Executing with debug:

>>> molecule --debug list

Login

class molecule.command.login.Login

Targeting the only running host:

>>> molecule login

Targeting a specific running host:

>>> molecule login --host hostname

Targeting a specific running host and scenario:

>>> molecule login --host hostname --scenario-name foo

Executing with debug:

>>> molecule --debug login

Prepare

class molecule.command.prepare.Prepare

Target the default scenario:

>>> molecule prepare

Targeting a specific scenario:

>>> molecule prepare --scenario-name foo

Targeting a specific driver:

>>> molecule prepare --driver-name foo

Force the execution fo the prepare playbook:

>>> molecule prepare --force

Executing with debug:

>>> molecule --debug prepare

Side Effect

class molecule.command.side_effect.SideEffect

This action has side effects and not enabled by default. See the provisioners documentation for further details.

Target the default scenario:

>>> molecule side-effect

Targeting a specific scenario:

>>> molecule side-effect --scenario-name foo

Executing with debug:

>>> molecule --debug side-effect

Syntax

class molecule.command.syntax.Syntax

Target the default scenario:

>>> molecule syntax

Targeting a specific scenario:

>>> molecule syntax --scenario-name foo

Executing with debug:

>>> molecule --debug syntax

Test

Test will execute the sequence necessary to test the instances.

class molecule.command.test.Test

Target the default scenario:

>>> molecule test

Target all scenarios:

>>> molecule test --all

Targeting a specific scenario:

>>> molecule test --scenario-name foo

Targeting a specific driver:

>>> molecule test --driver-name foo

Executing with debug:

>>> molecule --debug test

Always destroy instances at the conclusion of a Molecule run:

>>> molecule test --destroy=always

Verify

class molecule.command.verify.Verify

Target the default scenario:

>>> molecule verify

Targeting a specific scenario:

>>> molecule verify --scenario-name foo

Executing with debug:

>>> molecule --debug verify