diff --git a/meta/main.yml b/meta/main.yml index e086655..e9a77aa 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,7 +18,7 @@ galaxy_info: description: Rsyslog log client setup company: Rackspace license: Apache2 - min_ansible_version: 1.6.6 + min_ansible_version: 2.2 platforms: - name: Ubuntu versions: diff --git a/tasks/rsyslog_client_install.yml b/tasks/rsyslog_client_install.yml index edbe313..c9c26d0 100644 --- a/tasks/rsyslog_client_install.yml +++ b/tasks/rsyslog_client_install.yml @@ -13,17 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Ensure apt cache is up to date - apt: - update_cache: yes - cache_valid_time: "{{ cache_timeout }}" - when: - - ansible_pkg_mgr == 'apt' - - name: Install rsyslog packages package: pkg: "{{ item }}" state: "{{ rsyslog_client_package_state }}" + update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" + cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages|success retries: 5