Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package_facts add alias support (#83149)
* package_facts add alias support fixes #83143 Co-authored-by: Abhijeet Kasurde <[email protected]>
- Loading branch information
Showing
3 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- package_facts module now supports using aliases for supported package managers, for example managers=yum or managers=dnf will resolve to using the underlying rpm. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,5 @@ | ||
# Test playbook for the package_facts module | ||
# (c) 2017, Adam Miller <[email protected]> | ||
|
||
# This file is part of Ansible | ||
# | ||
# Ansible is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Ansible is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. | ||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# Copyright: Contributors to the Ansible project | ||
|
||
- name: Prep package_fact tests - Debian Family | ||
block: | ||
|
@@ -65,6 +50,19 @@ | |
that: ansible_facts.packages is defined | ||
when: (ansible_os_family == "openSUSE Leap") or (ansible_os_family == "Suse") | ||
|
||
- name: Same as those above, but based on pkg_mgr, tests aliases | ||
block: | ||
- name: Gather package facts | ||
package_facts: | ||
manager: '{{ ansible_facts["pkg_mgr"] }}' | ||
|
||
- name: check for ansible_facts.packages exists | ||
assert: | ||
that: | ||
- ansible_facts.packages is defined | ||
- ansible_facts.packages | length > 1 | ||
when: ansible_facts['os_family'] in ["openSUSE Leap", "Suse", "RedHat", "Debian"] | ||
|
||
# Check that auto detection works also | ||
- name: Gather package facts | ||
package_facts: | ||
|