From 1e67245f20fcb2f7b4e6af36535df251a518d64e Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 01:30:34 +0200 Subject: python3Packages.ansible-base: init at 2.10.9 --- pkgs/development/python-modules/ansible/base.nix | 75 ++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/ansible/base.nix (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/base.nix b/pkgs/development/python-modules/ansible/base.nix new file mode 100644 index 000000000000..73785a748174 --- /dev/null +++ b/pkgs/development/python-modules/ansible/base.nix @@ -0,0 +1,75 @@ +{ lib +, buildPythonPackage +, fetchPypi +, installShellFiles +, 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 = [ + # 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 ]; + }; +} -- cgit v1.2.3 From ff2e731acee32963b1646a50fa01bfc4f7c2d503 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 04:35:46 +0200 Subject: python3Packages.ansible-collections: init at 3.4.0 --- .../python-modules/ansible/collections.nix | 77 ++++++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/ansible/collections.nix (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/collections.nix b/pkgs/development/python-modules/ansible/collections.nix new file mode 100644 index 000000000000..52355142e26c --- /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 = "Radically simple IT automation"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 313bfe0ef74b..ed309e219317 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -413,6 +413,8 @@ in { ansible-base = callPackage ../development/python-modules/ansible/base.nix { }; + ansible-collections = callPackage ../development/python-modules/ansible/collections.nix { }; + ansible-kernel = callPackage ../development/python-modules/ansible-kernel { }; ansible-lint = callPackage ../development/python-modules/ansible-lint { }; -- cgit v1.2.3 From 95f3da5b6a0d901b1eb52ff08ca1284083c31e74 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 04:37:56 +0200 Subject: python3Packages.ansible-base: depend on ansible-collections --- pkgs/development/python-modules/ansible/base.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/base.nix b/pkgs/development/python-modules/ansible/base.nix index 73785a748174..f3470f80b50f 100644 --- a/pkgs/development/python-modules/ansible/base.nix +++ b/pkgs/development/python-modules/ansible/base.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , installShellFiles +, ansible-collections , cryptography , jinja2 , junit-xml @@ -41,6 +42,8 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ + # depend on ansible-collections instead of the other way around + ansible-collections # from requirements.txt cryptography jinja2 -- cgit v1.2.3 From 5281ae97c2b57a0a93d79394e70dc6643a70ded5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 04:39:05 +0200 Subject: ansible: 2.9.12 -> 2.10.9 --- .../development/python-modules/ansible/default.nix | 57 ---------------------- pkgs/development/python-modules/ansible/legacy.nix | 57 ++++++++++++++++++++++ pkgs/tools/admin/ansible/default.nix | 15 +----- pkgs/top-level/python-packages.nix | 2 +- 4 files changed, 59 insertions(+), 72 deletions(-) delete mode 100644 pkgs/development/python-modules/ansible/default.nix create mode 100644 pkgs/development/python-modules/ansible/legacy.nix (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/default.nix b/pkgs/development/python-modules/ansible/default.nix deleted file mode 100644 index 245375c26be0..000000000000 --- a/pkgs/development/python-modules/ansible/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ lib -, fetchFromGitHub -, buildPythonPackage -, pycrypto -, paramiko -, jinja2 -, pyyaml -, httplib2 -, six -, netaddr -, dnspython -, jmespath -, dopy -, ncclient -, windowsSupport ? false -, pywinrm -}: - -buildPythonPackage rec { - pname = "ansible"; - version = "2.9.12"; - - src = fetchFromGitHub { - owner = "ansible"; - repo = "ansible"; - rev = "v${version}"; - sha256 = "0c794k0cyl54807sh9in0l942ah6g6wlz5kf3qvy5lhd581zlgyb"; - }; - - 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 hexa ]; - platforms = platforms.linux ++ platforms.darwin; - }; -} diff --git a/pkgs/development/python-modules/ansible/legacy.nix b/pkgs/development/python-modules/ansible/legacy.nix new file mode 100644 index 000000000000..245375c26be0 --- /dev/null +++ b/pkgs/development/python-modules/ansible/legacy.nix @@ -0,0 +1,57 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, pycrypto +, paramiko +, jinja2 +, pyyaml +, httplib2 +, six +, netaddr +, dnspython +, jmespath +, dopy +, ncclient +, windowsSupport ? false +, pywinrm +}: + +buildPythonPackage rec { + pname = "ansible"; + version = "2.9.12"; + + src = fetchFromGitHub { + owner = "ansible"; + repo = "ansible"; + rev = "v${version}"; + sha256 = "0c794k0cyl54807sh9in0l942ah6g6wlz5kf3qvy5lhd581zlgyb"; + }; + + 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 hexa ]; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/pkgs/tools/admin/ansible/default.nix b/pkgs/tools/admin/ansible/default.nix index 58b2852baca3..7ed6d80bc1cc 100644 --- a/pkgs/tools/admin/ansible/default.nix +++ b/pkgs/tools/admin/ansible/default.nix @@ -3,20 +3,7 @@ rec { ansible = ansible_2_10; - # The python module stays at v2.9.x until the related package set has caught up. Therefore v2.10 gets an override - # for now. - ansible_2_10 = python3Packages.toPythonApplication (python3Packages.ansible.overridePythonAttrs (old: rec { - pname = "ansible"; - version = "2.10.0"; - - # TODO: migrate to fetchurl, when release becomes available on releases.ansible.com - src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; - sha256 = "0k9rs5ajx0chaq0xr1cj4x7fr5n8kd4y856miss6k01iv2m7yx42"; - }; - })); + ansible_2_10 = python3Packages.toPythonApplication python3Packages.ansible-base; ansible_2_9 = python3Packages.toPythonApplication python3Packages.ansible; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ed309e219317..3ecf4494ff4f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -409,7 +409,7 @@ in { ansi2html = callPackage ../development/python-modules/ansi2html { }; - ansible = callPackage ../development/python-modules/ansible { }; + ansible = callPackage ../development/python-modules/ansible/legacy.nix { }; ansible-base = callPackage ../development/python-modules/ansible/base.nix { }; -- cgit v1.2.3 From 7bd5cb5fb23ede52e7fac9759de4e37a66d876b4 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 04:48:07 +0200 Subject: ansible_2_9: 2.9.12 -> 2.9.21 --- pkgs/development/python-modules/ansible/legacy.nix | 4 ++-- pkgs/tools/admin/ansible/default.nix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/legacy.nix b/pkgs/development/python-modules/ansible/legacy.nix index 245375c26be0..2779feffee87 100644 --- a/pkgs/development/python-modules/ansible/legacy.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 = '' diff --git a/pkgs/tools/admin/ansible/default.nix b/pkgs/tools/admin/ansible/default.nix index 7ed6d80bc1cc..a211143cb007 100644 --- a/pkgs/tools/admin/ansible/default.nix +++ b/pkgs/tools/admin/ansible/default.nix @@ -5,6 +5,7 @@ rec { 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 = python3Packages.toPythonApplication (python3Packages.ansible.overridePythonAttrs (old: rec { -- cgit v1.2.3 From f46205d571c3597ebec54fd519cec83c2d5e33c7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 14 May 2021 03:02:03 +0200 Subject: python3Packages.ansible-collections: fix homepage --- pkgs/development/python-modules/ansible/collections.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development/python-modules/ansible') diff --git a/pkgs/development/python-modules/ansible/collections.nix b/pkgs/development/python-modules/ansible/collections.nix index 52355142e26c..9547b9a09187 100644 --- a/pkgs/development/python-modules/ansible/collections.nix +++ b/pkgs/development/python-modules/ansible/collections.nix @@ -70,7 +70,7 @@ buildPythonPackage rec { meta = with lib; { description = "Radically simple IT automation"; - homepage = "Radically simple IT automation"; + homepage = "http://www.ansible.com"; license = licenses.gpl3Plus; maintainers = with maintainers; [ hexa ]; }; -- cgit v1.2.3