Code Monkey home page Code Monkey logo

ansible-lab's Introduction

Ansible Lab

Requirements

  • Python 3.x
  • Python 3 Pip (sudo apt install python3-pip)
  • Ansible 5.x (sudo pip3 install ansible)
  • It's better to have Ubuntu or other Debian-based linux (for other linux distros you will need to modify package installation commands)
  • Template works on localhost, but you can do it remotely on a server that is available through SSH by modifying inventory (remote group) and site.yml (host variable)

Before tasks

If you have GitLab account

Fork this project by clicking https://gitlab.com/DmyMi/ansible-lab/-/forks/new

If you have GitHub account

Follow this article https://nira.com/how-to-migrate-from-gitlab-to-github/ to copy the project to your Github.

Doing the lab requires you to know how to use Git :)

Tasks

Write an Ansible playbook using the template in site.yml.

The playbook itself is an Ansible version of Lab 1 with extra steps :)

  1. The playbook should use the packages, aptcachetime, app_dir, app_file variables defined in all vars file.
  2. Playbook should use the app.service.j2 that you need to write. Use the app_dir, app_file variables to specify the path to Java app. Use the app_port variable to specifyt the PORT environment variable for Java app.
    • If you have created additional users for Lab1 - add the user creation to site.yml with the help of user module.
  3. Playbook should use the nginx.conf.j2 template with a simple Nginx config. There you should write the server block to let Nginx listen on port 80. Nginx should proxy all requests to Java app at localhost:<SOME_PORT>. Target port should be specified dynamically using the app_port variable.

To run the playbook if it's written correctly:

# If you have paswordless SUDO
ansible-playbook site.yml
# or if you have password SUDO
ansible-playbook site.yml -K

Cleanup

The cleanup.yml playbook can be used to remove everything from you server/vm (if you followed the template and did not add additional packages).

# If you have paswordless SUDO
ansible-playbook cleanup.yml
# or if you have password SUDO
ansible-playbook cleanup.yml -K

Submission

All i need is a link to your Github/Gitlab project in Classroom.

ansible-lab's People

Contributors

dmymi avatar olegmak02 avatar

Watchers

 avatar

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.