Skip to content

Commit 82a3051

Browse files
authored
Merge pull request #8 from singleplatform-eng/Bugfix_multiple_packages_with_same_name
use apt-cache policy to determined installed major version
2 parents 96af67a + 282af94 commit 82a3051

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/install_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
apt: name={{python_package_name}} update_cache=yes cache_valid_time=86400
1616

1717
- name: Get python version
18-
shell: "apt-cache show {{python_package_name}} | grep 'Version:' | awk '{print $2}' | cut -d. -f1"
18+
shell: "apt-cache policy {{python_package_name}} | grep 'Installed:' | awk '{print $2}' | cut -d. -f1"
1919
check_mode: no
2020
register: python_version_output
2121
changed_when: False #This just polls the system for information and doesn't change system information

0 commit comments

Comments
 (0)