Git Product home page Git Product logo

tech_test's Introduction

tech_test

Tech task

  • Edit Nameservers form my domaine register ( take names from new host zone ) 

  • Setup new es2 instance with Nginx onboard

  • Forgot provision instance with python-minimal and ansible packeges 

    • Create new Security group
      • Open 22, 80, 443 ports
    • Assign e Tags to instance
    • I will provision Ubuntu box with Ansible playbook
    • With sample data 
  • Create new ssh pem file

  • Create new directory assign chmod 500 for directory

  • Assign 400 to pem file

  • “/Users/dmytrosymonenko/Desktop/mentoring/mentoring_Demo/jenkins/.ssh/tech_task.pem”

  • Edit inventory file for Ansible _ add IP and ssh key file

  • Provision with ansible “ ansible-playbook -i inventory simple_nginx.yml ”


“Ansible output ”

PLAY [Install nginx playbook] ******************************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************************* ok: [NGINX]

TASK [Install nginx from apt] ****************************************************************************************************************************** changed: [NGINX] => (item=[u'nginx', u'unzip', u'zip', u'htop'])

TASK [Check if nginx is up] ******************************************************************************************************************************* ok: [NGINX]

TASK [download Zabix agent] ********************************************************************************************************************************

changed: [NGINX]

TASK [install all.deb] ************************************************************************************************************************************* changed: [NGINX]

TASK [update_cahe] ***************************************************************************************************************************************** changed: [NGINX]

TASK [install latest zabix agent] ************************************************************************************************************************** changed: [NGINX]

TASK [templeate for zabbix-agent] ************************************************************************************************************************** changed: [NGINX]

TASK [Ensure zabbix is started and enabled] **************************************************************************************************************** changed: [NGINX]

RUNNING HANDLER [Restart zabbix-agent] ********************************************************************************************************************* changed: [NGINX]

TASK [copy content for Nginx] ****************************************************************************************************************************** changed: [NGINX]

TASK [Extract nginx_data.zip into /var/www/html] *********************************************************************************************************** changed: [NGINX]

PLAY RECAP ************************************************************************************************************************************************* NGINX : ok=12 changed=10 unreachable=0 failed=0

  • Ensure that everything is working
  • Assign A-addres Epam.tk to IP address
  • Create IMAGE from Primary node instance
  • Replicate them 2-ss
  • Assign all a-names 
  ———————————————————————————————————————

First part is ready

Prerequisites:

  • Create three A-records for the custom domain (like a.domain.com, b.domain.com, c.domain.com). If you don’t have one, please register free in pp.ua zone.
  • Point them to three EC2 instances: 2xEC2 should be running, 1xEC2 should be in stopped state.

Task definition:

Write a Shell/Python script using AWS SDK that will do the following:

  • Determinate the instance state using it’s DNS name (need at least 2 verifications, TCP and HTTP).
    • Wrote bash script with will get DNS name or IP and will check 22 tcp port and HTTP port
    • [x]
  • Create an AMI of the stopped EC2 instance, add descriptive tag based on the EC2 name along with the current date.
  • Terminate stopped EC2 after AMI creation.
  • Clean up AMIs older than 7 days for the specific availability zone, where terminated instance was running.
  • Print all instances in fine-grained output, INCLUDING terminated one, with highlighting their current state.

tech_test's People

Contributors

fikus0fin avatar

Watchers

James Cloos 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.