---

# Setup basic repositories and install basic packages.

# Prepare yum repositories
- yum:
    name={{item}}
    state=present
  with_items:
    - "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
  when: distro == "rhel7"

- yum:
    name={{item}}
    state=present
  with_items:
    - "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
  when: distro == "centos7"

# Install generic packages and tools we need to have everywhere.
- yum:
    pkg={{item}}
    state=present
  with_items:
    - screen
    - git
    - wget
    - unzip
    - iftop
    - make
    - ntp
    - gcc
    - python-yaml
    - MySQL-python
    - postfix
    - net-tools
    - patch
    - ncurses-term
    - vim
    - htop
    - iotop
    - sudo
    - yum-security
    - mailx



---

# Setup basic repositories and install basic packages.

# Prepare yum repositories
- yum:
    name={{item}}
    state=present
  with_items:
    - "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
  when: distro == "rhel7"

- yum:
    name={{item}}
    state=present
  with_items:
    - "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
  when: distro == "centos7"

- name: update caches
  yum: update_cache=yes

# Install generic packages and tools we need to have everywhere.
- yum:
    pkg={{item}}
    state=present
  with_items:
    - screen
    - git
    - wget
    - unzip
    - iftop
    - make
    - ntp
    - gcc
    - python-yaml
    - MySQL-python
    - postfix
    - net-tools
    - patch
    - ncurses-term
    - vim
    - htop
    - iotop
    - sudo
    - yum-security
    - mailx

- name: Update the system on first run
  yum: name=* state=latest
  when: first_run is defined


Update server on first run.
Update server on first run.
