mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
ansible: prune old versions; restructure
- Drop pkgs/tools/admin/ansible and move everything into top-level and throws into central aliases.nix - Drop the Ansible 2.8 throw - Remove Ansible 2.9/2.10, both will be EOL before the 22.05 release - Remove Ansible 2.11, it will go EOL during the 22.05 release - Expose the collections as `python3Packages.ansible` Closes: #157591
This commit is contained in:
parent
909fa26161
commit
0f946e2875
9 changed files with 24 additions and 196 deletions
|
@ -1,88 +0,0 @@
|
||||||
{ lib
|
|
||||||
, callPackage
|
|
||||||
, buildPythonPackage
|
|
||||||
, fetchPypi
|
|
||||||
, installShellFiles
|
|
||||||
, cryptography
|
|
||||||
, jinja2
|
|
||||||
, junit-xml
|
|
||||||
, lxml
|
|
||||||
, ncclient
|
|
||||||
, packaging
|
|
||||||
, paramiko
|
|
||||||
, pexpect
|
|
||||||
, psutil
|
|
||||||
, pycrypto
|
|
||||||
, pyyaml
|
|
||||||
, requests
|
|
||||||
, scp
|
|
||||||
, windowsSupport ? false, pywinrm
|
|
||||||
, 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.17";
|
|
||||||
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "sha256-75JYgsqNTDwszQkc3hmeDIaQJMytDQejN9zyB7/zLzQ=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# 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;
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
collections = ansible-collections;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Radically simple IT automation";
|
|
||||||
homepage = "https://www.ansible.com";
|
|
||||||
license = licenses.gpl3Plus;
|
|
||||||
maintainers = with maintainers; [ hexa ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
|
, ansible
|
||||||
, cryptography
|
, cryptography
|
||||||
, jinja2
|
, jinja2
|
||||||
, junit-xml
|
, junit-xml
|
||||||
|
@ -21,12 +22,6 @@
|
||||||
, xmltodict
|
, xmltodict
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
ansible-collections = callPackage ./collections.nix {
|
|
||||||
version = "5.6.0";
|
|
||||||
sha256 = "sha256-rNMHMUNBVNo3bO7rQW7hVBzfuOo8ZIAjpVo0yz7K+fM=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "ansible-core";
|
pname = "ansible-core";
|
||||||
version = "2.12.5";
|
version = "2.12.5";
|
||||||
|
@ -49,8 +44,8 @@ buildPythonPackage rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
# depend on ansible-collections instead of the other way around
|
# depend on ansible instead of the other way around
|
||||||
ansible-collections
|
ansible
|
||||||
# from requirements.txt
|
# from requirements.txt
|
||||||
cryptography
|
cryptography
|
||||||
jinja2
|
jinja2
|
||||||
|
@ -77,10 +72,6 @@ buildPythonPackage rec {
|
||||||
# internal import errors, missing dependencies
|
# internal import errors, missing dependencies
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
passthru = {
|
|
||||||
collections = ansible-collections;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Radically simple IT automation";
|
description = "Radically simple IT automation";
|
||||||
homepage = "https://www.ansible.com";
|
homepage = "https://www.ansible.com";
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, pythonOlder
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, jsonschema
|
, jsonschema
|
||||||
|
@ -11,25 +12,30 @@
|
||||||
, textfsm
|
, textfsm
|
||||||
, ttp
|
, ttp
|
||||||
, xmltodict
|
, xmltodict
|
||||||
|
|
||||||
|
# optionals
|
||||||
, withJunos ? false
|
, withJunos ? false
|
||||||
, withNetbox ? false
|
, withNetbox ? false
|
||||||
|
|
||||||
, version
|
|
||||||
, sha256
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
let
|
||||||
pname = "ansible";
|
pname = "ansible";
|
||||||
inherit version;
|
version = "5.6.0";
|
||||||
|
in
|
||||||
|
buildPythonPackage {
|
||||||
|
inherit pname version;
|
||||||
format = "setuptools";
|
format = "setuptools";
|
||||||
|
|
||||||
|
disabled = pythonOlder "3.8";
|
||||||
|
|
||||||
src = fetchPypi {
|
src = fetchPypi {
|
||||||
inherit pname version sha256;
|
inherit pname version;
|
||||||
|
sha256 = "sha256-rNMHMUNBVNo3bO7rQW7hVBzfuOo8ZIAjpVo0yz7K+fM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# make ansible-base depend on ansible-collection, not the other way around
|
# we make ansible-core depend on ansible, not the other way around
|
||||||
sed -Ei '/ansible-(base|core)/d' setup.py
|
sed -Ei '/ansible-core/d' setup.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
propagatedBuildInputs = lib.unique ([
|
propagatedBuildInputs = lib.unique ([
|
|
@ -1,55 +0,0 @@
|
||||||
{ lib
|
|
||||||
, fetchPypi
|
|
||||||
, buildPythonPackage
|
|
||||||
, pycrypto
|
|
||||||
, paramiko
|
|
||||||
, jinja2
|
|
||||||
, pyyaml
|
|
||||||
, httplib2
|
|
||||||
, six
|
|
||||||
, netaddr
|
|
||||||
, dnspython
|
|
||||||
, jmespath
|
|
||||||
, dopy
|
|
||||||
, ncclient
|
|
||||||
, windowsSupport ? false
|
|
||||||
, pywinrm
|
|
||||||
}:
|
|
||||||
|
|
||||||
buildPythonPackage rec {
|
|
||||||
pname = "ansible";
|
|
||||||
version = "2.9.27";
|
|
||||||
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "sha256-R5FZ5Qs72Qkg0GvFlBDDpR0/m+m04QKeEdHkotBwVzY=";
|
|
||||||
};
|
|
||||||
|
|
||||||
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 = "https://www.ansible.com";
|
|
||||||
description = "Radically simple IT automation";
|
|
||||||
license = [ licenses.gpl3 ] ;
|
|
||||||
maintainers = with maintainers; [ joamaki costrouc hexa ];
|
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
{ python3Packages, fetchFromGitHub }:
|
|
||||||
|
|
||||||
rec {
|
|
||||||
ansible = ansible_2_12;
|
|
||||||
|
|
||||||
ansible_2_12 = python3Packages.toPythonApplication python3Packages.ansible-core;
|
|
||||||
|
|
||||||
ansible_2_11 = python3Packages.toPythonApplication (python3Packages.ansible-core.overridePythonAttrs (old: rec {
|
|
||||||
pname = "ansible-core";
|
|
||||||
version = "2.11.6";
|
|
||||||
|
|
||||||
src = python3Packages.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "sha256-k9UCg8fFtHbev4PcCJs/Z5uTmouae11ijSjar7s9MDo=";
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
|
|
||||||
ansible_2_10 = python3Packages.toPythonApplication python3Packages.ansible-base;
|
|
||||||
|
|
||||||
# End of support 2021/10/02, End of life 2021/12/31
|
|
||||||
ansible_2_9 = python3Packages.toPythonApplication python3Packages.ansible;
|
|
||||||
|
|
||||||
ansible_2_8 = throw "Ansible 2.8 went end of life on 2021/01/03 and has subsequently been dropped";
|
|
||||||
}
|
|
|
@ -74,6 +74,9 @@ mapAliases ({
|
||||||
amuleGui = throw "amuleGui was renamed to amule-gui"; # Added 2022-02-11
|
amuleGui = throw "amuleGui was renamed to amule-gui"; # Added 2022-02-11
|
||||||
amsn = throw "amsn has been removed due to being unmaintained"; # Added 2020-12-09
|
amsn = throw "amsn has been removed due to being unmaintained"; # Added 2020-12-09
|
||||||
angelfish = libsForQt5.plasmaMobileGear.angelfish; # Added 2021-10-06
|
angelfish = libsForQt5.plasmaMobileGear.angelfish; # Added 2021-10-06
|
||||||
|
ansible_2_11 = throw "Ansible 2.11 goes end of life in 2022/11 and can't be supported throughout the 22.05 release cycle"; # Added 2022-03-30
|
||||||
|
ansible_2_10 = throw "Ansible 2.10 went end of life in 2022/05 and has subsequently been dropped"; # Added 2022-03-30
|
||||||
|
ansible_2_9 = throw "Ansible 2.9 went end of life in 2022/05 and has subsequently been dropped"; # Added 2022-03-30
|
||||||
antimicro = throw "antimicro has been removed as it was broken, see antimicrox instead"; # Added 2020-08-06
|
antimicro = throw "antimicro has been removed as it was broken, see antimicrox instead"; # Added 2020-08-06
|
||||||
antimicroX = antimicrox; # Added 2021-10-31
|
antimicroX = antimicrox; # Added 2021-10-31
|
||||||
ardour_5 = throw "ardour_5 has been removed. see https://github.com/NixOS/nixpkgs/issues/139549"; # Added 2021-09-28
|
ardour_5 = throw "ardour_5 has been removed. see https://github.com/NixOS/nixpkgs/issues/139549"; # Added 2021-09-28
|
||||||
|
|
|
@ -14661,12 +14661,8 @@ with pkgs;
|
||||||
|
|
||||||
autoadb = callPackage ../misc/autoadb { };
|
autoadb = callPackage ../misc/autoadb { };
|
||||||
|
|
||||||
inherit (callPackage ../tools/admin/ansible { })
|
ansible = ansible_2_12;
|
||||||
ansible
|
ansible_2_12 = python3Packages.toPythonApplication python3Packages.ansible-core;
|
||||||
ansible_2_8
|
|
||||||
ansible_2_9
|
|
||||||
ansible_2_10
|
|
||||||
ansible_2_11;
|
|
||||||
|
|
||||||
ansible-lint = with python3.pkgs; toPythonApplication ansible-lint;
|
ansible-lint = with python3.pkgs; toPythonApplication ansible-lint;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ in
|
||||||
|
|
||||||
mapAliases ({
|
mapAliases ({
|
||||||
aioh2 = throw "aioh2 has been removed because it is abandoned and broken."; # Added 2022-03-30
|
aioh2 = throw "aioh2 has been removed because it is abandoned and broken."; # Added 2022-03-30
|
||||||
|
ansible-base = throw "ansible-base has been removed, because it is end of life"; # added 2022-03-30
|
||||||
anyjson = throw "anyjson has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18
|
anyjson = throw "anyjson has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18
|
||||||
asyncio-nats-client = nats-py; # added 2022-02-08
|
asyncio-nats-client = nats-py; # added 2022-02-08
|
||||||
bitcoin-price-api = throw "bitcoin-price-api has been removed, it was using setuptools 2to3 translation feautre, which has been removed in setuptools 58"; # added 2022-02-15
|
bitcoin-price-api = throw "bitcoin-price-api has been removed, it was using setuptools 2to3 translation feautre, which has been removed in setuptools 58"; # added 2022-02-15
|
||||||
|
|
|
@ -513,9 +513,7 @@ in {
|
||||||
|
|
||||||
ansi2html = callPackage ../development/python-modules/ansi2html { };
|
ansi2html = callPackage ../development/python-modules/ansi2html { };
|
||||||
|
|
||||||
ansible = callPackage ../development/python-modules/ansible/legacy.nix { };
|
ansible = callPackage ../development/python-modules/ansible { };
|
||||||
|
|
||||||
ansible-base = callPackage ../development/python-modules/ansible/base.nix { };
|
|
||||||
|
|
||||||
ansible-compat = callPackage ../development/python-modules/ansible-compat { };
|
ansible-compat = callPackage ../development/python-modules/ansible-compat { };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue