10

I have a salt formula. On server I am using wkhtmltopdf tools. Ubuntu repo has this tool but it has an older version. I want to use the latest version.

I am doing the following to get it installed on minions manually.

$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
$ sudo apt-get install fontconfig libfontenc1 libjpeg-turbo8 libxfont1 x11-common xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils libxrender1
$ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

I can do cmd.run for all these commands. Is there any better way of doing any of these steps?

bitkot
  • 4,466
  • 2
  • 28
  • 39

1 Answers1

24

You can specify a remote sources option in a Salt pkg state. You could try something like this

cat stuff.sls

my_pkgs:
  - pkg.installed:
    - pkgs:
      - fontconfig
      - libfontenc1
      - libjpeg-turbo8 
      - libxfont1
      - x11-common
      - xfonts-75dpi
      - xfonts-base
      - xfonts-encodings
      - xfonts-utils
      - libxrender1

install_wkhtmltox:
  pkg.installed:
    - sources:
      - wkhtmltox: http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
Utah_Dave
  • 4,531
  • 24
  • 23
  • 2
    Thank's that worked, I actually copied deb file in salt files and referred as source, that way not have to rely on the availability of the download url. – bitkot Jul 24 '15 at 10:59
  • 1
    Great idea! I was going to suggest downloading that deb to your master, but wasn't sure if that was acceptable – Utah_Dave Jul 24 '15 at 13:24
  • I'm using this to download and install https://vivaldi.com/download/vivaldi_TP4.1.0.219.50-1_amd64.deb. The URL works fine in Firefox, but Salt gives me MinionError: HTTP error 403 reading https://vivaldi.com/download/vivaldi_TP4.1.0.219.50-1_amd64.deb: Request forbidden -- authorization will not help Any ideas? – andreas-h Aug 20 '15 at 17:27