From 339adddfcc08620a691de6b392a5977fe4b75dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Mon, 22 Dec 2014 17:09:51 +0100 Subject: [PATCH] =?UTF-8?q?Add=20new=20=E2=80=9Csalt.pkgrepo=E2=80=9D=20st?= =?UTF-8?q?ate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This state enables the official saltstack package repository in order to always benefit from the latest version. This state currently only works on Debian and Ubuntu, and aims to implement the installation recommendations of the official documentation: http://docs.saltstack.com/en/latest/topics/installation/index.html --- README.rst | 14 ++++++++++++++ salt/pkgrepo/absent.sls | 2 ++ salt/pkgrepo/debian/absent.sls | 7 +++++++ salt/pkgrepo/debian/init.sls | 21 +++++++++++++++++++++ salt/pkgrepo/debian/saltstack.gpg | Bin 0 -> 2212 bytes salt/pkgrepo/debian/sources.list | 2 ++ salt/pkgrepo/init.sls | 2 ++ salt/pkgrepo/ubuntu/absent.sls | 3 +++ salt/pkgrepo/ubuntu/init.sls | 3 +++ 9 files changed, 54 insertions(+) create mode 100644 salt/pkgrepo/absent.sls create mode 100644 salt/pkgrepo/debian/absent.sls create mode 100644 salt/pkgrepo/debian/init.sls create mode 100644 salt/pkgrepo/debian/saltstack.gpg create mode 100644 salt/pkgrepo/debian/sources.list create mode 100644 salt/pkgrepo/init.sls create mode 100644 salt/pkgrepo/ubuntu/absent.sls create mode 100644 salt/pkgrepo/ubuntu/init.sls diff --git a/README.rst b/README.rst index 62724dc..b7b3292 100644 --- a/README.rst +++ b/README.rst @@ -47,6 +47,20 @@ Configure pillar data under salt:ssh_roster to feed the template. Install a minion and configure it in `standalone mode `_. +``salt.pkgrepo`` +---------------- + +Enable the official saltstack package repository in order to always +benefit from the latest version. This state currently only works on Debian +and Ubuntu, and aims to implement the `installation recommendations of the +official documentation +`_. + +``salt.pkgrepo.absent`` +----------------------- + +Undo the effects of ``salt.pkgrepo``. + ``Configuration`` ================= Every option available in the templates can be set in pillar. Settings under 'salt' will be overridden by more specific settings under ``salt['master']``, ``salt['minion']`` or ``salt['cloud']`` diff --git a/salt/pkgrepo/absent.sls b/salt/pkgrepo/absent.sls new file mode 100644 index 0000000..d79b15f --- /dev/null +++ b/salt/pkgrepo/absent.sls @@ -0,0 +1,2 @@ +include: + - .{{ grains['os']|lower }}.absent diff --git a/salt/pkgrepo/debian/absent.sls b/salt/pkgrepo/debian/absent.sls new file mode 100644 index 0000000..2ace193 --- /dev/null +++ b/salt/pkgrepo/debian/absent.sls @@ -0,0 +1,7 @@ +drop-saltstack-pkgrepo: + file.absent: + - name: /etc/apt/sources.list.d/saltstack.list + +drop-saltstack-apt-key: + file.absent: + - name: /etc/apt/trusted.gpg.d/saltstack.gpg diff --git a/salt/pkgrepo/debian/init.sls b/salt/pkgrepo/debian/init.sls new file mode 100644 index 0000000..ffe7165 --- /dev/null +++ b/salt/pkgrepo/debian/init.sls @@ -0,0 +1,21 @@ +saltstack-apt-key: + file.managed: + - name: /etc/apt/trusted.gpg.d/saltstack.gpg + - source: salt://salt/pkgrepo/debian/saltstack.gpg + - user: root + - group: root + - mode: 644 + +saltstack-pkgrepo: + file.managed: + - name: /etc/apt/sources.list.d/saltstack.list + - source: salt://salt/pkgrepo/debian/sources.list + - user: root + - group: root + - mode: 644 + - template: jinja + - require: + - file: saltstack-apt-key + # Order: 1 because we can't put a require_in on "pkg: salt-{master,minion}" + # because we don't know if they are used. + - order: 1 diff --git a/salt/pkgrepo/debian/saltstack.gpg b/salt/pkgrepo/debian/saltstack.gpg new file mode 100644 index 0000000000000000000000000000000000000000..78da01e4d02e76b880acf2cdbab719da0851dd75 GIT binary patch literal 2212 zcmV;V2wV4=0u2OFep)O65CFlTb!7VIqTBoob+53rKJO^krL|RpjInKfc58&6WdASR z<C66P27Rw|$CP+&L$_!Vi#NF0bLk77d6j+2a^=e>r!LeP z)t)SK=Zxo4@IZn`3Sli5I6@gEeLQrCcH{qF;iwkeL|uu9QV{r{m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&?-Nx|ifU8-B7?8}6MV=V8!wyw ze0#|S^3@|n_%BPP^K4ISGET3qm18Wbn^##*^c`!Me3>>;wwyNdZAtnHzHK!z=x$*+ z*jT@KXE)klq=vwJ-=x6c^qCH;xGJlgPWJ*fM_x=xhxbSsi49~1r~Q8fpaYG80D|Cg zM!wsT%;Xe}3P(~u_u+>(S0j-ItG6Up#zKR6rF3VNzDtx6T|cU}q9ie&x$CI|#K43r zhc(MLzyw2+$D32^UFa5++*=)v0Ix0KSywBhEN=L!G%V^MtcORd*YIvedZMhl9G~W= zRKoiJFj>=pcw#`zlrQ9FT#SVqMNjDcb2$tp{rFb(8oXf{(2#yZREtib1ny@$^=!T@ zUnL;}yh(zXaQXa9>wb^dqhh}P$I>EPCdy*I5E6q4o~&cf?5(f)e6{=r<&9Z!_S-b< z@^xbIY)#pD@NV&wU5wFzp%oRoQ8uI4jjs#i+Qqj mf)Sd95cb^dnQt*8|E^>FPOoRgrH_-IR#z)S(H_dM0ssSe2_Yi@ literal 0 HcmV?d00001 diff --git a/salt/pkgrepo/debian/sources.list b/salt/pkgrepo/debian/sources.list new file mode 100644 index 0000000..f99e426 --- /dev/null +++ b/salt/pkgrepo/debian/sources.list @@ -0,0 +1,2 @@ +# saltstack +deb http://debian.saltstack.com/debian {{ grains['oscodename'] }}-saltstack main diff --git a/salt/pkgrepo/init.sls b/salt/pkgrepo/init.sls new file mode 100644 index 0000000..0d41bc4 --- /dev/null +++ b/salt/pkgrepo/init.sls @@ -0,0 +1,2 @@ +include: + - .{{ grains['os']|lower }} diff --git a/salt/pkgrepo/ubuntu/absent.sls b/salt/pkgrepo/ubuntu/absent.sls new file mode 100644 index 0000000..27b5fd6 --- /dev/null +++ b/salt/pkgrepo/ubuntu/absent.sls @@ -0,0 +1,3 @@ +drop-saltstack-pkgrepo: + pkgrepo.absent: + - ppa: saltstack/salt diff --git a/salt/pkgrepo/ubuntu/init.sls b/salt/pkgrepo/ubuntu/init.sls new file mode 100644 index 0000000..bd3986a --- /dev/null +++ b/salt/pkgrepo/ubuntu/init.sls @@ -0,0 +1,3 @@ +saltstack-pkgrepo: + pkgrepo.managed: + - ppa: saltstack/salt