forked from mirrors/nixpkgs
2d0f97be21
I have been using a pip/virtualenv based workflow with ansible for a long time, with colleagues that sadly wouldn't appreciate Nix. I haven't used this package for a long time and maybe there is someone out there who will fill this spot better than I could.
83 lines
1.7 KiB
Nix
83 lines
1.7 KiB
Nix
{ lib
|
|
, callPackage
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, installShellFiles
|
|
, ansible
|
|
, cryptography
|
|
, jinja2
|
|
, junit-xml
|
|
, lxml
|
|
, ncclient
|
|
, packaging
|
|
, paramiko
|
|
, pexpect
|
|
, psutil
|
|
, pycrypto
|
|
, pyyaml
|
|
, requests
|
|
, resolvelib
|
|
, scp
|
|
, windowsSupport ? false, pywinrm
|
|
, xmltodict
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "ansible-core";
|
|
version = "2.13.0";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "sha256-COD7SnGNlnplTnDNpXz5MgGGkyndHPW4pCZ8V8XEyNM=";
|
|
};
|
|
|
|
# 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 instead of the other way around
|
|
ansible
|
|
# from requirements.txt
|
|
cryptography
|
|
jinja2
|
|
packaging
|
|
pyyaml
|
|
resolvelib # This library is a PITA, since ansible requires a very old version of it
|
|
# 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; {
|
|
changelog = "https://github.com/ansible/ansible/blob/v${version}/changelogs/CHANGELOG-v${lib.versions.majorMinor version}.rst";
|
|
description = "Radically simple IT automation";
|
|
homepage = "https://www.ansible.com";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|