From 46b1ea260a05d2d5fb01624c93d405daaf750b0c Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 27 Jan 2017 09:58:43 +0100 Subject: [PATCH] pythonPackages.ansible2: move 2.2 to separate file, make default `pythonPackages.ansible_2_2` is now the default `ansible`. --- nixos/doc/manual/release-notes/rl-1703.xml | 9 +++- .../python-modules/ansible/2.2.nix | 50 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 +- pkgs/top-level/python-packages.nix | 38 ++------------ 4 files changed, 62 insertions(+), 38 deletions(-) create mode 100644 pkgs/development/python-modules/ansible/2.2.nix diff --git a/nixos/doc/manual/release-notes/rl-1703.xml b/nixos/doc/manual/release-notes/rl-1703.xml index 177010e2a322..09358f3af231 100644 --- a/nixos/doc/manual/release-notes/rl-1703.xml +++ b/nixos/doc/manual/release-notes/rl-1703.xml @@ -46,7 +46,14 @@ following incompatible changes: for what those parameters represent. - + + + ansible now defaults to ansible version 2 as version 1 + has been removed due to a serious + vulnerability unpatched by upstream. + + gnome alias has been removed along with diff --git a/pkgs/development/python-modules/ansible/2.2.nix b/pkgs/development/python-modules/ansible/2.2.nix new file mode 100644 index 000000000000..22af2c012655 --- /dev/null +++ b/pkgs/development/python-modules/ansible/2.2.nix @@ -0,0 +1,50 @@ +{ lib +, fetchurl +, buildPythonPackage +, pycrypto +, paramiko +, jinja2 +, pyyaml +, httplib2 +, boto +, six +, netaddr +, dns +, pywinrm +}: + +buildPythonPackage rec { + pname = "ansible"; + version = "2.2.1.0"; + name = "${pname}-${version}"; + + + src = fetchurl { + url = "http://releases.ansible.com/ansible/${name}.tar.gz"; + sha256 = "0gz9i30pdmkchi936ijy873k8di6fmf3v5rv551hxyf0hjkjx8b3"; + }; + + prePatch = '' + sed -i "s,/usr/,$out," lib/ansible/constants.py + ''; + + doCheck = false; + dontStrip = true; + dontPatchELF = true; + dontPatchShebangs = false; + windowsSupport = true; + + propagatedBuildInputs = [ pycrypto paramiko jinja2 pyyaml httplib2 + boto six netaddr dns ] ++ lib.optional windowsSupport pywinrm; + + meta = { + homepage = "http://www.ansible.com"; + description = "A simple automation tool"; + license = with lib.licenses; [ gpl3] ; + maintainers = with lib.maintainers; [ + jgeerds + joamaki + ]; + platforms = with lib.platforms; linux ++ darwin; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8a720045a8dd..1d4b427fa713 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6007,8 +6007,7 @@ with pkgs; augeas = callPackage ../tools/system/augeas { }; - ansible = python2Packages.ansible; - + ansible = python2Packages.ansible2; ansible2 = python2Packages.ansible2; antlr = callPackage ../development/tools/parsing/antlr/2.7.7.nix { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 532c681d4da0..2c05c2954f23 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -923,42 +923,10 @@ in { }; }; - ansible2 = buildPythonPackage rec { - version = "2.2.0.0"; - name = "ansible-${version}"; - disabled = isPy3k; + ansible = self.ansible2; + ansible2 = self.ansible_2_2; - src = pkgs.fetchurl { - url = "http://releases.ansible.com/ansible/${name}.tar.gz"; - sha256 = "11l5814inr44ammp0sh304rqx2382fr629c0pbwf0k1rjg99iwfr"; - }; - - prePatch = '' - sed -i "s,/usr/,$out," lib/ansible/constants.py - ''; - - doCheck = false; - dontStrip = true; - dontPatchELF = true; - dontPatchShebangs = true; - windowsSupport = true; - - propagatedBuildInputs = with self; [ - pycrypto paramiko jinja2 pyyaml httplib2 boto six - netaddr dns - ] ++ optional windowsSupport pywinrm; - - meta = with stdenv.lib; { - homepage = "http://www.ansible.com"; - description = "A simple automation tool"; - license = with licenses; [ gpl3 ]; - maintainers = with maintainers; [ - copumpkin - jgeerds - ]; - platforms = with platforms; linux ++ darwin; - }; - }; + ansible_2_2 = callPackage ../development/python-modules/ansible/2.2.nix {}; apipkg = buildPythonPackage rec { name = "apipkg-1.4";