---

  - name: Upgrade and install minimum package set
    shell: "{{item}}"
    with_items:
      - yum clean all
      - yum -y upgrade
      - yum -y install {{ minimal_packages['RedHat'] | join (" ") }}

  - name: Set multi-user target as the default systemd target
    file: src=/lib/systemd/system/multi-user.target dest={{item}}
      state=link force=yes
    with_items:
      - /lib/systemd/system/default.target
      - /etc/systemd/system/default.target

  - name: Copy /etc/skel into /root
    shell: rsync -av /etc/skel/ /root/

  - name: Store journald logs only in RAM
    lineinfile: dest=/etc/systemd/journald.conf line="Storage=volatile" state=present

  - name: Add live user (for testing)
    user: name=live shell=/bin/bash groups=wheel append=yes
      password="$6$uf0amHdCN0H8PwWk$zKoAF4khAjunE/pnq0Q4iMU69t7gj2mvaKku3YE5k3/bVl.H9DcwOnlqBY23yTTcidp2CjknV38rgSro62vpC/"

  - name: Enable logrotate compression
    lineinfile: dest=/etc/logrotate.conf
        regexp="^compress"
        insertafter="^#compress"
        line="compress"
        state=present

  - name: Enable daily log rotation
    lineinfile: dest=/etc/logrotate.conf
        regexp="^weekly"
        line="daily"
        backrefs=yes
        state=present

---

  - name: Upgrade and install minimum package set
    shell: "{{item}}"
    with_items:
      - yum -y upgrade
      - yum -y install {{ minimal_packages['RedHat'] | join (" ") }}

  - name: Set multi-user target as the default systemd target
    file: src=/lib/systemd/system/multi-user.target dest={{item}}
      state=link force=yes
    with_items:
      - /lib/systemd/system/default.target
      - /etc/systemd/system/default.target

  - name: Copy /etc/skel into /root
    shell: rsync -av /etc/skel/ /root/

  - name: Store journald logs only in RAM
    lineinfile: dest=/etc/systemd/journald.conf line="Storage=volatile" state=present

  - name: Add live user (for testing)
    user: name=live shell=/bin/bash groups=wheel append=yes
      password="$6$uf0amHdCN0H8PwWk$zKoAF4khAjunE/pnq0Q4iMU69t7gj2mvaKku3YE5k3/bVl.H9DcwOnlqBY23yTTcidp2CjknV38rgSro62vpC/"

  - name: Enable logrotate compression
    lineinfile: dest=/etc/logrotate.conf
        regexp="^compress"
        insertafter="^#compress"
        line="compress"
        state=present

  - name: Enable daily log rotation
    lineinfile: dest=/etc/logrotate.conf
        regexp="^weekly"
        line="daily"
        backrefs=yes
        state=present

Remove spurious "yum clean all"
Remove spurious "yum clean all"
