Skip to content

Running the mario bros game in a container using ansible and podman

Notifications You must be signed in to change notification settings

darrenlavery91/Mario-in-podman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Mario-in-Podman: Ansible Playbooks for Managing the Mario Brothers Container

Uploading Screenshot 2024-01-10 at 10.57.30.png…

This repository provides Ansible playbooks for managing the deployment of the Mario Brothers game container using Podman.

Usage:

Playbook: Starting Mario Brothers Container

- hosts: localhost
  collections:
    - containers.podman
  tasks:
    - name: Entering Mario Land
      containers.podman.podman_container:
        name: mario_game
        image: "docker.io/kaminskypavel/mario:latest"
        state: started
        ports: "4545:8080"
      register: mario

    - debug:
        msg: "Go down the tube here: http://127.0.0.1:4545"
      when: mario.container.State.ExitCode == 0

    - debug:
        msg: "Tube is blocked"
      when: mario.container.State.ExitCode == 1

Usage:

  1. Install Ansible:

    • Linux (Red Hat):

      sudo yum install -y ansible
    • Mac (via Brew):

      brew install ansible
  2. Create the directory in your user space:

    mkdir -p ~/ansible/
    cd ~/ansible
  3. Create the ansible.cfg file:

    vim ansible.cfg

    Add the following configuration and save:

    [defaults]
    inventory=./inventory
  4. Create the inventory file:

    vim inventory

    Add the following, replacing your-local-ip with your actual local IP:

    [localhost]
    your-local-ip ansible_connection=local

    Example:

    [localhost]
    192.168.101.214 ansible_connection=local
  5. Run ansible --version to verify if the configuration file has been picked up.

  6. Install Podman:

    • Red Hat (RHEL):

      sudo yum install -y podman
    • Mac (via Brew):

      brew install podman
  7. Run the Ansible playbook to start the Mario Brothers container:

    ansible-playbook mario_pod.yml
  8. After successful execution, access Mario Land through the provided URL.

  9. Run the Ansible playbook to stop and remove the Mario Brothers container:

    ansible-playbook mario-pod-rm.yml

Note:

  • Customize the playbooks according to your specific requirements.
  • Ensure proper network configurations and permissions for successful execution.
  • A big thank you to kaminskypavel for providing the Mario Brothers container image.

About

Running the mario bros game in a container using ansible and podman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published