about summary refs log tree commit diff
path: root/pkgs/tools/admin/ansible
diff options
context:
space:
mode:
authorChris Ostrouchov <chris.ostrouchov@gmail.com>2019-02-24 16:52:48 -0500
committerChris Ostrouchov <chris.ostrouchov@gmail.com>2019-03-01 14:46:56 -0500
commit300ca8132b3012e370e2565fa67638baf0567ec9 (patch)
tree7753eef6f63f913fca6ea70f2080a7d9d5547a60 /pkgs/tools/admin/ansible
parente48e6ca40a7d4c5ea842ecbca1b62a7e2bc0888d (diff)
downloadnixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar.gz
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar.bz2
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar.lz
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar.xz
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.tar.zst
nixlib-300ca8132b3012e370e2565fa67638baf0567ec9.zip
pythonPackages.ansible: refactor move to python-modules
Diffstat (limited to 'pkgs/tools/admin/ansible')
-rw-r--r--pkgs/tools/admin/ansible/default.nix79
1 files changed, 17 insertions, 62 deletions
diff --git a/pkgs/tools/admin/ansible/default.nix b/pkgs/tools/admin/ansible/default.nix
index 58798a92b159..f9cc3fb4ebcb 100644
--- a/pkgs/tools/admin/ansible/default.nix
+++ b/pkgs/tools/admin/ansible/default.nix
@@ -1,72 +1,27 @@
-{ stdenv, fetchurl, python2
-, windowsSupport ? false
-}:
+{ python3Packages, fetchurl }:
 
-let
-  generic = { version, sha256, py ? python2 }: py.pkgs.buildPythonPackage rec {
-    pname = "ansible";
-    inherit version;
+{
+  ansible = with python3Packages; toPythonApplication ansible;
+
+  ansible_2_7 = with python3Packages; toPythonApplication ansible;
 
-    outputs = [ "out" "man" ];
+  ansible_2_6 = with python3Packages; toPythonApplication (ansible.overridePythonAttrs(old: rec {
+    pname = "ansible";
+    version = "2.6.9";
 
     src = fetchurl {
       url = "https://releases.ansible.com/ansible/${pname}-${version}.tar.gz";
-      inherit sha256;
+      sha256 = "12mysvdavkypgmyms1wjq2974lk97w893k23i6khigxrjj6r85z1";
     };
+  }));
 
-    prePatch = ''
-      sed -i "s,/usr/,$out," lib/ansible/constants.py
-    '';
-
-    postInstall = ''
-      wrapPythonProgramsIn "$out/bin" "$out $PYTHONPATH"
-
-      for m in docs/man/man1/*; do
-        install -vD $m -t $man/share/man/man1
-      done
-    '';
-
-    doCheck = false;
-    dontStrip = true;
-    dontPatchELF = true;
-    dontPatchShebangs = false;
-
-    propagatedBuildInputs = with py.pkgs; [
-      pycrypto paramiko jinja2 pyyaml httplib2 boto six netaddr dnspython jmespath dopy
-    ] ++ stdenv.lib.optional windowsSupport pywinrm;
+  ansible_2_5 = with python3Packages; toPythonApplication (ansible.overridePythonAttrs(old: rec {
+    pname = "ansible";
+    version = "2.5.14";
 
-    meta = with stdenv.lib; {
-      homepage = http://www.ansible.com;
-      description = "A simple automation tool";
-      license = with licenses; [ gpl3 ] ;
-      maintainers = with maintainers; [ jgeerds joamaki ];
-      platforms = with platforms; linux ++ darwin;
+    src = fetchurl {
+      url = "https://releases.ansible.com/ansible/${pname}-${version}.tar.gz";
+      sha256 = "0sd04h2k5qv4m48dn76jkjlwlqfdk15hzyagj9i71r8brvmwhnk9";
     };
-  };
-
-in rec {
-  # We will carry all the supported versions
-
-  ansible_2_4 = generic {
-    version = "2.4.4.0";
-    sha256  = "0n1k6h0h6av74nw8vq98fmh6q4pq6brpwmx45282vh3bkdmpa0ib";
-  };
-
-  ansible_2_5 = generic {
-    version = "2.5.11";
-    sha256  = "07rhgkl3a2ba59rqh9pyz1p661gc389shlwa2sw1m6wwifg4lm24";
-  };
-
-  ansible_2_6 = generic {
-    version = "2.6.7";
-    sha256  = "10pakw9k9wd3cy1qk3ah2253ph7c7h3qzpal4k0s5lschzgy2fh0";
-  };
-
-  ansible_2_7 = generic {
-    version = "2.7.6";
-    sha256  = "0f7b2ghm34ql8yv90wr0ngd6w7wyvnlcxpc3snkj86kcjsnmx1bd";
-  };
-
-  ansible2 = ansible_2_7;
-  ansible  = ansible2;
+  }));
 }