1{ lib
2, callPackage
3, buildPythonPackage
4, fetchPypi
5, installShellFiles
6, ansible
7, cryptography
8, jinja2
9, junit-xml
10, lxml
11, ncclient
12, packaging
13, paramiko
14, pexpect
15, psutil
16, pycrypto
17, pyyaml
18, requests
19, resolvelib
20, scp
21, windowsSupport ? false, pywinrm
22, xmltodict
23}:
24
25buildPythonPackage rec {
26 pname = "ansible-core";
27 version = "2.14.0";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-+ki0gctiO/ebuQPyIwl2gaDBPhtOx+eOfdfYWNNqNLI=";
32 };
33
34 # ansible_connection is already wrapped, so don't pass it through
35 # the python interpreter again, as it would break execution of
36 # connection plugins.
37 postPatch = ''
38 substituteInPlace lib/ansible/executor/task_executor.py \
39 --replace "[python," "["
40 '';
41
42 nativeBuildInputs = [
43 installShellFiles
44 ];
45
46 propagatedBuildInputs = [
47 # depend on ansible instead of the other way around
48 ansible
49 # from requirements.txt
50 cryptography
51 jinja2
52 packaging
53 pyyaml
54 resolvelib # This library is a PITA, since ansible requires a very old version of it
55 # optional dependencies
56 junit-xml
57 lxml
58 ncclient
59 paramiko
60 pexpect
61 psutil
62 pycrypto
63 requests
64 scp
65 xmltodict
66 ] ++ lib.optional windowsSupport pywinrm;
67
68 postInstall = ''
69 installManPage docs/man/man1/*.1
70 '';
71
72 # internal import errors, missing dependencies
73 doCheck = false;
74
75 meta = with lib; {
76 changelog = "https://github.com/ansible/ansible/blob/v${version}/changelogs/CHANGELOG-v${lib.versions.majorMinor version}.rst";
77 description = "Radically simple IT automation";
78 homepage = "https://www.ansible.com";
79 license = licenses.gpl3Plus;
80 maintainers = with maintainers; [ ];
81 };
82}