Commit Graph

56 Commits (208168ee4c1307ff4e71c071d5622f23379adbca)

Author SHA1 Message Date
Abhijeet Kasurde 208168ee4c
apt: add a note about extraneous quotes in package name (#82960)
* add a note for user to not to include extraneous single or double
  quotes while specifying package name with a specific version.

Fixes: #82763

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Abhijeet Kasurde 8fec1575e6
apt: handle options while installing python3-apt (#82913)
* apt: handle options while installing python3-apt

* While installing python3-apt library, honor parameter
  such as install_recommends and dpkg_options

Fixes: #40608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Review changes

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
Abhijeet Kasurde 56fa630e47
apt: Install recommended packages while installing deb files (#82805)
* install recommended packages while installing deb files and
  install_recommends is set to true.

Fixes: #29726

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 months ago
0x546f6d-W f02081b391
Fix discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True (#82800)
* added integration test for issue 82611 regarding discrepency between apt-get clean and ansible.builtin.apt: clean

* fixed new line issue

* Implementation of bug fix for 82611

Fixed discrepancy in behaviour between apt-get clean and its equivalent ansible.builtin.apt: clean=True

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
3 months ago
Abhijeet Kasurde dd44449b6e
Use of constant for 644 permission variable (#82762)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
3 months ago
Martin Krizek 975cf1655a
modules: remove PY2 compat (#81990) 5 months ago
Alicia Cozine d2812aeb6f
Update example in apt module docs (#82504)
All examples should use fully qualified collection names to avoid confusion.
5 months ago
Sloane Hertel 4760dae989
document apt auto-installed dep (#82503) 5 months ago
Deeptanshu Das 74f6e6a134
Update apt.py (#81975)
updating documentation
8 months ago
Matt Clay 9f899f9492
Require `from __future__ import annotations` (#81902) 8 months ago
Rose Jethani 7109d392fd
fixes spelling errors (#81814) 8 months ago
Abhijeet Kasurde 2e6d849bdb
apt: ignore fail_on_autoremove and allow_downgrade when using aptitude (#81445)
* apt: ignore fail_on_autoremove and allow_downgrade when using aptitude

* fail_on_autoremove (--no-remove) and allow_downgrade (--allow-downgrades)
  parameters are only valid for apt-get and not for aptitude. Ignore them when
  aptitude is detected and used.

Fixes: #77868
9 months ago
moscaluc 479928c199
Add missing use case with module purge (#81237)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Abhijeet Kasurde c5e54be5ea
apt: Return calculated diff while running apt clean (#81247)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
11 months ago
Felix Fontein 3e3fb26b35
Use semantic markup for modules. (#81190) 11 months ago
Matt Clay 2cd1744be3
Use ansible.module_utils.common.text.converters (#80704)
Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
1 year ago
Rodrigo Candido Gryzinski 64fb64643d
Fix PolicyRcD.__exit__ docstring (#80528) 1 year ago
Matt Clay 2fa8ee503c
Clean up unused imports in modules (#79898) 1 year ago
Sloane Hertel 11e43e9d6e
Set locale for python apt (#79546)
* set locale to get_best_parsable_locale for the python-apt API

* add a test case

* add changelog

* remove test that tests nothing
2 years ago
inifares23lab e2450d4886
added --allow-change-held-packages for apt remove (#78203)
* added --allow-change-held-packages for apt remove

* add tests for apt remove (allow_change_held_packages=yes)

* add changelog for apt remove (allow-change-held-packages=yes)

* update tests for apt remove (allow_change_held_packages=yes)
2 years ago
Alicia Cozine bfcb557777
replace yes/no with true/false in docstrings (#79274)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2 years ago
Brian Coca 7acd4f75c0
apt module, prevent tb from invalid type for pkg (#78666)
* apt module, prevent tb from invalid type for pkg

 see #78663
2 years ago
Sloane Hertel f26f3325ba
apt - fix module short-circuiting when a package is not installed and only_upgrade is True (#78790) 2 years ago
Sloane Hertel 4b45b4b09d
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
2 years ago
Matt Clay 69ceb31600
ansible-test - Update sanity test requirements. (#78528) 2 years ago
Sloane Hertel 3add5e9321
Fix apt making changes in check mode (#78496)
* 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
2 years ago
Patrick Hemmer 04e8927579
apt: include apt preferences (e.g. pinning) when selecting packages (#78327)
Fixes #77969
2 years ago
Felix Fontein 7e634f54c3
Module/plugin docs: (#78380) 2 years ago
Ian Wienand e4c0bbf885
apt: fix virtual package install version detection (#76781)
* apt: fix virtual package install version detection

Change 4a62c4e3e4 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
2 years ago
Matt Clay d31730d781
Fixes for type hinting issues. (#77170) 2 years ago
gcagle3 c688eb824b
Add basic support for "apt-get clean" operation to apt module (#76758)
* adding apt-get clean functionality

 documentation and example
2 years ago
Syed Ali Haider 6bca0a5dc2
docs: add fqcn to module examples (#73546)
Co-authored-by: Felix Fontein <felix@fontein.de>
2 years ago
Patrick Hemmer 4a62c4e3e4
apt: add support for package version >= (#75002)
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.
2 years ago
Matt Clay aa67ff2cf2
Remove shebangs from core Python modules. (#76664)
* Remove module shebangs.
* Relax shebang check in validate-modules.
* Add changelog fragment.
2 years ago
Felix Fontein 9d1898b1ef
Use correct markup in documentation (#76545) 3 years ago
Thomas Stähle cd2d8b77fe
apt - add allow_change_held_packages option (#73629)
* 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>
3 years ago
Sam Doran 54f64982fb
apt - remove obsolete documentation (#76243)
The lock_timeout feature was recently added to the apt module making
this section in the documentation no longer necessary
3 years ago
Víctor A. Rodríguez e53982cd09
The apt module won't work with python-apt < 0.8.9 (such as on Ubuntu 10.04) (#75993)
* Check if deb file to deploy has architectures attribute, fixes ansible#47277
3 years ago
Brian Coca c5d8dc0e11
Add attributes 2/x (#75619)
* 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>
3 years ago
hyperreality c3fc8fb99a
apt module: add option to allow package downgrades (#74852)
* 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>
3 years ago
Brian Coca 051a257092
Add attributes a-c (#75561)
* removed redundant notes
3 years ago
Brian Coca 61900c7672
modules moved to use best_parsable_locale (#75250)
* modules moved to use best_parsable_locale

* fixed invocations

* better better

* also module_utils

* converted to function as per fb

* patch testt

* whitespace
3 years ago
Abhijeet Kasurde b043afa025
apt: Fix fail_json API call (#74444) 3 years ago
Brian Coca bb7b17fded
added apt lock_timeout (#74095)
* added apt lock_timeout

should help control issues with apt db being locked out
also cleanup imports
3 years ago
Xabier Napal 2bff120db6
Fix wrong backup directory var name in apt module (#73840)
* Fix wrong backup directory var name in apt module
3 years ago
Matt Davis 4c5ce5a1a9
module compat for py3.8+ controller (#73423)
* 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
3 years ago
Jon "The Nice Guy" Spriggs d83200c530
Documentation change to the apt module to reference lock files (#73079)
This change references the suggested workaround in #25414.
Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
3 years ago
Louis Sautier 1b88234a3a
Fix a typo in the documentation of ansible.builtin.apt (#73061) 3 years ago
Felix Fontein 5226ac5778
The implicit default for type=bool options is not 'false', but 'none' (#72699)
* The implicit default for type=bool options is not 'false', but 'none'.

* Fix modules, resp. add ignore.txt entries.
4 years ago
Adam Leskis 39d6c5ef7a
fix simple typos (#72219) 4 years ago