Lab 1 - Solution """""""""""""""" Mandatory ========= Check the infrastructure ------------------------ * Login on ``srv..lab`` as ``ansible`` user * check the ansible version (2.x) * try to connect to the other servers via ssh and accept the ssh host keys * ``web1..lab`` * ``web2..lab`` * ``db..lab`` .. code-block:: bash ansible --version ssh web1..lab ssh web2..lab ssh db..lab Git Installation ---------------- * Connect to your ``srv..lab`` as ``ansible`` user * Switch to ``root`` via ``sudo`` * Install ``git`` .. code-block:: bash ssh -l ansible srv.firstname.lab sudo su - apt-get install git Create a git repo ----------------- * as ``ansible`` user * create a local git repo in ``/home/ansible/training`` * create a file e.g ``README.md`` and add it to your git repo * make your first git commit * check the log .. code-block:: bash mkdir /home/ansible/training cd /home/ansible/training git init vi README.md git status git add README.md git commit -m 'first commit' git log Optional ======== Checkout a public repository ---------------------------- * switch into the ``/tmp`` directory * clone the git remote repo (https://github.com/pstauffer/pstauffer.github.io.git) * change the ``README.md`` file * look at the differences .. code-block:: bash cd /tmp # clone repo git clone https://github.com/pstauffer/pstauffer.github.io.git # edit readme vi README.md # print out the working tree status git status # print out the differences of the readme git diff README.md