Created
December 7, 2018 02:34
-
-
Save dlundgren/b2ab59db6dbe3562de24be077364716c to your computer and use it in GitHub Desktop.
ghostscript 9.25 on Ubuntu 16.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
gather_facts: no | |
become: yes | |
vars: | |
packages_manual: | |
- libgs9-common_9.25~dfsg+1-0ubuntu0.16.04.3_all.deb | |
- libgs9_9.25~dfsg+1-0ubuntu0.16.04.3_amd64.deb | |
- ghostscript_9.25~dfsg+1-0ubuntu0.16.04.3_amd64.deb | |
tasks: | |
- name: get ghostscript version | |
shell: "ghostscript -v | head -1 | awk '{ print $3 }'" | |
changed_when: false | |
check_mode: false | |
register: _ghostscript_version | |
- name: Create ghostscript_version variable. | |
when: _ghostscript_version.stdout != '' | |
set_fact: | |
ghostscript_version: "{{ _ghostscript_version.stdout.split()[0] }}" | |
# this purges the existing ghostscript as well since it relies on it | |
- block: | |
- name: store the downloads | |
file: | |
dest: /srv/archives | |
state: directory | |
- name: Download the packages | |
get_url: | |
url: "https://launchpad.net/ubuntu/+archive/primary/+files/{{ item }}" | |
dest: "/srv/archives/{{ item }}" | |
with_items: "{{ packages_manual }}" | |
- name: remove ghostscript | |
when: ghostscript_version is defined and ghostscript_version != '9.25' | |
apt: | |
name: libgs9-common | |
state: absent | |
purge: yes | |
- name: Install ghostscript 9.25 manually | |
apt: | |
deb: "/srv/archives/{{ item }}" | |
with_items: "{{ packages_manual }}" | |
when: ghostscript_version is not defined or ghostscript_version != '9.25' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment