Split tasks, try to install kitty-terminfo
This commit is contained in:
parent
7c2a9ff252
commit
976a12bd40
|
@ -1,20 +1,4 @@
|
|||
---
|
||||
- name: Create tempdir
|
||||
tempfile:
|
||||
state: directory
|
||||
register: kitty_tempdir
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
|
||||
|
||||
- name: Download actuel kitty terminfo
|
||||
get_url:
|
||||
url: "https://github.com/kovidgoyal/kitty/blob/master/terminfo/x/xterm-kitty?raw=true"
|
||||
dest: "{{ kitty_tempdir.path }}/xterm-kitty"
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
|
||||
|
||||
- name: Look for already installed kitty
|
||||
shell: "which kitty"
|
||||
register: kitty_installed
|
||||
|
@ -22,34 +6,17 @@
|
|||
changed_when: False
|
||||
|
||||
|
||||
- name: "(Block) Install terminfo dir and file"
|
||||
block:
|
||||
|
||||
- name: Create terminfo dir
|
||||
file:
|
||||
path: /usr/share/terminfo/x/
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
force: False
|
||||
|
||||
- name: Copy terminfo
|
||||
copy:
|
||||
src: "{{ kitty_tempdir.path }}/xterm-kitty"
|
||||
dest: "/usr/share/terminfo/x/xterm-kitty"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: 'Try to install "kitty-terminfo"'
|
||||
package:
|
||||
name: kitty-terminfo
|
||||
state: latest
|
||||
ignore_errors: yes
|
||||
register: kitty_terminfo_installed
|
||||
when: kitty_installed is failed
|
||||
|
||||
|
||||
- name: Delete tempdir
|
||||
file:
|
||||
path: "{{ kitty_tempdir.path }}"
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
- name: "If no kitty(-terminfo) available, install manually"
|
||||
include_tasks: manual.yml
|
||||
when: kitty_terminfo_installed is failed and kitty_terminfo_installed is defined and kitty_terminfo_installed is failed
|
||||
|
||||
|
||||
|
|
46
tasks/manual.yml
Normal file
46
tasks/manual.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
- name: Create tempdir
|
||||
tempfile:
|
||||
state: directory
|
||||
register: kitty_tempdir
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
|
||||
|
||||
- name: Download actuel kitty terminfo
|
||||
get_url:
|
||||
url: "https://github.com/kovidgoyal/kitty/blob/master/terminfo/x/xterm-kitty?raw=true"
|
||||
dest: "{{ kitty_tempdir.path }}/xterm-kitty"
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
|
||||
|
||||
- name: "(Block) Install terminfo dir and file"
|
||||
block:
|
||||
|
||||
- name: Create terminfo dir
|
||||
file:
|
||||
path: /usr/share/terminfo/x/
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0755"
|
||||
force: False
|
||||
|
||||
- name: Copy terminfo
|
||||
copy:
|
||||
src: "{{ kitty_tempdir.path }}/xterm-kitty"
|
||||
dest: "/usr/share/terminfo/x/xterm-kitty"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
|
||||
- name: Delete tempdir
|
||||
file:
|
||||
path: "{{ kitty_tempdir.path }}"
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
run_once: True
|
||||
|
||||
|
Loading…
Reference in a new issue