Skip to content

Commit

Permalink
add git 2.0.0 example
Browse files Browse the repository at this point in the history
  • Loading branch information
denglei committed Sep 4, 2014
1 parent 6d4d635 commit 825a2e7
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 0 deletions.
1 change: 1 addition & 0 deletions git_install_2.0.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
本文介绍使用ansible的playbook功能在centos或者redhat 6系列系统里安装2.0.0的git.
6 changes: 6 additions & 0 deletions git_install_2.0.0/git_delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- hosts: "{{host}}"
remote_user: "{{user}}"
gather_facts: True
roles:
- git_delete
7 changes: 7 additions & 0 deletions git_install_2.0.0/git_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- hosts: "{{host}}"
remote_user: "{{user}}"
gather_facts: True
roles:
- common
- git_install
2 changes: 2 additions & 0 deletions git_install_2.0.0/roles/common/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: restart ntpd
service: name=ntpd state=restarted
16 changes: 16 additions & 0 deletions git_install_2.0.0/roles/common/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
galaxy_info:
author: Deng Lei
description: Install initializtion Software
license: MIT
min_ansible_version: 1.6
platforms:
- name: CentOS
versions:
- 5
- 6
- name: Ubuntu
versions:
- precise
categories:
- system
dependencies: []
3 changes: 3 additions & 0 deletions git_install_2.0.0/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: Install initializtion require software
shell: yum -y install make cmake bc gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel nss_ldap openldap openldap-devel openldap-clients openldap-servers libxslt-devel libevent-devel ntp libtool-ltdl bison libtool vim-enhanced tar wget readline-devel libyaml-devel patch telnet dmidecode
poll: 0
12 changes: 12 additions & 0 deletions git_install_2.0.0/roles/git_delete/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
galaxy_info:
author: Deng Lei
description: Delete Git
license: MIT
min_ansible_version: 1.6
platforms:
- name: CentOS
versions:
- 6
categories:
- Service
dependencies: []
27 changes: 27 additions & 0 deletions git_install_2.0.0/roles/git_delete/tasks/delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: Delete Git Install Dir In RedHat Client
shell: rm -rf {{ git_dir}}/git-{{ git_version }}
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Delete Git Soft Link Script
shell: rm -rf /usr/bin/{{ item }}
with_items:
- git
- git-cvsserver
- gitk
- git-receive-pack
- git-shell
- git-upload-archive
- git-upload-pack
ignore_errors: yes
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Recovery Old Git Soft Link Script
shell: mv -f /usr/bin/{{ item }}_back /usr/bin/{{ item }}
with_items:
- git
- git-cvsserver
- gitk
- git-receive-pack
- git-shell
- git-upload-archive
- git-upload-pack
ignore_errors: yes
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
1 change: 1 addition & 0 deletions git_install_2.0.0/roles/git_delete/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- include: delete.yml
2 changes: 2 additions & 0 deletions git_install_2.0.0/roles/git_delete/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git_version: 2.0.0
git_dir: /usr/local
Binary file not shown.
12 changes: 12 additions & 0 deletions git_install_2.0.0/roles/git_install/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
galaxy_info:
author: Deng Lei
description: Install Git
license: MIT
min_ansible_version: 1.6
platforms:
- name: CentOS
versions:
- 6
categories:
- Service
dependencies: []
3 changes: 3 additions & 0 deletions git_install_2.0.0/roles/git_install/tasks/delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: Delete Git compression Software In Redhat Client
shell: rm -rf /tmp/git-{{ git_version }}.tar.gz
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
28 changes: 28 additions & 0 deletions git_install_2.0.0/roles/git_install/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- name: Copy Git Software To Redhat Client
copy: src=git-{{ git_version }}.tar.gz dest=/tmp/git-{{ git_version }}.tar.gz owner=root group=root
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Uncompression Git Software To Redhat Client
shell: tar zxf /tmp/git-{{ git_version }}.tar.gz -C {{ git_dir }}
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Delete Git Software Variable In Redhat Client
shell: cp -a -f /usr/bin/{{ item }} /usr/bin/{{ item }}_back
with_items:
- git
- git-cvsserver
- gitk
- git-receive-pack
- git-shell
- git-upload-archive
- git-upload-pack
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Copy Git Variable To Redhat Client
shell: ln -s -f {{ git_dir }}/git-{{ git_version }}/bin/{{ item }} /usr/bin/{{ item }}
with_items:
- git
- git-cvsserver
- gitk
- git-receive-pack
- git-shell
- git-upload-archive
- git-upload-pack
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
2 changes: 2 additions & 0 deletions git_install_2.0.0/roles/git_install/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- include: install.yml
- include: delete.yml
2 changes: 2 additions & 0 deletions git_install_2.0.0/roles/git_install/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git_version: 2.0.0
git_dir: /usr/local

0 comments on commit 825a2e7

Please sign in to comment.