-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flatcar] add python dependency check for helm-apps (#10192)
* add pyyaml install via task instead of package * Change condition for better consistency in the codebase
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 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
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,22 @@ | ||
--- | ||
- name: Get installed pip version | ||
command: "{{ ansible_python_interpreter if ansible_python_interpreter is defined else 'python' }} -m pip --version" | ||
register: pip_version_output | ||
ignore_errors: yes | ||
changed_when: false | ||
|
||
- name: Get installed PyYAML version | ||
command: "{{ ansible_python_interpreter if ansible_python_interpreter is defined else 'python' }} -m pip show PyYAML" | ||
register: pyyaml_version_output | ||
ignore_errors: yes | ||
changed_when: false | ||
|
||
- name: Install pip | ||
command: "{{ ansible_python_interpreter if ansible_python_interpreter is defined else 'python' }} -m ensurepip --upgrade" | ||
when: (pyyaml_version_output is failed) and (pip_version_output is failed) | ||
|
||
- name: Install PyYAML | ||
ansible.builtin.pip: | ||
name: | ||
- PyYAML | ||
when: (pyyaml_version_output is failed) |