Showing posts with label Ansible. Show all posts
Showing posts with label Ansible. Show all posts

Friday, 28 July 2017

Unknown

FOSSWave event in Coimbatore

What is FOSSWave?

WE ARE BUILDING A STRONG COMMUNITY

It's a place where you can learn, teach, enrich and be part of FOSS revolution!
It is an initiative to 
  • spread FOSS knowledge
  • connect with FOSS minded people across the globe
  • help students contribute to FOSS projects, tools, and technologies
  • Help students become industry ready.
In addition to sharing knowledge, FOSSWave speakers also take part in organizing events and speaking in conferences across the Globe.
The FOSSWave Community consists of active contributors from across the globe. It includes both paid employees and volunteers who work towards the goals set forth in the FOSS Revolution.

Special thanks to (in no particular order)

  • Premananth S: for helping us to grow, touch more lives and connecting us to KGISL
  • Sudharsan Rajendran: For being a wonderful host and making sure that the event went ahead smoothly. He put in a lot of hard work.
  • Prakash Mishra: or being an amazing co-speaker and traveling with me.
  • Super enthusiastic participants for getting involved in our talk and discussing FOSS with us.

     About the event

    I had stopped writing about the events I speak in..but this was different.
    A few days ago, I was invited by Prem to NASSCOM to give a brief talk on FOSS and trending technologies.
    Prem is doing a great job there by putting his effort in helping students from Tier2 and Tier3 cities. Around 20 of very enthusiastic students were selected and invited to Bengaluru to take part in such events. Mine was one of them. I planned to conduct a GitHub session after Intro to FOSS and brief about Fedora project.
    The event was very successful with amazing feedback.
    Just a picture with GitHub stickers that we distributed

    We (Sumantro, Prakash, and Smit) introduced FOSSWave to Prem and he loved the initiative.
    After few days Prakash and I got an invite to address few more super enthusiastic student in Coimbatore, Tamil Nadu. This workshop was for 2 days.
    We had suggested not to have more than 35-40 participants as I always prefer an interactive session rather than a talk where everyone gets bored.
    20 students were selected from KGISL and rest 15 from different colleges from all over Coimbatore.
    Everything from traveling to accommodations was sponsored by KGISL.
    We arrived Coimbatore at around 11 pm and Sudarshan was there to receive us. We were taken to a studio apartment which was full of all the facilities.
    Because of some other important tasks, I never got time to make slides[1] so I decided to do that. It took more time than expected as I was trying to avoid putting too much of complex and complicated stuff. 
    We got up at 5:30 as the event was from 9:30 and breakfast for us were arranged at 8:00. 
    The moment I stepped out of the apartment, I could feel the fresh unpolluted air. The weather was same as of Bengaluru's but a cleaner version. 

    Just a picture of a very huge college

    In the first session, we started with FOSS and It's philosophies and soon moved to Fedora project and 'How to contribute to Fedora QA'

    We covered the following topics during the time:
    1. FOSS and Fedora
      1. What is FOSS?
      2. Why FOSS?
      3. Getting industry-ready
    2. Discussions around diversity and contribution spectrum
      1. All FOSS projects are open-sourced: so contribute anywhere
      2. All contributors do not have to code; can be designers or can help in documenting
    3. How to start with FOSS
      1. Introduce yourself: let the world know who you are on mailing lists
      2. Every project has identity methods: Fedora has the Fedora Account System (FAS)
      3. What if you run into an issue? Use IRC!
    4. Fedora and contribution pathways
    5. start.fedoraproject.org
    6. apps.fedoraproject.org
    7. Fedora Docs
    8. Packaging (and using Bodhi)
    9. Fedora Magazine
    10. Recognition Model: Fedora Badges
    11. Creating Accounts (FAS, mailing lists, etc.)
    12. admin.fedoraproject.org
    13. For Fedora QA: all the people redirected to the QA mailing list
    14. Otherwise, shoot a mail to respective mailing list
    15. Freenode IRC webchat
    After this, we  gave participants a lunch break for 30 minutes and then started with GitHub

    Our talk covered some basics of Git and GitHub such as…
    1. What is version control?
    2. Need for a version control system
    3. Methods of version control
    4. What is the git, who developed it, and why you should use it?
    5. What is GitHub and why you should use it?
    6. Setting up and configuring git
    7. Stages of file tracking
    8. Creating a new organization and repository on GitHub
    9. Basic git commands: git status, git clone, git diff, git add, git commit, git push, etc.
    10. Hosting a static website on GitHub
    11. Forking and Cloning a project
    12. How to send PRs
    13. How to solve merge conflicts
    The event was until 6 pm in the evening. My plan to roam around couldn't be successful as I had no sleep last night and was very tired.

    *freshen up* *Dinner* and *sleep*
    But wait, I had to make Ansible slides :p
    Hopefully, I had my slides ready (from other events')

    The next day we started with SSH and Ansible
    We explained (with demo)
    1. Different terminologies
    2. What is SSH?
    3. Establish a passwordless ssh connection
    4. Introduction to Ansible
    5. Inventory files
    6. Introduction to Virtual Machines
    7. Some common modules like ping, command etc
    8. What are playbooks
    9. How to write playbooks
    And then, after question answer round, we wrapped up our session.
    It was a great workshop with the great audience and at a great place.
    We enjoyed our stay there :)

    [1]Slides' links




    Some photos from our trip: (If interested, click here)


    Read More

    Tuesday, 9 August 2016

    Unknown

    Ansible



    Ansible is the simplest way to deploy your applications on multiple remote machines. It works without any human interface that means it is agentless. Being a very intelligent automation system it is very easy to use.
    There are multiple other options available, mainly puppet and chef, but unlike Ansible they require additional packages to be installed on remote nodes.So after breaking the above, one can understand that Ansible is:


    1.      Agentless
    2.      Easy to use 
    3.      Intelligent automation system
    4.      Unlike other configuration management tools like puppet and chef, in Ansible there is no need of installing any additional packages on remote nodes.


    THINGS REQUIRED FOR IMPLEMENTATION:

        1. Basic knowledge of 'how to use vim'.
        2. The password-less connection between local and remote nodes.
    *To know how to establish 'Password-less connection between local and remote hosts' click here.
    *Python is required, but as in most Linux OS, python is already installed, you don't need to install it again.

    INSTALLING ANSIBLE:

    As mentioned above, we don't need to install anything on the remote machine, whatever we do, will be on localhost i.e the controller. (Remote machines will be called guests)
    in the controller, to install ansible, type

    #dnf install -y ansible

    INVENTORY FILE:

    It is a simple text file that stores the location of all the guests. You can manually add any number of guests you want. By default, it is stored in directory ' /etc/ansible/hosts' but you can change it to any directory you want.
    access it with vim.

    Type #vim /etc/ansible/hosts

    Go to the end of file and type your group name, in square brackets. Followed by that, type your guests IP addresses. Below is the example of it.

    [web-servers]
    192.168.99.
    192.168.99. 


    In the picture above, 192.168.56.101 and 192.168.56.101 are my guests. Note that you can any number of guests. Also, web-servers is my group name.
    *Before adding IP addresses, make sure you have established the password-less connection between the controller and all the guests.

    TESTING CONNECTION:

    Now you are ready to deploy the commands. Let's ping the guests and check if the [web-servers] is properly connected or not.

    Type #ansible -m ping web-servers in the controller to ping guests in web-servers.

    If everything is done, it will give results similar to the pic below:


    There are too many modules available that you can use for different operations. To know more about the modules, click here.
    As we have tested the connection, blog ends here. In next blog, we will see ansible in detail and learn about playbooks that can deploy multiple packages at once.

    In the end, I would like to thank Buvanesh (a Red Hat intern), who patiently taught me ansible, playbooks and a lot of other things.Here is his blog link. Thank you!
    Read More

    Monday, 8 August 2016

    Unknown

    PASSWORD-LESS CONNECTION USING SSH

                                                 
    This blog explains how to make passwordless connection in the remote computers using SSH for the beginners.


    What is SSH?

    It is an abbreviation for secure shell, a very common way to access remote Linux servers.It provides very strong authentication and encrypted data communication.

    I am using a VM to show how to connect local machine and remote machine in a very simple way.

    We need to open remote machine and get the IP address of it. Here I am using Fedora on both the remote and local machine.
    Let's install ssh before getting into it.
    We need to install server and clients ssh in both the machines.
    type  $ sudo dnf install -y openssh server and let it get installed.
    then type  $ sudo dnf install -y openssh clients .
    Now we are ready to follow the steps.

    1. Login to root user (in both the machines) to avoid prompting password.





    2. Get the IP address of the remote machine. You can get it using ' ip a '.





    3. Before using IP address to make the connection, we will have to enable and start sshd on both the machines.
     We can do this using command  # systemctl enable sshd 
     We are enabling sshd so that whenever we restart the machines, ssh starts automatically.

     And doing  so start sshd using similar command # systemctl start sshd 

     Just to be sure that it is working fine, you can check status using # systemctl status sshd  
     It should return the result as following.





    4. Now you are ready to make the connection. Just type # ssh root@<ip_address_of_remote>
    It will prompt you for remote's password. Enter it and your connection has been established.
    But to make the password-less connection we need to use the shh key. Once the connection is made using ssh   key, you won't require password to log in.

    To generate a ssh key, Type # ssh-keygen  in your local machine.





    5. Upload the generated key to remote machine using  # ssh-copy-id <ip_address_remote> 
    Now you are ready to establish the password-less connection. Just try to log in using 
    # ssh root@<ip_address_of_remote> and if you have followed the steps correctly,it won't prompt you for a password. MISSION SUCCESSFUL! 







    IN THE NEXT BLOG WE WILL LEARN ABOUT ANSIBLE AND WE WIL SEE HOW TO CONNECT MULTIPLE REMOTE MACHINES TO THE CONTROLLER AND ACCESS THEM ALL USING ONE COMMAND.



    Read More