summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/apt.py
Commit message (Collapse)AuthorAgeFilesLines
* apt module, prevent tb from invalid type for pkg (#78666) (#78908)Brian Coca2022-09-291-3/+7
| | | | | | | * apt module, prevent tb from invalid type for pkg see #78663 (cherry picked from commit 7acd4f75c037974be7fa4e7eabe55152dfc57500)
* [2.13] apt - fix failure when package is not installed and only_upgrade=True ↵Sloane Hertel2022-09-291-1/+6
| | | | | | | | | | | | | | | (#78791) * apt - fix failure when package is not installed and only_upgrade=True (#78781) * apt - fix module failure when package is not installed and only_upgrade is True * changelog (cherry picked from commit 4b45b4b09d9257006f7b23237293c8c1a04521d8) * apt - fix module short-circuiting when a package is not installed and only_upgrade is True (cherry picked from commit 14f46845f9e74aac26aa54004c88a414926afc6a)
* Fix apt making changes in check mode (#78496) (#78530)Sloane Hertel2022-08-311-3/+4
| | | | | | | | | | | | | | | * Don't actually update the cache in check mode Add tests for updating the cache in check mode * Don't mark packages as manually installed in check mode and add a test for it * changelog * Update test/integration/targets/apt/tasks/apt.yml * fix test (cherry picked from commit 3add5e932178799f8409f3255f148260efa7b4ac)
* apt: include apt preferences (e.g. pinning) when selecting packages (#78327) ↵Sloane Hertel2022-08-311-16/+38
| | | | | | | | | (#78462) Fixes #77969 (cherry picked from commit 04e892757941bf77198692bbe37041d7a8cbf999) Co-authored-by: Patrick Hemmer <phemmer@users.noreply.github.com>
* Module/plugin docs: (#78380) (#78447)Felix Fontein2022-08-041-1/+6
| | | (cherry picked from commit 7e634f54c3b98372152a722ddf85919cf3f5fe86)
* apt: fix virtual package install version detection (#76781) (#77909)Brian Coca2022-06-081-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * apt: fix virtual package install version detection Change 4a62c4e3e44b01a904aa86e9b87206a24bd41fbc introduced version matching in installation. The problem stems from if version_installable or version: pkg_list.append("'%s=%s'" % (name, version_installable or version)) When the package is a virtual-package, package_status() is returning the "version_installable" of the package *satisfying* the virtual-package; but then this is trying to install the virtual-package with this version pin. For example, "yaml-mode" is a virtual package satisifed by "elpa-yaml-mode" (currently 0.0.14-1) and trying to install it fails with $ usr/bin/apt-get -y ... install 'yaml-mode=0.0.14-1' ... failed: E: Version '0.0.14-1' for 'yaml-mode' was not found ... In the case of a virtual-package with nothing installed to satisfy it, we should just return blank values to allow apt-get to do it's thing. The tests are updated to install and remove this package. Fixes: #76779 (cherry picked from commit e4c0bbf8858612133941c9d5a9bf14f90a62494c) Co-authored-by: Ian Wienand <iwienand@redhat.com>
* Fixes for type hinting issues. (#77170)Matt Clay2022-03-011-2/+1
|
* Add basic support for "apt-get clean" operation to apt module (#76758)gcagle32022-02-161-0/+38
| | | | | | * adding apt-get clean functionality documentation and example
* docs: add fqcn to module examples (#73546)Syed Ali Haider2022-01-261-20/+20
| | | Co-authored-by: Felix Fontein <felix@fontein.de>
* apt: add support for package version >= (#75002)Patrick Hemmer2022-01-111-59/+63
| | | | | | | | | This adds the ability to specify a package version using >=. This will ensure the package is at the specified version or above. * If the package is not installed, the latest version will be installed. * If the package is installed and less than the specified version, it will be upgraded. * If the package is installed and greater than or equal to the specified version, it will be left alone. The version selection is handled by Apt itself, so things like the system policy, pinning, etc, are considered.
* Remove shebangs from core Python modules. (#76664)Matt Clay2022-01-061-1/+0
| | | | | * Remove module shebangs. * Relax shebang check in validate-modules. * Add changelog fragment.
* Use correct markup in documentation (#76545)Felix Fontein2021-12-141-1/+1
|
* apt - add allow_change_held_packages option (#73629)Thomas Stähle2021-11-291-4/+24
| | | | | | | | | | | | | * Add changelog fragment and integration tests * Break up function signature into multiple lines It passed the 160 character width. Change it to multi-line for easier reading and better diffs in the future. * Remove unused import * Update version added for new feature * Move changelog fragment to correct location Co-authored-by: Thomas Stähle <thomas.staehle@check24.de> Co-authored-by: Sam Doran <sdoran@redhat.com>
* apt - remove obsolete documentation (#76243)Sam Doran2021-11-081-13/+1
| | | | The lock_timeout feature was recently added to the apt module making this section in the documentation no longer necessary
* The apt module won't work with python-apt < 0.8.9 (such as on Ubuntu 10.04) ↵Víctor A. Rodríguez2021-10-121-2/+2
| | | | | | (#75993) * Check if deb file to deploy has architectures attribute, fixes ansible#47277
* Add attributes 2/x (#75619)Brian Coca2021-09-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added attribute information to more modules rearranged the shared data platform revamped use 'details' and avoid overriding description Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/fail.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/debug.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/command.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/assert.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_core.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/gather_facts.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/include_vars.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/meta.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/modules/meta.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_common_attributes.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_common_attributes.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/plugins/doc_fragments/action_common_attributes.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> Co-authored-by: Felix Fontein <felix@fontein.de>
* apt module: add option to allow package downgrades (#74852)hyperreality2021-09-141-9/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | * apt module: add option to allow package downgrades * Add new option to module so users don't have to force downgrades which is insecure and dangerous * Add integration tests similar to upgrade integration tests * Changelog * Update changelog fragment * Update changelogs/fragments/74852-apt-allow-downgrade.yaml Co-authored-by: Amin Vakil <info@aminvakil.com> * Update lib/ansible/modules/apt.py Co-authored-by: Amin Vakil <info@aminvakil.com> * Update lib/ansible/modules/apt.py Co-authored-by: Amin Vakil <info@aminvakil.com> Co-authored-by: Amin Vakil <info@aminvakil.com>
* Add attributes a-c (#75561)Brian Coca2021-08-301-0/+7
| | | * removed redundant notes
* modules moved to use best_parsable_locale (#75250)Brian Coca2021-07-151-12/+14
| | | | | | | | | | | | | | | * modules moved to use best_parsable_locale * fixed invocations * better better * also module_utils * converted to function as per fb * patch testt * whitespace
* apt: Fix fail_json API call (#74444)Abhijeet Kasurde2021-04-281-1/+1
|
* added apt lock_timeout (#74095)Brian Coca2021-04-121-134/+152
| | | | | | | * added apt lock_timeout should help control issues with apt db being locked out also cleanup imports
* Fix wrong backup directory var name in apt module (#73840)Xabier Napal2021-03-221-1/+1
| | | * Fix wrong backup directory var name in apt module
* module compat for py3.8+ controller (#73423)Matt Davis2021-02-101-25/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * module compat for py3.8+ controller * replaced internal usages of selinux bindings with internal ctypes binding (allows basic selinux operations from any Python interpreter), plus tests * added new respawn_module API to allow modules to import Python packages that are only available under a well-known interpreter, plus tests * added respawn logic to modules that need Python libs from a specific system interpreter (apt, apt_repository, dnf, yum) minimize internal HAVE_SELINUX usage spurious junk pep8 * pylint fixes * add RHEL8 Python 3.8 testing * more pylint * import sanity * unit tests * changelog update * fix a bunch of stuff * tweak changelog * fix setup_rpm_repo on EL8 * misc sanity/test fixes * misc feedback tweaks * fix import fallback in test module * fix selinux MU test * fix dnf tests to avoid python-dependent test packages * add trailing LFs to aliases * fix yum tests to avoid test package with Python deps * hack create_repo for EL6 to create noarch package
* Documentation change to the apt module to reference lock files (#73079)Jon "The Nice Guy" Spriggs2021-01-081-0/+11
| | | | This change references the suggested workaround in #25414. Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
* Fix a typo in the documentation of ansible.builtin.apt (#73061)Louis Sautier2021-01-071-1/+1
|
* The implicit default for type=bool options is not 'false', but 'none' (#72699)Felix Fontein2020-12-041-1/+1
| | | | | * The implicit default for type=bool options is not 'false', but 'none'. * Fix modules, resp. add ignore.txt entries.
* fix simple typos (#72219)Adam Leskis2020-10-151-7/+7
|
* Reduce ignored module sanity tests (#70319)Amin Vakil2020-09-221-2/+11
| | | | | | | | | | | | | | | | | | | * Reorder test/sanity/ignore.txt to better see changes * Remove extra empty line causing pass fail * Apply suggestions made by Akasurde * Minor fix in package_facts and remove two unnecessary ignores * Fix subversion based on a suggestion made by felixfontein * Apply suggestions made by felixfontein and Andersson007 * Fix subversion.py as suggested by felixfontein * Minor reformatting in yum_repository description * Reformat changelog * Add key to apt_key, add deprecated changelog * Add PR url to changelog * Ignore paramater-type-not-in-doc in favour of adding key back to apt_key * Fix apt_key * Remove undocumented-paramater from apt_key ignore * Ignore doc-choices-do-not-match-spec in package_facts * Fix package_facts * Fix filter option in setup module
* apt - make errors more transparent (#70099)Andreas Schleifer2020-07-061-4/+4
| | | | | Include error from apt Python library in module error output Co-authored-by: Andreas Schleifer <aschleifer@bigpoint.net>
* apt - add fail_on_autoremove option to avoid unintended package removals ↵psi / Ryo Hirafuji2020-06-301-10/+38
| | | | | | | | (#70056) * Ensure not to remove existing packages while installing apt packages. * Make all lines shorter than 160 characters * Allow removing packages only when upgrading. * Add integration tests
* starting metadata sunset (#69454)Brian Coca2020-06-041-3/+0
| | | | | | | | | | | | | * starting metadata sunset - purged metadata from any requirements - fix indent in generic handler for yaml content (whey metadata display was off) - make more resilient against bad formed docs - removed all metadata from docs template - remove metadata from schemas - removed mdata tests and from unrelated tests Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Rick Elrod <rick@elrod.me>
* Fix example format in Ansible modules (#69509)Andrew Klychkov2020-05-281-1/+1
| | | | | | | * Fix example format in several Ansible modules * Update lib/ansible/modules/fail.py * Update lib/ansible/modules/pip.py Co-authored-by: Felix Fontein <felix@fontein.de>
* Flatten the directory hierarchy of modules (#68966)Matt Martz2020-05-131-0/+1232
* Flatten the directory hierarchy of modules * Update ignore.txt, flatten units * Update imports * Completely flatten the modules directory * Update sanity ignore * Fix some sanity test ignores * Fix relative import * Fix docs builds without category * ci_complete * Clean up docs. ci_complete * Adjust needs/file alias * ci_complete * fix hardcoded ping module paths Co-authored-by: Matt Davis <mrd@redhat.com>