1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_ranger.git synced 2024-08-16 14:19:48 +02:00
ansible_role_ranger/tasks/compile_ranger.yml

53 lines
1.3 KiB
YAML
Raw Normal View History

2020-01-29 13:58:23 +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
- 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 }}"
state: 'present'
2020-01-29 13:58:23 +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 }}"
target: 'install'
2020-01-29 13:58:23 +01:00
when: ansible_python_version[:1] == '3'
- name: Install python3
2020-01-29 13:58:23 +01:00
become: true
2021-03-12 23:59:59 +01:00
ansible.builtin.package:
name: 'python3'
state: 'present'
2020-03-04 23:00:16 +01:00
register: install_python3
2020-01-29 13:58:23 +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
- name: Install legacy-python f00
become: true
2021-03-12 23:59:59 +01:00
ansible.builtin.package:
name: "{{ item }}"
state: 'present'
loop:
- 'python'
- 'python-setuptools'
when: install_python3.failed
- 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