diff --git a/packer/ansible/roles/inkscape/defaults/main.yml b/packer/ansible/roles/inkscape/defaults/main.yml new file mode 100644 index 0000000..32954b6 --- /dev/null +++ b/packer/ansible/roles/inkscape/defaults/main.yml @@ -0,0 +1,2 @@ +--- +inkstitch_version: 2.1.2 diff --git a/packer/ansible/roles/inkscape/tasks/inkstitch.yml b/packer/ansible/roles/inkscape/tasks/inkstitch.yml new file mode 100644 index 0000000..c893fdb --- /dev/null +++ b/packer/ansible/roles/inkscape/tasks/inkstitch.yml @@ -0,0 +1,31 @@ +--- +- command: dpkg-query -W inkstitch + register: inkstitch_query + check_mode: false + failed_when: inkstitch_query.rc > 1 + changed_when: false + +- set_fact: + inkstitch_installed_version: "{{ (inkstitch_query.stdout | split('\t'))[1] }}" + when: inkstitch_query.rc == 0 + +- ansible.builtin.tempfile: + state: file + suffix: .deb + register: inkstitch_deb + when: inkstitch_installed_version | default('') != inkstitch_version + +- name: download inkstitch package + ansible.builtin.get_url: + url: https://github.com/inkstitch/inkstitch/releases/download/v2.1.2/inkstitch_{{ inkstitch_version }}_amd64.deb + dest: "{{ inkstitch_deb.path }}" + force: yes + mode: '0644' + owner: root + group: root + when: not ansible_check_mode and inkstitch_installed_version | default('') != inkstitch_version + +- name: install inkstitch + apt: + deb: "{{ inkstitch_deb.path }}" + when: not ansible_check_mode and inkstitch_installed_version | default('') != inkstitch_version diff --git a/packer/ansible/roles/inkscape/tasks/main.yml b/packer/ansible/roles/inkscape/tasks/main.yml index 4fde435..8c3a67e 100644 --- a/packer/ansible/roles/inkscape/tasks/main.yml +++ b/packer/ansible/roles/inkscape/tasks/main.yml @@ -9,5 +9,8 @@ - import_tasks: tabbed_box_maker.yml tags: - inkscape:tabbed_box_maker + - import_tasks: inkstitch.yml + tags: + - inkscape:inkstitch tags: - inkscape