Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
update package to work with ansible >= 2.9 (#7)
Browse files Browse the repository at this point in the history
* Update install_packages_Debian.yml

Updated to fix:

[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use 
`name: ['git']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

* Update install_packages_RedHat.yml

Updated to fix

[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `name: "{{ item }}"`, please use 
`name: ['git']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

* Update main.yml
  • Loading branch information
jschanz authored Sep 1, 2020
1 parent 7fbda0d commit 6ba30fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions tasks/install_packages_Debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Install packages for Debian
apt: name={{ item }} state=present update_cache=yes cache_valid_time=86400
vars:
common_required_packages:
- git
apt: name={{ common_required_packages }} state=present update_cache=yes cache_valid_time=86400
when: ansible_pkg_mgr == 'apt'
with_items:
- git
7 changes: 4 additions & 3 deletions tasks/install_packages_RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Install dependency packages for RedHat
yum: name={{ item }} state=present
vars:
common_required_packages:
- git
yum: name={{ common_required_packages }} state=present
when: ansible_pkg_mgr == 'yum'
with_items:
- git
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- include: install_packages_Debian.yml
sudo: yes
become: yes
when: ansible_os_family == 'Debian'

- include: install_packages_RedHat.yml
sudo: yes
become: yes
when: ansible_os_family == 'RedHat'

- name: Clone liquidprompt
Expand Down

0 comments on commit 6ba30fb

Please sign in to comment.