Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions roles/terminfo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@
changed_when: false
check_mode: false

- name: Read remote terminfo entry
ansible.builtin.command:
argv:
- "{{ terminfo_infocmp_cmd }}"
- -x
- "{{ terminfo_term_name }}"
register: terminfo_remote_infocmp_result
changed_when: false
failed_when: false

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not keen on this. What if infocmp isn't found? Or some file permission error occurs?

check_mode: false

- name: Save terminfo entry
ansible.builtin.command:
argv:
- "{{ terminfo_tic_cmd }}"
- -x
- "-"
stdin: "{{ terminfo_infocmp_x_result.stdout }}"
when: >
terminfo_remote_infocmp_result.rc != 0 or
terminfo_infocmp_x_result.stdout != terminfo_remote_infocmp_result.stdout
changed_when: true