Merge pull request #138355 from mweinelt/21.05/ansible

This commit is contained in:
Martin Weinelt 2021-09-20 02:39:37 +02:00 committed by GitHub
commit 60f651c276
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 194 additions and 18 deletions

View File

@ -1,8 +1,8 @@
{ lib
, callPackage
, buildPythonPackage
, fetchPypi
, installShellFiles
, ansible-collections
, cryptography
, jinja2
, junit-xml
@ -20,13 +20,19 @@
, xmltodict
}:
let
ansible-collections = callPackage ./collections.nix {
version = "3.4.0"; # must be < 4.0
sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
};
in
buildPythonPackage rec {
pname = "ansible-base";
version = "2.10.11";
version = "2.10.14";
src = fetchPypi {
inherit pname version;
sha256 = "0jr3cxqiami9k07g2kmvfp54iafbcnd1d66l8fdnaqka5bc19wdw";
sha256 = "sha256-gAxGRsWKWJf3HyIwFn21YmoZbeuiCPDvRWChg//Z39o=";
};
# ansible_connection is already wrapped, so don't pass it through
@ -69,6 +75,10 @@ buildPythonPackage rec {
# internal import errors, missing dependencies
doCheck = false;
passthru = {
collections = ansible-collections;
};
meta = with lib; {
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";

View File

@ -14,21 +14,23 @@
, xmltodict
, withJunos ? false
, withNetbox ? false
, version
, sha256
}:
buildPythonPackage rec {
pname = "ansible";
version = "3.4.0";
inherit version;
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "096rbgz730njk0pg8qnc27mmz110wqrw354ca9gasb7rqg0f4d6a";
inherit pname version sha256;
};
postPatch = ''
# make ansible-base depend on ansible-collection, not the other way around
sed -i '/ansible-base/d' setup.py
sed -Ei '/ansible-(base|core)/d' setup.py
'';
propagatedBuildInputs = lib.unique ([
@ -70,7 +72,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Radically simple IT automation";
homepage = "http://www.ansible.com";
homepage = "https://www.ansible.com";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hexa ];
};

View File

@ -0,0 +1,90 @@
{ lib
, callPackage
, buildPythonPackage
, fetchPypi
, installShellFiles
, cryptography
, jinja2
, junit-xml
, lxml
, ncclient
, packaging
, paramiko
, pexpect
, psutil
, pycrypto
, pyyaml
, requests
, resolvelib
, scp
, windowsSupport ? false, pywinrm
, xmltodict
}:
let
ansible-collections = callPackage ./collections.nix {
version = "4.5.0";
sha256 = "1c8dspqy4in7sgz10y1pggwnh1hv79wap7p7xhai0f0s6nr54lyc";
};
in
buildPythonPackage rec {
pname = "ansible-core";
version = "2.11.5";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-fTzkcBQSKQdFRwQ2NIXkhRP4rQ8AE4uIhw622IlT0SE=";
};
# 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
resolvelib
# 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;
passthru = {
collections = ansible-collections;
};
meta = with lib; {
description = "Radically simple IT automation";
homepage = "https://www.ansible.com";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hexa ];
};
}

View File

@ -1,5 +1,5 @@
{ lib
, fetchFromGitHub
, fetchPypi
, buildPythonPackage
, pycrypto
, paramiko
@ -18,13 +18,11 @@
buildPythonPackage rec {
pname = "ansible";
version = "2.9.23";
version = "2.9.26";
src = fetchFromGitHub {
owner = "ansible";
repo = "ansible";
rev = "v${version}";
sha256 = "0mikykpzyqpmaiczz53f71mcyc4qvahi9ckn7wgfx7sw7s2z3skk";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-OuAqrSu+3PtBnOdevSpkjp3rc+ni2N6GyC1gR7G962M=";
};
prePatch = ''
@ -48,7 +46,7 @@ buildPythonPackage rec {
doCheck = false;
meta = with lib; {
homepage = "http://www.ansible.com";
homepage = "https://www.ansible.com";
description = "Radically simple IT automation";
license = [ licenses.gpl3 ] ;
maintainers = with maintainers; [ joamaki costrouc hexa ];

View File

@ -0,0 +1,34 @@
{ lib, buildPythonPackage, fetchFromGitHub, six, lark-parser, pytestCheckHook }:
buildPythonPackage rec {
pname = "commentjson";
version = "0.9.0";
src = fetchFromGitHub {
owner = "vaidik";
repo = "commentjson";
rev = "v${version}";
sha256 = "sha256-dPnIcv7TIeyG7rU938w7FrDklmaGuPpXz34uw/JjOgY=";
};
postPatch = ''
substituteInPlace setup.py \
--replace "lark-parser>=0.7.1,<0.8.0" "lark-parser"
# NixOS is missing test.test_json module
rm -r commentjson/tests/test_json
'';
propagatedBuildInputs = [ lark-parser six ];
checkInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "commentjson" ];
meta = with lib; {
description = "Add JavaScript or Python style comments in JSON";
homepage = "https://github.com/vaidik/commentjson/";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View File

@ -0,0 +1,35 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, commentjson
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "resolvelib";
# Currently this package is only used by Ansible and breaking changes
# are frequently introduced, so when upgrading ensure the new version
# is compatible with Ansible
# https://github.com/NixOS/nixpkgs/pull/128636
# https://github.com/ansible/ansible/blob/devel/requirements.txt
version = "0.5.5";
src = fetchFromGitHub {
owner = "sarugaku";
repo = "resolvelib";
rev = version;
sha256 = "198vfv78hilpg0d0mjzchzp9zk6239wnra61vlsgwpcgz66d2bgv";
};
checkInputs = [
commentjson
pytestCheckHook
];
meta = with lib; {
description = "Resolve abstract dependencies into concrete ones";
homepage = "https://github.com/sarugaku/resolvelib";
license = licenses.isc;
maintainers = with maintainers; [ hexa ];
};
}

View File

@ -3,6 +3,8 @@
rec {
ansible = ansible_2_10;
ansible_2_11 = python3Packages.toPythonApplication python3Packages.ansible-core;
ansible_2_10 = python3Packages.toPythonApplication python3Packages.ansible-base;
# End of support 2021/10/02, End of life 2021/12/31

View File

@ -12625,7 +12625,8 @@ in
ansible
ansible_2_8
ansible_2_9
ansible_2_10;
ansible_2_10
ansible_2_11;
ansible-lint = with python3.pkgs; toPythonApplication ansible-lint;

View File

@ -415,7 +415,7 @@ in {
ansible-base = callPackage ../development/python-modules/ansible/base.nix { };
ansible-collections = callPackage ../development/python-modules/ansible/collections.nix { };
ansible-core = callPackage ../development/python-modules/ansible/core.nix { };
ansible-kernel = callPackage ../development/python-modules/ansible-kernel { };
@ -1523,6 +1523,8 @@ in {
commandparse = callPackage ../development/python-modules/commandparse { };
commentjson = callPackage ../development/python-modules/commentjson { };
commoncode = callPackage ../development/python-modules/commoncode { };
CommonMark = callPackage ../development/python-modules/commonmark { };
@ -7206,6 +7208,8 @@ in {
resampy = callPackage ../development/python-modules/resampy { };
resolvelib = callPackage ../development/python-modules/resolvelib { };
responses = callPackage ../development/python-modules/responses { };
respx = callPackage ../development/python-modules/respx { };