Usage

Check

class molecule.command.check.Check
molecule check

Target the default scenario.

molecule check --scenario-name foo

Targeting a specific scenario.

molecule --debug check

Executing with debug.

molecule --base-config base.yml check

Executing with a base-config.

molecule --env-file foo.yml check

Load an env file to read variables from when rendering molecule.yml.

Converge

Converge will execute the sequence necessary to converge the instances.

class molecule.command.converge.Converge
molecule converge

Target the default scenario.

molecule converge --scenario-name foo

Targeting a specific scenario.

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

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 --debug converge

Executing with debug.

molecule --base-config base.yml converge

Executing with a base-config.

molecule --env-file foo.yml converge

Load an env file to read variables from when rendering molecule.yml.

Create

class molecule.command.create.Create
molecule create

Target the default scenario.

molecule create --scenario-name foo

Targeting a specific scenario.

molecule create --driver-name foo

Targeting a specific driver.

molecule --debug create

Executing with debug.

molecule --base-config base.yml create

Executing with a base-config.

molecule --env-file foo.yml create

Load an env file to read variables from when rendering molecule.yml.

Dependency

class molecule.command.dependency.Dependency
molecule dependency

Target the default scenario.

molecule dependency --scenario-name foo

Targeting a specific scenario.

molecule --debug dependency

Executing with debug.

molecule --base-config base.yml dependency

Executing with a base-config.

molecule --env-file foo.yml dependency

Load an env file to read variables from when rendering molecule.yml.

Destroy

class molecule.command.destroy.Destroy
molecule destroy

Target the default scenario.

molecule destroy --scenario-name foo

Targeting a specific scenario.

molecule destroy --all

Target all scenarios.

molecule destroy --driver-name foo

Targeting a specific driver.

molecule --debug destroy

Executing with debug.

molecule --base-config base.yml destroy

Executing with a base-config.

molecule --env-file foo.yml destroy

Load an env file to read variables from when rendering molecule.yml.

Idempotence

class molecule.command.idempotence.Idempotence

Runs the converge step a second time. If no tasks will be marked as changed the scenario will be considered idempotent.

molecule idempotence

Target the default scenario.

molecule idempotence --scenario-name foo

Targeting a specific scenario.

molecule --debug idempotence

Executing with debug.

molecule --base-config base.yml idempotence

Executing with a base-config.

molecule --env-file foo.yml idempotence

Load an env file to read variables from when rendering molecule.yml.

Init

class molecule.command.init.role.Role
molecule init role --role-name foo

Initialize a new role.

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

Initialize a new scenario.

cd foo; molecule init scenario --scenario-name bar --role-name foo

Initialize an existing role with Molecule:

class molecule.command.init.template.Template
molecule init init template --url https://example.com/user/cookiecutter-repo

Initialize a new role from a Cookiecutter URL.

Lint

class molecule.command.lint.Lint
molecule lint

Target the default scenario.

molecule lint --scenario-name foo

Targeting a specific scenario.

molecule --debug lint

Executing with debug.

molecule --base-config base.yml lint

Executing with a base-config.

molecule --env-file foo.yml lint

Load an env file to read variables from when rendering molecule.yml.

List

class molecule.command.list.List
molecule list

Target the default scenario.

molecule list --scenario-name foo

Targeting a specific scenario.

molecule list --format plain

Machine readable plain text output.

molecule list --format yaml

Machine readable yaml output.

molecule --debug list

Executing with debug.

molecule --base-config base.yml list

Executing with a base-config.

molecule --env-file foo.yml list

Load an env file to read variables from when rendering molecule.yml.

Login

class molecule.command.login.Login
molecule login

Target the default scenario.

molecule login --scenario-name foo

Targeting a specific scenario.

molecule login --host hostname

Targeting a specific running host.

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

Targeting a specific running host and scenario.

molecule --debug login

Executing with debug.

molecule --base-config base.yml login

Executing with a base-config.

molecule --env-file foo.yml login

Load an env file to read variables from when rendering molecule.yml.

Prepare

class molecule.command.prepare.Prepare
molecule prepare

Target the default scenario.

molecule prepare --scenario-name foo

Targeting a specific scenario.

molecule prepare --driver-name foo

Targeting a specific driver.

molecule prepare --force

Force the execution fo the prepare playbook.

molecule --debug prepare

Executing with debug.

molecule --base-config base.yml prepare

Executing with a base-config.

molecule --env-file foo.yml prepare

Load an env file to read variables from when rendering molecule.yml.

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.

molecule side-effect

Target the default scenario.

molecule side-effect --scenario-name foo

Targeting a specific scenario.

molecule --debug side-effect

Executing with debug.

molecule --base-config base.yml side-effect

Executing with a base-config.

molecule --env-file foo.yml side-effect

Load an env file to read variables from when rendering molecule.yml.

Syntax

class molecule.command.syntax.Syntax
molecule syntax

Target the default scenario.

molecule syntax --scenario-name foo

Targeting a specific scenario.

molecule --debug syntax

Executing with debug.

molecule --base-config base.yml syntax

Executing with a base-config.

molecule --env-file foo.yml syntax

Load an env file to read variables from when rendering molecule.yml.

Test

Test will execute the sequence necessary to test the instances.

class molecule.command.test.Test
molecule test

Target the default scenario.

molecule test --scenario-name foo

Targeting a specific scenario.

molecule test --all

Target all scenarios.

molecule test --destroy=always

Always destroy instances at the conclusion of a Molecule run.

molecule --debug test

Executing with debug.

molecule --base-config base.yml test

Executing with a base-config.

molecule --env-file foo.yml test

Load an env file to read variables from when rendering molecule.yml.

Verify

class molecule.command.verify.Verify
molecule verify

Target the default scenario.

molecule verify --scenario-name foo

Targeting a specific scenario.

molecule --debug verify

Executing with debug.

molecule --base-config base.yml verify

Executing with a base-config.

molecule --env-file foo.yml verify

Load an env file to read variables from when rendering molecule.yml.