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