Blagovest Petrov
2 years ago
3 changed files with 78 additions and 15 deletions
@ -1,18 +1,51 @@ |
|||
--- |
|||
# tasks file for ansible-rhel4 |
|||
|
|||
- name: "Remove 'redhat-lsb' package (BUG: https://bugs.centos.org/view.php?id=1547)" |
|||
ansible.builtin.raw: "rpm -e redhat-lsb || exit 0" |
|||
|
|||
- name: Install development tools |
|||
ansible.builtin.raw: yum -y groupinstall "Development tools" |
|||
ansible.builtin.raw: "/usr/bin/yum -y groupinstall \"Development Tools\"" |
|||
|
|||
- name: Install dev dependencies |
|||
ansible.builtin.raw: "yum -y install {{ ansible_rhel4_dev_dependencies }}" |
|||
ansible.builtin.raw: "/usr/bin/yum -y install {{ item }}" |
|||
loop: "{{ ansible_rhel4_dev_dependencies }}" |
|||
|
|||
- name: Download Python |
|||
ansible.builtin.raw: wget --no-check-certificate https://www.python.org/ftp/python/{{ ansible_rhel4_python_version }}/Python-2.7.18.tgz -O /tmp/Python2.7.tgz |
|||
- name: Download Python locally. EL4 doesn't support modern SSL |
|||
ansible.builtin.get_url: |
|||
url: "https://www.python.org/ftp/python/{{ ansible_rhel4_python_version }}/Python-{{ ansible_rhel4_python_version }}.tgz" |
|||
dest: "{{ role_path }}/files/Python2.7.tgz" |
|||
delegate_to: 127.0.0.1 |
|||
|
|||
- name: Copy Python 2.7 to the server{ |
|||
local_action: "command scp {{ role_path }}/files/Python2.7.tgz {{ ansible_user }}@{{ ansible_host }}:/tmp/" |
|||
|
|||
- name: Extract Python source |
|||
ansible.builtin.raw: tar -xvzf /tmp/Python2.7.tgz -C /opt/ |
|||
ansible.builtin.raw: tar -xvzf /tmp/Python2.7.tgz -C /tmp/ |
|||
|
|||
- name: Make install directory for Python 2.7 |
|||
ansible.builtin.raw: mkdir /opt/python2.7 || exit 0 |
|||
|
|||
- name: Execute Configure script for Python |
|||
ansible.builtin.raw: "cd /tmp/Python-{{ ansible_rhel4_python_version }} && ./configure --prefix=/opt/python2.7 --enable-shared" |
|||
|
|||
- name: Make |
|||
ansible.builtin.raw: "cd /tmp/Python-{{ ansible_rhel4_python_version }} && make" |
|||
|
|||
- name: Make altinstall |
|||
ansible.builtin.raw: "cd /tmp/Python-{{ ansible_rhel4_python_version }} && make altinstall" |
|||
|
|||
# - name: Add Python to PATH |
|||
# ansible.builtin.raw: echo "export PATH=$PATH:/opt/python2.7/bin" >> /etc/profile |
|||
|
|||
# - name: Add Python to LD_LIBRARY_PATH |
|||
# ansible.builtin.raw: echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python2.7/lib" >> /etc/profile |
|||
|
|||
- name: Create ldconfig conf for Python 2.7 |
|||
ansible.builtin.raw: echo /opt/python2.7/lib >> /etc/ld.so.conf.d/python27.conf |
|||
|
|||
- name: Run ldconfig |
|||
ansible.builtin.raw: ldconfig |
|||
|
|||
- name: Remove Python source archive |
|||
ansible.builtin.raw: rm-rf /tmp/Python2.7.tgz |
|||
- name: Test ansible on the host |
|||
ansible.builtin.ping: |
|||
|
Loading…
Reference in new issue