mirror of
https://github.com/roles-ansible/ansible_role_ranger.git
synced 2024-08-16 14:19:48 +02:00
compile ranger if needed
This commit is contained in:
parent
323745be4c
commit
c4780cf518
3 changed files with 50 additions and 0 deletions
|
@ -1,2 +1,6 @@
|
||||||
---
|
---
|
||||||
submodules_versioncheck: true
|
submodules_versioncheck: true
|
||||||
|
|
||||||
|
ranger_repo: 'https://github.com/ranger/ranger.git'
|
||||||
|
ranger_branch: 'master'
|
||||||
|
ranger_download_directory: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads/ranger') }}"
|
||||||
|
|
35
tasks/compile_ranger.yml
Normal file
35
tasks/compile_ranger.yml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
- name: download ranger git repo
|
||||||
|
git:
|
||||||
|
repo: "{{ ranger_repo }}"
|
||||||
|
dest: "{{ ranger_download_directory }}"
|
||||||
|
version: "{{ ranger_branch }}"
|
||||||
|
|
||||||
|
- name: install build packages
|
||||||
|
become: true
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- make
|
||||||
|
- git
|
||||||
|
- vim
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Run 'install' target as root
|
||||||
|
become: yes
|
||||||
|
make:
|
||||||
|
chdir: "{{ ranger_download_directory }}"
|
||||||
|
target: install
|
||||||
|
when: ansible_python_version[:1] == '3'
|
||||||
|
|
||||||
|
- name: install python3
|
||||||
|
become: true
|
||||||
|
package:
|
||||||
|
name: python3
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: install ranger with python3
|
||||||
|
become: yes
|
||||||
|
command: python3 setup.py install --optimize=1
|
||||||
|
args:
|
||||||
|
chdir: "{{ ranger_download_directory }}"
|
||||||
|
creates: '/usr/local/bin/ranger'
|
|
@ -2,3 +2,14 @@
|
||||||
- include_tasks: versioncheck.yml
|
- include_tasks: versioncheck.yml
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
|
- name: install ranger
|
||||||
|
become: yes
|
||||||
|
package:
|
||||||
|
name: ranger
|
||||||
|
state: present
|
||||||
|
register: install_ranger
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- include_tasks: compile_ranger.yml
|
||||||
|
when: install_ranger.failed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue