1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
jmespath,
jsonschema,
jxmlease,
ncclient,
netaddr,
paramiko,
ansible-pylibssh,
pynetbox,
scp,
textfsm,
ttp,
xmltodict,
passlib,
# optionals
withJunos ? false,
withNetbox ? false,
}:
let
pname = "ansible";
version = "13.1.0";
in
buildPythonPackage {
inherit pname version;
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-5Se5URvhOC4x6O92UOIzinsPCdY/xd7Tzpv4I0RE13E=";
};
# we make ansible-core depend on ansible, not the other way around,
# since when you install ansible-core you will not have ansible
# executables installed in the PATH variable
pythonRemoveDeps = [ "ansible-core" ];
build-system = [ setuptools ];
dependencies = lib.unique (
[
# Support ansible collections by default, make all others optional
# ansible.netcommon
passlib
jxmlease
ncclient
netaddr
paramiko
ansible-pylibssh
xmltodict
# ansible.posix
# ansible.utils
jsonschema
textfsm
ttp
xmltodict
# ansible.windows
# Default ansible collections dependencies
# community.general
jmespath
# lots of collections with dedicated requirements.txt and pyproject.toml files,
# add the dependencies for the collections you need conditionally and install
# ansible using overrides to enable the collections you need.
]
++ lib.optionals withJunos [
# ansible_collections/junipernetworks/junos/requirements.txt
jxmlease
ncclient
paramiko
ansible-pylibssh
scp
xmltodict
]
++ lib.optionals withNetbox [
# ansible_collections/netbox/netbox/pyproject.toml
pynetbox
]
);
# don't try and fail to strip 48000+ non strippable files, it takes >5 minutes!
dontStrip = true;
# difficult to test
doCheck = false;
meta = {
description = "Radically simple IT automation";
mainProgram = "ansible-community";
homepage = "https://www.ansible.com";
changelog = "https://github.com/ansible-community/ansible-build-data/blob/${version}/${lib.versions.major version}/CHANGELOG-v${lib.versions.major version}.rst";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
HarisDotParis
robsliwi
];
};
}
|