2020-01-29 13:58:23 +01:00
|
|
|
---
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Download ranger git repo
|
2021-03-12 23:59:59 +01:00
|
|
|
ansible.builtin.git:
|
2020-03-04 23:14:05 +01:00
|
|
|
repo: "{{ ranger.repo }}"
|
|
|
|
dest: "{{ ranger.download_directory }}"
|
|
|
|
version: "{{ ranger.branch }}"
|
2020-01-29 13:58:23 +01:00
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Install build packages
|
2020-01-29 13:58:23 +01:00
|
|
|
become: true
|
2021-03-12 23:59:59 +01:00
|
|
|
ansible.builtin.package:
|
2021-09-28 01:13:31 +02:00
|
|
|
name: "{{ ranger__build_deps }}"
|
2023-10-29 15:09:27 +01:00
|
|
|
state: 'present'
|
2020-01-29 13:58:23 +01:00
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Run 'install' target as root # noqa: H1901
|
2021-03-12 23:59:59 +01:00
|
|
|
become: true
|
|
|
|
community.general.make:
|
2020-03-04 23:14:05 +01:00
|
|
|
chdir: "{{ ranger.download_directory }}"
|
2023-10-29 15:09:27 +01:00
|
|
|
target: 'install'
|
2020-01-29 13:58:23 +01:00
|
|
|
when: ansible_python_version[:1] == '3'
|
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Install python3
|
2020-01-29 13:58:23 +01:00
|
|
|
become: true
|
2021-03-12 23:59:59 +01:00
|
|
|
ansible.builtin.package:
|
2023-10-29 15:09:27 +01:00
|
|
|
name: 'python3'
|
|
|
|
state: 'present'
|
2020-03-04 23:00:16 +01:00
|
|
|
register: install_python3
|
2020-01-29 13:58:23 +01:00
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Install ranger with python3
|
2021-03-12 23:59:59 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.command: python3 setup.py install --optimize=1
|
2020-01-29 13:58:23 +01:00
|
|
|
args:
|
2020-03-04 23:14:05 +01:00
|
|
|
chdir: "{{ ranger.download_directory }}"
|
2020-01-29 13:58:23 +01:00
|
|
|
creates: '/usr/local/bin/ranger'
|
2020-03-04 23:00:16 +01:00
|
|
|
when: not install_python3.failed
|
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Install legacy-python f00
|
2020-05-16 21:16:24 +02:00
|
|
|
become: true
|
2021-03-12 23:59:59 +01:00
|
|
|
ansible.builtin.package:
|
2023-10-29 15:09:27 +01:00
|
|
|
name: "{{ item }}"
|
|
|
|
state: 'present'
|
|
|
|
loop:
|
|
|
|
- 'python'
|
|
|
|
- 'python-setuptools'
|
2020-05-16 21:16:24 +02:00
|
|
|
when: install_python3.failed
|
|
|
|
|
2023-10-29 15:09:27 +01:00
|
|
|
- name: Install ranger with legacy-python
|
2021-03-12 23:59:59 +01:00
|
|
|
become: true
|
|
|
|
ansible.builtin.command: python setup.py install --optimize=1
|
2020-03-04 23:00:16 +01:00
|
|
|
args:
|
2020-03-04 23:14:05 +01:00
|
|
|
chdir: "{{ ranger.download_directory }}"
|
2020-03-04 23:00:16 +01:00
|
|
|
creates: '/usr/local/bin/ranger'
|
|
|
|
when: install_python3.failed
|