Skip to content

A demo project to initialize a Docker environment with Ansible Molecule.

License

Notifications You must be signed in to change notification settings

christopherlouet/demo-molecule

Repository files navigation

demo-molecule

Build Status license

💡 About

A demo project to initialize a Docker environment with Ansible Molecule. The project is configured to use Docker as the driver for instance creation.

We deploy the components in Docker containers, demo_01 and demo_02:

  • demo_01: container created from a Rocky Linux Docker image
  • demo_02: container created from a Ubuntu Docker image

Images in the dockerfiles folder are configured to use systemd in Docker containers, so that services can be restarted.

🚧 Requirements

  • A Linux distribution
  • Docker

🔍 Usage

Usage run.sh [OPTIONS] [COMMAND]

Options:
  -h, --help                           Display help
  -l, --lint                           Analyzing the syntax of Ansible code
  -i, --install                        Installing Ansible dependencies
  -f, --force                          Remove Docker image before build
  -v, --verbose                        Make the command more talkative

💻 Examples of Ansible molecule commands

Use the provisioner to start the instances:

./run.sh molecule create

Use the provisioner to configure instances and deploy components:

./run.sh molecule converge

In a browser, you can check that the components are properly deployed:

Run automated tests against instances:

./run.sh molecule verify

Run a full test sequence:

./run.sh molecule test

Use the provisioner to destroy the instances:

./run.sh molecule destroy

Analysis of code, installing dependencies and start the instances:

./run.sh -v -l -i molecule create

👽 Miscellaneous

Launch Ansible code analysis:

./run.sh --lint

Installing Ansible roles and collections:

./run.sh --install

📜 License

Distributed under the MIT License.

About

A demo project to initialize a Docker environment with Ansible Molecule.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published