From fe59adfd6bdafaa3c430fb27c87ded27afc6c1f9 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 13 May 2015 23:34:00 +0000 Subject: [PATCH] Re-work the cloud_setup_basic. --- tasks/cloud_setup_basic.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/tasks/cloud_setup_basic.yml b/tasks/cloud_setup_basic.yml index 19e34fee66..7c7ba4ebff 100644 --- a/tasks/cloud_setup_basic.yml +++ b/tasks/cloud_setup_basic.yml @@ -1,23 +1,19 @@ --- -- name: update all - command: yum -y update creates=/etc/sysconfig/global-update-applied - register: updated - tags: - - packages - name: ntp pkgs - action: yum state=present pkg={{ item }} + yum: state=present pkg={{ item }} with_items: - ntpdate - ntp - libsemanage-python - libselinux-python + when: ansible_distribution_major_version < '22' tags: - packages -- name: write out global-update-applied file if we updated - copy: content="updated" dest=/etc/sysconfig/global-update-applied - when: updated is defined +- name: ntp pkgs + command: dnf install -y ntpdate ntp libsemanage-python libselinux-python + when: ansible_distribution_major_version > '22' tags: - packages @@ -55,3 +51,22 @@ tags: - config +- name: update all + command: yum -y update creates=/etc/sysconfig/global-update-applied + register: updated + when: ansible_distribution_major_version < '22' + tags: + - packages + +- name: update all + command: dnf -y update creates=/etc/sysconfig/global-update-applied + register: updated + when: ansible_distribution_major_version > '21' + tags: + - packages + +- name: write out global-update-applied file if we updated + copy: content="updated" dest=/etc/sysconfig/global-update-applied + when: updated is defined + tags: + - packages