From f7492556f92498e301d95ae46a46c334a9479e8f Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Tue, 19 Apr 2016 13:44:16 -0400 Subject: [PATCH] Ansible 2.x - Address deprecation warning of bare variables Ansible 2.2 will not allow "bare" variable references in with_* loops. See https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated for details. Change-Id: Ib71579d1e0f88d1acc0889cdd29a3fa89157b30e --- defaults/main.yml | 3 +++ tasks/rsyslog_client_install.yml | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 764a803..c1b4f8c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,6 +16,9 @@ ## APT Cache Options cache_timeout: 600 +rsyslog_client_apt_repos: [] + +# Example override to specify which repo the packages should come from # rsyslog_client_apt_repos: # - { repo: "ppa:adiscon/v8-stable", state: "present" } diff --git a/tasks/rsyslog_client_install.yml b/tasks/rsyslog_client_install.yml index 2ac5090..26c30f1 100644 --- a/tasks/rsyslog_client_install.yml +++ b/tasks/rsyslog_client_install.yml @@ -17,8 +17,7 @@ apt_repository: repo: "{{ item.repo }}" state: "{{ item.state }}" - with_items: rsyslog_client_apt_repos - when: rsyslog_client_apt_repos is defined + with_items: "{{ rsyslog_client_apt_repos }}" register: add_repos until: add_repos|success retries: 5 @@ -53,6 +52,6 @@ until: install_packages|success retries: 5 delay: 2 - with_items: rsyslog_client_apt_packages + with_items: "{{ rsyslog_client_apt_packages }}" tags: - rsyslog-client-apt-packages