Skip to content

Commit 8e42670

Browse files
authored
Allow to run the role in check mode (#31)
* Detect available mariadb version in check mode Make sure the task is executed even in check mode to populate package_version. * Skip python support in check mode Avoid the failure to detect pip because pip_requirements is not defined in check mode.
1 parent 181ce92 commit 8e42670

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tasks/detect_mariadb_version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
state: available
66
package_name: "{{ mariadb_server }}"
77
repository: "{{ 'MariaDB' if ansible_os_family | lower == 'redhat' and mariadb_use_external_repo else '' }}"
8+
check_mode: false
89
register: package_version
910

1011
- name: define mariadb version

tasks/install/python-support.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
when:
55
- mariadb_python_packages is defined
66
- mariadb_python_packages | length > 0
7+
- not ansible_check_mode
78
block:
89
- name: create pip requirements file
910
bodsch.core.pip_requirements:

0 commit comments

Comments
 (0)