Skip to content

Commit f175015

Browse files
author
Colin Hoglund
authored
Merge pull request #3 from singleplatform-eng/fix_check_mode_for_package_installs
run set_fact tasks in check_mode
2 parents 616c108 + 7fb3ead commit f175015

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
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/build_source.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
- name: Install dependencies
4-
apt: name="{{item}}" state=latest update_cache=yes cache_valid_time=86400
4+
apt: name="{{item}}" update_cache=yes cache_valid_time=86400
55
with_items: "{{python_dependencies}}"
66

77
- name: Download python tarball

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}}"

tasks/main.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
include: install_pip.yml
2323
when: pip_installed.stat.exists == false
2424

25-
- name: Upgrade pip
26-
pip: name=pip state=latest executable="{{python_pip_path}}" umask="{{python_pip_umask}}"
27-
2825
- name: Add system pip.conf
2926
template:
3027
src: pip.conf.j2
@@ -35,8 +32,8 @@
3532
when: python_pip_config is defined
3633

3734
# Install packages
38-
- name: Install/upgrade virtualenv
39-
pip: name=virtualenv state=latest executable="{{python_pip_path}}" umask="{{python_pip_umask}}"
35+
- name: Install virtualenv
36+
pip: name=virtualenv executable="{{python_pip_path}}" umask="{{python_pip_umask}}"
4037
when: python_major_version == '2'
4138

4239
- name: Install global packages

0 commit comments

Comments
 (0)