Giter Club home page Giter Club logo

ansible-katas's Introduction

Repo banner

In this repository you will find free hands-on exercises that you repeat as many times as you like. Their intended purpose is to teach you the basics of Ansible, as well as some best practices once you've mastered the fundamentals.

There is an associated workshop available for this material. Reach out to Verifa at verifa.io for more information!


Dependencies

Running these exercises requires you to have Docker and docker-compose installed.

Getting started

  1. Clone the repository
  2. Navigate to the directory of the exercise you want to run
  3. Run the setup.sh script inside of the exercise directory:
./setup.sh

The initial run might take a few minutes, but subsequent runs will be faster.

You will now be inside the training environment workspace, ready to go!

Usage

In each exercise directory you will find a README.md file, a setup.sh script, and a workspace directory.

README.md

The README.md file contains the exercise itself, covering steps, explanations, and examples.

setup.sh

The setup.sh script should be run before every exercise. It spins up the environment for the current exercise, as well as cleaning up any previous environments. When complete, it will put you inside the exercise workspace in the training environment, and you can start your exercise.

Workspace

The workspace directory acts as a link between your training environment and local computer. Anything created inside the workspace in the training environment will also be created in the directory on your machine, and vice versa. This allows you to easily open and edit files in the workspace in your preferred editor.


Contact

This project is open source, any feedback is welcome in the form of GitHub issues.

For any questions regarding a full training workshop on Ansible for your company or team, contact Verifa at verifa.io

ansible-katas's People

Contributors

spektrum1 avatar mvainio-verifa avatar praqma-thi avatar

Stargazers

 avatar  avatar

Watchers

Laroy Sjödahl avatar  avatar

ansible-katas's Issues

Consistent file endings on playbooks

Some playbooks miss an empty newline at the end of the file, making them unsightly to cat.
Some also have random trailing whitespace. Install the trailing whitespace VSCode plugin already, Laroy, I told you this before. 😮‍💨

Post workshop cleanup script

Should we provide a full post exercises cleanup script? Trivial to implement, mainly a question of clutter and possible confusion in the repo, whether students would think you need to run it every time in between exercises, which is not true.

Have README available inside workspace

Once you spin up an exercise and you're inside your workspace container, it'd be nice to have the exercise README available in there as well for convenience.

Stop setup script execution on error

Exercise setup scripts currently continue when an error occurs. (In my case lacking docker-compose.)
It'd be nice if the setup scripts stop when something's wrong. (Was it -e?)

General feedback

YAML file extension consistency
.yaml or .yml, it doesn't matter, but pick one and stick to it. ;3

./utils/docker-compose.yml
./utils/docker-compose-multiple-hosts.yml
./4-roles/workspace/playbook-post-roles.yml
./4-roles/workspace/playbook-pre-roles.yml
./3-define-an-inventory-file/workspace/playbook.yaml
./2-install-cowsay-the-right-way/workspace/playbook.yaml
./1-my-first-playbook/workspace/playbook.yaml
./5-use-a-collection/workspace/playbook.yml

Exercise 1 feedback

Assume cowsay is added to path

/usr/games/cowsay hewwo

    - name: Say something
      shell: |
        cowsay hewwo
      register: out
    - debug: var=out.stdout_lines

Prevents playbook from blowing up: "stderr_lines": ["/bin/sh: 1: usr/games/cowsay: not found"]
Naturally, this applies to following katas as well.

EDIT: I noticed you can run into issues here when playbooks specify become: true -- but maybe we should look into why we're becoming root in all these exercises?

Issue guideline for first feedback round

We currently have a technical training environment draft, and an initial design drafts (and in some cases full initial drafts) for what I would call the "introduction-to" part of the katas. Our design philosophy when making these was that

  1. they should hopefully flow together nicely.
  2. they should focus more on teaching the basics, perhaps at the expense of best practices if the best practices means a bit too much for the student at one time.

What we would love in terms of feedback here:

  1. Test the technical training environment and give any feedback you can think of.
  2. Do you think the step by step outline that exists in a exercise readme will be a good exercise once developed? if not, why?
  3. Do you have any other ideas for exercises in the "introduction-to" part that you feel we have missed?

Setup feedback

You can check if running_compose exists before tearing it down. Prevents some noise in the logs
utils/setup.sh

if [ -f running_compose ]; then
    docker-compose -f $(cat running_compose) -p ansible_katas down
fi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.