Skip to content

Commit c4c5b60

Browse files
author
Colin Hoglund
committed
run set_fact tasks in check_mode
1 parent 616c108 commit c4c5b60

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

meta/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ galaxy_info:
44
company: SinglePlatform (http://www.singleplatform.com/)
55
license: BSD 3-Clause
66

7-
min_ansible_version: 2.1
7+
min_ansible_version: 2.2
88
platforms:
99
- name: Ubuntu
1010
versions:
@@ -14,6 +14,4 @@ galaxy_info:
1414
- all
1515

1616
galaxy_tags:
17-
- security
18-
- logrhythm
19-
- logging
17+
- python

tasks/install_package.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@
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}'"
18+
shell: "apt-cache show {{python_package_name}} | grep 'Version:' | awk '{print $2}' | cut -d. -f1"
19+
check_mode: no
1920
register: python_version_output
2021

2122
- name: Set python_major_version
2223
set_fact:
23-
python_major_version: "{{python_version_output.stdout_lines[0][0]}}"
24+
python_major_version: "{{python_version_output.stdout}}"
2425

2526
- name: Get python location
2627
command: "which python{{python_major_version}}"
28+
check_mode: no
2729
register: python_location_output
2830

2931
- name: Set python_path
3032
set_fact:
31-
python_path: "{{python_location_output.stdout_lines[0]}}"
33+
python_path: "{{python_location_output.stdout}}"

0 commit comments

Comments
 (0)