summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ansible
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/ansible')
-rw-r--r--pkgs/development/python-modules/ansible/base.nix78
-rw-r--r--pkgs/development/python-modules/ansible/collections.nix77
-rw-r--r--pkgs/development/python-modules/ansible/legacy.nix (renamed from pkgs/development/python-modules/ansible/default.nix)4
3 files changed, 157 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/ansible/base.nix b/pkgs/development/python-modules/ansible/base.nix
new file mode 100644
index 000000000000..f3470f80b50f
--- /dev/null
+++ b/pkgs/development/python-modules/ansible/base.nix
@@ -0,0 +1,78 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, installShellFiles
+, ansible-collections
+, cryptography
+, jinja2
+, junit-xml
+, lxml
+, ncclient
+, packaging
+, paramiko
+, pexpect
+, psutil
+, pycrypto
+, pyyaml
+, requests
+, scp
+, windowsSupport ? false, pywinrm
+, xmltodict
+}:
+
+buildPythonPackage rec {
+ pname = "ansible-base";
+ version = "2.10.9";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "0l91bwbavjnaqsnb4c6f17xl7r0cvglz3rxqfs63aagw10z5sqq4";
+ };
+
+ # ansible_connection is already wrapped, so don't pass it through
+ # the python interpreter again, as it would break execution of
+ # connection plugins.
+ postPatch = ''
+ substituteInPlace lib/ansible/executor/task_executor.py \
+ --replace "[python," "["
+ '';
+
+ nativeBuildInputs = [
+ installShellFiles
+ ];
+
+ propagatedBuildInputs = [
+ # depend on ansible-collections instead of the other way around
+ ansible-collections
+ # from requirements.txt
+ cryptography
+ jinja2
+ packaging
+ pyyaml
+ # optional dependencies
+ junit-xml
+ lxml
+ ncclient
+ paramiko
+ pexpect
+ psutil
+ pycrypto
+ requests
+ scp
+ xmltodict
+ ] ++ lib.optional windowsSupport pywinrm;
+
+ postInstall = ''
+ installManPage docs/man/man1/*.1
+ '';
+
+ # internal import errors, missing dependencies
+ doCheck = false;
+
+ meta = with lib; {
+ description = "Radically simple IT automation";
+ homepage = "https://www.ansible.com";
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ hexa ];
+ };
+}
diff --git a/pkgs/development/python-modules/ansible/collections.nix b/pkgs/development/python-modules/ansible/collections.nix
new file mode 100644
index 000000000000..9547b9a09187
--- /dev/null
+++ b/pkgs/development/python-modules/ansible/collections.nix
@@ -0,0 +1,77 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, ansible-base
+, jsonschema
+, jxmlease
+, ncclient
+, netaddr
+, paramiko
+, pynetbox
+, scp
+, textfsm
+, ttp
+, xmltodict
+, withJunos ? false
+, withNetbox ? false
+}:
+
+buildPythonPackage rec {
+ pname = "ansible";
+ version = "3.4.0";
+ format = "setuptools";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
+ };
+
+ postPatch = ''
+ # make ansible-base depend on ansible-collection, not the other way around
+ sed -i '/ansible-base/d' setup.py
+ '';
+
+ 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";
+ homepage = "http://www.ansible.com";
+ license = licenses.gpl3Plus;
+ maintainers = with maintainers; [ hexa ];
+ };
+}
diff --git a/pkgs/development/python-modules/ansible/default.nix b/pkgs/development/python-modules/ansible/legacy.nix
index 245375c26be0..2779feffee87 100644
--- a/pkgs/development/python-modules/ansible/default.nix
+++ b/pkgs/development/python-modules/ansible/legacy.nix
@@ -18,13 +18,13 @@
buildPythonPackage rec {
pname = "ansible";
- version = "2.9.12";
+ version = "2.9.21";
src = fetchFromGitHub {
owner = "ansible";
repo = "ansible";
rev = "v${version}";
- sha256 = "0c794k0cyl54807sh9in0l942ah6g6wlz5kf3qvy5lhd581zlgyb";
+ sha256 = "1pfiwq2wfw11vmxdq2yhk86hm5jljlrnphlzfjr01kwzfikkdp5m";
};
prePatch = ''