removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg."
I've read the porting guide and a few posts here and on GitHub, but I can't use "items" in my case.
In my group_vars I define the defaults for the apt task:
apt_defaults:
cache_valid_time: 3600
install_recommends: no
update_cache: yes
In my script I refer to them:
- name: Install server and helper packages
apt: pkg={{item}} state=installed
args: "{{apt_defaults}}"
with_items:
- ntp
- curl
- git
- patch
- htop
...
vars:
apt_defaults: &apt_defaults
cache_valid_time: 3600
install_recommends: no
update_cache: yes
...
- name: Install server and helper packages
apt:
args:
<<: *apt_defaults
pkg: '{{item}}'
with_items:
- ntp
- curl
- git
- patch
- htop
...
vars:
apt_defaults: &apt_defaults
cache_valid_time: 3600
install_recommends: no
update_cache: yes
...
- name: Install server and helper packages
apt: pkg={{item}}
args: *apt_defaults
with_items:
- ntp
- curl
- git
- patch
- htop