3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/ansible/default.nix
Martin Weinelt 2bb4191613 Ansible: Fix connection plugins and add support for NETCONF (#72370)
* ansible: Fix use of connection plugins

Ansible tries to execute the ansible-connection script as a python
script from within it's task executor. This does not work when it is
encapsulated in a shell script. Therefore remove the call to the python
interpreter and use the wrapped version directly.

Fixes #71342

* ansible: Add ncclient to support NETCONF connections

* ansible: Some cleanups

- boto was dropped from propagatedBuildInputs in 4af94d0f
- lib/ansible/constants.py does not have "/usr" anywhere in v2.4..v2.9
2019-11-20 14:55:07 +01:00

58 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, pycrypto
, paramiko
, jinja2
, pyyaml
, httplib2
, six
, netaddr
, dnspython
, jmespath
, dopy
, ncclient
, windowsSupport ? false
, pywinrm
}:
buildPythonPackage rec {
pname = "ansible";
version = "2.8.4";
src = fetchFromGitHub {
owner = "ansible";
repo = "ansible";
rev = "v${version}";
sha256 = "1fp7zz8awfv70nn8i6x0ggx4472377hm7787x16qv2kz4nb069ki";
};
prePatch = ''
# ansible-connection is wrapped, so make sure it's not passed
# through the python interpreter.
sed -i "s/\[python, /[/" lib/ansible/executor/task_executor.py
'';
postInstall = ''
for m in docs/man/man1/*; do
install -vD $m -t $out/share/man/man1
done
'';
propagatedBuildInputs = [
pycrypto paramiko jinja2 pyyaml httplib2
six netaddr dnspython jmespath dopy ncclient
] ++ lib.optional windowsSupport pywinrm;
# dificult to test
doCheck = false;
meta = with lib; {
homepage = http://www.ansible.com;
description = "Radically simple IT automation";
license = [ licenses.gpl3 ] ;
maintainers = with maintainers; [ joamaki costrouc ];
platforms = platforms.linux ++ platforms.darwin;
};
}