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

56 lines
1.2 KiB
YAML
Raw Normal View History

2020-01-29 13:58:23 +01:00
---
- name: download ranger git repo
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
become: true
package:
name:
- make
- git
- vim
state: present
- name: Run 'install' target as root
become: yes
make:
2020-03-04 23:14:05 +01:00
chdir: "{{ ranger.download_directory }}"
2020-01-29 13:58:23 +01:00
target: install
when: ansible_python_version[:1] == '3'
- name: install python3
become: true
package:
name: python3
state: present
2020-03-04 23:00:16 +01:00
register: install_python3
ignore_errors: yes
2020-01-29 13:58:23 +01:00
- name: install ranger with python3
become: yes
command: python3 setup.py install --optimize=1
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
package:
name:
- python
- python-setuptools
state: present
when: install_python3.failed
2020-03-04 23:00:16 +01:00
- name: install ranger with legacy-python
become: yes
command: python setup.py install --optimize=1
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