Skip to content

Commit

Permalink
add python path script
Browse files Browse the repository at this point in the history
  • Loading branch information
denglei committed Sep 5, 2014
1 parent 550c3f0 commit c79bc71
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python_install_2.7.8/roles/python_delete/tasks/delete.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Delete Python Install Dir In RedHat Client
shell: rm -rf {{ python_dir}}/ruby-{{ python_version }}
shell: rm -rf {{ python_dir}}/ruby-{{ python_version }} /etc/profile.d/python-{{ python_version }}.sh
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Recovery Old Python Soft Link Script
shell: mv -f /usr/bin/{{ item }}_back /usr/bin/{{ item }}
Expand Down
6 changes: 6 additions & 0 deletions python_install_2.7.8/roles/python_install/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
- name: Modify Yum Variables To Redhat Client
shell: sed -i 's@#!/usr/bin/python.*@#!/usr/bin/python{{ ansible_python_version[:-2] }}@' /usr/bin/yum
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Copy Python Path Script To Redhat Client
template: src=python.sh dest=/etc/profile.d/python-{{ python_version }}.sh
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
- name: Run Python Path Script To Redhat Client
shell: source /etc/profile.d/python-{{ python_version }}.sh
when: ansible_os_family == "RedHat" and ansible_distribution_version|int >=6
2 changes: 2 additions & 0 deletions python_install_2.7.8/roles/python_install/templates/python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PATH=${PATH}:{{ python_dir }}/python-{{ python_version }}/bin/
export PYTHONPATH

0 comments on commit c79bc71

Please sign in to comment.