summaryrefslogtreecommitdiff
path: root/gnu/packages/admin.scm
diff options
context:
space:
mode:
authorAnkit Gadiya <git@argp.in>2026-06-03 22:25:21 +0530
committerSharlatan Hellseher <sharlatanus@gmail.com>2026-06-12 13:09:19 +0100
commitcc1beb930fcc95e01778b789a641b61e3a87cf30 (patch)
tree86c79608792525b417f10f9482d9100c055bfc2d /gnu/packages/admin.scm
parent2a5348bec4295a6bf79f304fde81a3a09d871b17 (diff)
gnu: ansible-core: Update to 2.21.0
* gnu/packages/admin.scm (ansible-core): Update to 2.21.0. [phases]{relax-requirements, replace-symlinks}: Remove phases. {patch-paths}: Add libxcrypt patching. {check} Updated to use the `ansible_test_cli_stub.py' directly. [native-inputs]: Add util-linux. [inputs]: Add libxcrypt. Relates-to: guix/guix!9065 Change-Id: Iccc11e37ed3fe7f46f073bb787364ee336482329 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/admin.scm')
-rw-r--r--gnu/packages/admin.scm47
1 files changed, 9 insertions, 38 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 608ca150959..5ba149784a5 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -3211,15 +3211,13 @@ specified directories.")
3211(define-public ansible-core 3211(define-public ansible-core
3212 (package 3212 (package
3213 (name "ansible-core") 3213 (name "ansible-core")
3214 ;; XXX: Starting from 2.18.1, Ansible requires Python 3.11 or newer on the 3214 (version "2.21.0")
3215 ;; controller, this is the latest version supporting 3.10.
3216 (version "2.17.7")
3217 (source 3215 (source
3218 (origin 3216 (origin
3219 (method url-fetch) 3217 (method url-fetch)
3220 (uri (pypi-uri "ansible_core" version)) 3218 (uri (pypi-uri "ansible_core" version))
3221 (sha256 3219 (sha256
3222 (base32 "1kysajyc0kh885dlba6aj0a2mnpcq06q09n3kcixdqn4sqsvgais")))) 3220 (base32 "0m7lhxdahzm5bkx5hiiia4ykzj55m1s9mhyff9r1r7w4s7id1k18"))))
3223 (build-system pyproject-build-system) 3221 (build-system pyproject-build-system)
3224 (arguments 3222 (arguments
3225 (list 3223 (list
@@ -3233,44 +3231,15 @@ specified directories.")
3233 "--num-workers" (number->string (parallel-job-count))) 3231 "--num-workers" (number->string (parallel-job-count)))
3234 #:phases 3232 #:phases
3235 #~(modify-phases %standard-phases 3233 #~(modify-phases %standard-phases
3236 (add-after 'unpack 'relax-requirements
3237 (lambda _
3238 (substitute* "requirements.txt"
3239 ;; resolvelib >= 0.5.3, < 1.1.0
3240 ((">= 0.5.3, < 1.1.0") ""))))
3241 ;; Several ansible commands (ansible-config, ansible-console, etc.)
3242 ;; are just symlinks to a single ansible executable. The ansible
3243 ;; executable behaves differently based on the value of sys.argv[0].
3244 ;; This does not work well with our wrap phase, and therefore the
3245 ;; following two phases are required as a workaround.
3246 (add-after 'unpack 'hide-wrapping
3247 (lambda _
3248 ;; Overwrite sys.argv[0] to hide the wrapper script from it.
3249 (substitute* "bin/ansible"
3250 (("import traceback" all)
3251 (string-append all "
3252import re
3253sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
3254")))))
3255 (add-before 'build 'set-HOME 3234 (add-before 'build 'set-HOME
3256 (lambda _ 3235 (lambda _
3257 ;; Otherwise Ansible fails to create its config directory. 3236 ;; Otherwise Ansible fails to create its config directory.
3258 (setenv "HOME" "/tmp"))) 3237 (setenv "HOME" "/tmp")))
3259 (add-after 'install 'replace-symlinks
3260 (lambda _
3261 ;; Replace symlinks with duplicate copies of the ansible
3262 ;; executable so that sys.argv[0] has the correct value.
3263 (with-directory-excursion (string-append #$output "/bin")
3264 (for-each
3265 (lambda (ansible-symlink)
3266 (delete-file ansible-symlink)
3267 (copy-file "ansible" ansible-symlink))
3268 (scandir "." (lambda (x)
3269 (and (eq? 'symlink (stat:type (lstat x)))
3270 (string-prefix? "ansible-" x)
3271 (string=? "ansible" (readlink x)))))))))
3272 (add-after 'unpack 'patch-paths 3238 (add-after 'unpack 'patch-paths
3273 (lambda _ 3239 (lambda _
3240 (substitute* "lib/ansible/_internal/_encryption/_crypt.py"
3241 (("lib_so = ctypes\\.util\\.find_library\\(lib_config\\.name\\)")
3242 (string-append "lib_so = \"" #$(this-package-input "libxcrypt") "/lib/libcrypt.so.1\"")))
3274 (substitute* "lib/ansible/module_utils/compat/selinux.py" 3243 (substitute* "lib/ansible/module_utils/compat/selinux.py"
3275 (("libselinux.so.1" name) 3244 (("libselinux.so.1" name)
3276 (string-append #$(this-package-input "libselinux") 3245 (string-append #$(this-package-input "libselinux")
@@ -3287,11 +3256,12 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
3287 (replace 'check 3256 (replace 'check
3288 (lambda* (#:key inputs outputs tests? test-flags #:allow-other-keys) 3257 (lambda* (#:key inputs outputs tests? test-flags #:allow-other-keys)
3289 (when tests? 3258 (when tests?
3259 (setenv "PYTHONPATH" (string-append "lib:test/lib:" (getenv "GUIX_PYTHONPATH")))
3290 ;; The test suite needs to be run with 'ansible-test', which 3260 ;; The test suite needs to be run with 'ansible-test', which
3291 ;; does some extra environment setup. Taken from 3261 ;; does some extra environment setup. Taken from
3292 ;; https://raw.githubusercontent.com/ansible/ansible/\ 3262 ;; https://raw.githubusercontent.com/ansible/ansible/\
3293 ;; devel/test/utils/shippable/shippable.sh. 3263 ;; devel/test/utils/shippable/shippable.sh.
3294 (apply invoke "python" "bin/ansible-test" test-flags))))))) 3264 (apply invoke "python" "test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py" test-flags)))))))
3295 (native-inputs 3265 (native-inputs
3296 (list openssh 3266 (list openssh
3297 openssl 3267 openssl
@@ -3303,9 +3273,10 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
3303 python-pytest-xdist 3273 python-pytest-xdist
3304 python-pytz 3274 python-pytz
3305 python-setuptools 3275 python-setuptools
3306 python-wheel)) 3276 util-linux))
3307 (inputs ;optional dependencies captured in wrap scripts 3277 (inputs ;optional dependencies captured in wrap scripts
3308 (list libselinux 3278 (list libselinux
3279 libxcrypt
3309 sshpass)) 3280 sshpass))
3310 (propagated-inputs ;core dependencies listed in egg-info/requires.txt 3281 (propagated-inputs ;core dependencies listed in egg-info/requires.txt
3311 (list python-cryptography 3282 (list python-cryptography