Command Line Reference¶
Check¶
-
class
molecule.command.check.Check¶ Check Command Class.
-
moleculecheck¶ Target the default scenario.
-
moleculecheck --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.
-
moleculecheck --parallel¶ Run in parallelizable mode.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Clean Up¶
-
class
molecule.command.cleanup.Cleanup¶ Cleanup Command Class.
This action has cleanup and is not enabled by default. See the provisioner’s documentation for further details.
-
moleculecleanup¶ Target the default scenario.
-
moleculecleanup --scenario-name foo¶ Targeting a specific scenario.
-
molecule--debug cleanup¶ Executing with debug.
-
molecule--base-config base.yml cleanup¶ Executing with a base-config.
-
molecule--env-file foo.yml cleanup¶ Load an env file to read variables when rendering molecule.yml.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Converge¶
Converge will execute the sequence necessary to converge the instances.
-
class
molecule.command.converge.Converge¶ Converge Command Class.
-
moleculeconverge¶ Target the default scenario.
-
moleculeconverge --scenario-name foo¶ Targeting a specific scenario.
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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Create¶
-
class
molecule.command.create.Create¶ Create Command Class.
-
moleculecreate¶ Target the default scenario.
-
moleculecreate --scenario-name foo¶ Targeting a specific scenario.
-
moleculecreate --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Dependency¶
-
class
molecule.command.dependency.Dependency¶ Dependency Command Class.
-
moleculedependency¶ Target the default scenario.
-
moleculedependency --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Destroy¶
-
class
molecule.command.destroy.Destroy¶ Destroy Command Class.
-
moleculedestroy¶ Target the default scenario.
-
moleculedestroy --scenario-name foo¶ Targeting a specific scenario.
-
moleculedestroy --all¶ Target all scenarios.
-
moleculedestroy --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.
-
moleculedestroy --parallel¶ Run in parallelizable mode.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
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.
-
moleculeidempotence¶ Target the default scenario.
-
moleculeidempotence --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Init¶
-
class
molecule.command.init.role.Role¶ Init Role Command Class.
-
moleculeinit role foo¶ Initialize a new role.
Initialize a new role using ansible-galaxy and include default molecule directory. Please refer to the
init scenariocommand in order to generate a custommoleculescenario.
Construct Role.
-
-
class
molecule.command.init.scenario.Scenario¶ Scenario Class.
-
moleculeinit scenario bar --role-name foo¶ Initialize a new scenario. In order to customise the role, please refer to the init role command.
-
cdfoo; molecule init scenario bar --role-name foo¶ Initialize an existing role with Molecule:
-
cdfoo; molecule init scenario bar --role-name foo¶ Initialize a new scenario using a local cookiecutter template for the driver configuration.
Construct Scenario.
-
Lint¶
-
class
molecule.command.lint.Lint¶ Lint command executes external linters.
You need to remember to install those linters. For convenience, there is a package extra that installs the most common ones, use it like
python3 -m pip install "molecule[lint]".-
moleculelint¶ Target the default scenario.
-
moleculelint --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
List¶
-
class
molecule.command.list.List¶ List command shows information about current scenarios.
-
moleculelist¶ Target the default scenario.
-
moleculelist --scenario-name foo¶ Targeting a specific scenario.
-
moleculelist --format plain¶ Machine readable plain text output.
-
moleculelist --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Login¶
-
class
molecule.command.login.Login¶ Login Command Class.
-
moleculelogin¶ Target the default scenario.
-
moleculelogin --scenario-name foo¶ Targeting a specific scenario.
-
moleculelogin --host hostname¶ Targeting a specific running host.
-
moleculelogin --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.
Construct Login.
-
Matrix¶
Matrix will display the subcommand’s ordered list of actions, which can be changed in scenario configuration.
-
class
molecule.command.matrix.Matrix¶ Matric Command Class.
-
moleculematrix subcommand¶ Target the default scenario.
-
moleculematrix --scenario-name foo subcommand¶ Targeting a specific scenario.
-
molecule--debug matrix subcommand¶ Executing with debug.
-
molecule--base-config base.yml matrix subcommand¶ Executing with a base-config.
-
molecule--env-file foo.yml matrix subcommand¶ Load an env file to read variables from when rendering molecule.yml.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Prepare¶
-
class
molecule.command.prepare.Prepare¶ This action is for the purpose of preparing a molecule managed instance before the
molecule.command.converge.Convergeaction is run.Tasks contained within the
prepare.ymlplaybook in the scenario directory will be run remotely on the managed instance. This action is run only once per test sequence.-
moleculeprepare¶ Target the default scenario.
-
moleculeprepare --scenario-name foo¶ Targeting a specific scenario.
-
moleculeprepare --driver-name foo¶ Targeting a specific driver.
-
moleculeprepare --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
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.
-
moleculeside-effect¶ Target the default scenario.
-
moleculeside-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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Syntax¶
-
class
molecule.command.syntax.Syntax¶ Syntax Command Class.
-
moleculesyntax¶ Target the default scenario.
-
moleculesyntax --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Test¶
Test will execute the sequence necessary to test the instances.
-
class
molecule.command.test.Test¶ Test Command Class.
-
moleculetest¶ Target the default scenario.
-
moleculetest --scenario-name foo¶ Targeting a specific scenario.
-
moleculetest --all¶ Target all scenarios.
-
moleculetest --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.
-
moleculetest --parallel¶ Run in parallelizable mode.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-
Verify¶
-
class
molecule.command.verify.Verify¶ Verify Command Class.
-
moleculeverify¶ Target the default scenario.
-
moleculeverify --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.
Initialize code for all command classes.
- Parameters
c – An instance of a Molecule config.
- Returns
None
-