Tag Archives: git

Setup Ansible latest version

Download ansible from git:

1
2
3
cd /opt/
git clone https://github.com/ansible/ansible.git
cd ansible

Download all necessary modules:

1
2
3
4
git submodule update --init lib/ansible/modules/core
git submodule update --init lib/ansible/modules/extras
git submodule update --init v1/ansible/modules/core
git submodule update --init v1/ansible/modules/extras

add ansible's path to PATH (I use it from root):

1
2
echo 'export PATH=/opt/ansible/bin:$PATH' >> ~/.bashrc
echo 'export PYTHONPATH=/opt/ansible/lib' >> ~/.bashrc

reload .bashrc and after check ansible version command:

1
ansible --version

if you see that there is no some modules:

1
pip install <module name>

output should looks similar to:

1
2
3
4
5
6
7
ansible --version
ansible 2.0.0 (devel 2c9d1257ba) last updated 2015/07/06 12:42:09 (GMT +300)
  lib/ansible/modules/core: (detached HEAD ff69ce7912) last updated 2015/07/06 12:53:13 (GMT +300)
  lib/ansible/modules/extras: (detached HEAD 4e48ef9eca) last updated 2015/07/06 12:53:21 (GMT +300)
  v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/07/06 12:53:27 (GMT +300)
  v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/07/06 12:53:33 (GMT +300)
  configured module search path = /usr/share/ansible

git: general commands

git init // initialize new repository
git remote add origin ssh://username@domain.tld/path/to/git/project.git
git add . //add all files in this folder to repository
git commit -a -m 'commit description' // make commit
git checkout -b new // create new branch
git checkout master // use master branch
git push // send changes to repository
git pull // take changes from repository
git reset --hard COMMIT // reset to COMMIT
git reset --hard HEAD // reset to last commit
git reset --hard HEAD-1 // reset to one from last
git merge new // if you in another branch will merge change in new for current branch
git reflog // list of last commits
git log // git logs
git show COMMIT // list of change in commit
git clone ssh://username@domain.tld/path/to/git/repository