-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore install_additional_packages.yml include
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 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
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,36 @@ | ||
--- | ||
- name: install {{gcloud_sdk_additional_package_names | join(' ')}} with default package manager | ||
action: "{{backcompat_pkg_mgr}} name={{item}}" | ||
sudo: yes | ||
register: result_install_additional | ||
until: result_install_additional|success | ||
# Workaround https://github.com/ansible/ansible/issues/16868 and | ||
# increase default retry count | ||
retries: 20 | ||
delay: 10 | ||
when: > | ||
gcloud_sdk_additional_package_names is defined and | ||
(backcompat_pkg_mgr == "yum" or backcompat_pkg_mgr == "apt") | ||
with_items: "{{ gcloud_sdk_additional_package_names }}" | ||
|
||
# Handle dnf case for Fedora | ||
- name: "check if {{gcloud_sdk_additional_package_names | join(' ')}} exists" | ||
command: "rpm -q {{gcloud_sdk_additional_package_names | join(' ')}}" | ||
changed_when: False | ||
ignore_errors: True | ||
register: package_exists_result | ||
when: gcloud_sdk_additional_package_names is defined and backcompat_pkg_mgr == "dnf" | ||
|
||
# Use command since dnf was only added as a module in ansible 1.9.0 | ||
- name: install {{gcloud_sdk_additional_package_names | join (' ')}} with dnf | ||
command: dnf install -y {{gcloud_sdk_additional_package_names | join(' ')}} | ||
sudo: yes | ||
register: result_install_additional_dnf | ||
until: result_install_additional_dnf|success | ||
# Workaround https://github.com/ansible/ansible/issues/16868 and | ||
# increase default retry count | ||
retries: 20 | ||
delay: 10 | ||
when: > | ||
gcloud_sdk_additional_package_names is defined and backcompat_pkg_mgr == "dnf" and | ||
package_exists_result|failed |
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