2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, jsonschema
|
|
|
|
, jxmlease
|
|
|
|
, ncclient
|
|
|
|
, netaddr
|
|
|
|
, paramiko
|
|
|
|
, pynetbox
|
|
|
|
, scp
|
|
|
|
, textfsm
|
|
|
|
, ttp
|
|
|
|
, xmltodict
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# optionals
|
2021-05-20 23:08:51 +00:00
|
|
|
, withJunos ? false
|
|
|
|
, withNetbox ? false
|
|
|
|
}:
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "ansible";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "5.8.0";
|
2022-04-27 09:35:20 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchPypi {
|
2022-04-27 09:35:20 +00:00
|
|
|
inherit pname version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-+gVkdiAfQGJfs22VxQQe9GOIC+GL5cc7mYtXtAGWeGM=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
# we make ansible-core depend on ansible, not the other way around
|
|
|
|
sed -Ei '/ansible-core/d' setup.py
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.unique ([
|
|
|
|
# Support ansible collections by default, make all others optional
|
|
|
|
# ansible.netcommon
|
|
|
|
jxmlease
|
|
|
|
ncclient
|
|
|
|
netaddr
|
|
|
|
paramiko
|
|
|
|
xmltodict
|
|
|
|
# ansible.posix
|
|
|
|
# ansible.utils
|
|
|
|
jsonschema
|
|
|
|
textfsm
|
|
|
|
ttp
|
|
|
|
xmltodict
|
|
|
|
# ansible.windows
|
|
|
|
|
|
|
|
# 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
|
|
|
|
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 = with lib; {
|
|
|
|
description = "Radically simple IT automation";
|
2021-08-23 08:02:39 +00:00
|
|
|
homepage = "https://www.ansible.com";
|
2022-05-18 14:49:53 +00:00
|
|
|
changelog = "https://github.com/ansible-community/ansible-build-data/blob/${version}/${lib.versions.major version}/CHANGELOG-v${lib.versions.major version}.rst";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|