---
- name: Install epel-release first
  package: name=epel-release state=present

- name: Install OS Dependencies (Redhat)
  package: name={{ item }} state=present
  with_items:
#    - epel-release
    - gcc
    - glibc-common
    - postgresql-devel
    - uwsgi
    - vixie-cron

- name: Start up cron
  service: name=crond state=started

- name: Add root as temporary sudoers
  lineinfile: "dest=/etc/sudoers regexp='^root' line='root ALL=(ALL)       NOPASSWD: ALL' state=present"

- name: Install environment to avoid problems with environment
  template: src=templates/environment dest=/etc/environment

- name: Install uwsgi init file
  template: src=templates/uwsgi dest=/etc/rc.d/init.d/uwsgi mode=0755
  notify: start uwsgi

- name: Setup miniconda path
  lineinfile: dest=/root/.{{ item }} regexp="miniconda2" line="PATH=/opt/miniconda2/bin:$PATH"
  with_items:
    - bashrc
    - bash_profile

- name: Add root as temporary sudoers
  lineinfile: "dest=/etc/sudoers regexp='^root' line='root ALL=(ALL)       NOPASSWD: ALL' state=present"

- name: Enable services for RedHat Server
  service: name=crond enabled=yes

---
- name: Install epel-release first
  package: name=epel-release state=present

- name: Install OS Dependencies (Redhat)
  package: name={{ item }} state=present
  with_items:
#    - epel-release
    - gcc
    - glibc-common
    - postgresql-devel
    - uwsgi
    - vixie-cron

- name: Start up cron
  service: name=crond state=started

- name: Add root as temporary sudoers
  lineinfile: "dest=/etc/sudoers regexp='^root' line='root ALL=(ALL)       NOPASSWD: ALL' state=present"

- name: Install environment to avoid problems with environment
  template: src=templates/environment dest=/etc/environment

- name: Install uwsgi init file
  template: src=templates/uwsgi dest=/etc/rc.d/init.d/uwsgi mode=0755
  notify: start uwsgi

- name: Setup miniconda path
  lineinfile: dest=/root/.{{ item }} regexp="miniconda2" line="PATH=/opt/miniconda2/bin:/opt/IBM/informix/bin:$PATH"
  with_items:
    - bashrc
    - bash_profile

- name: source bashrc
  shell: source {{ item }}
  with_items:
       - ~/.bashrc
       - ~/.bash_profile

- name: Add root as temporary sudoers
  lineinfile: "dest=/etc/sudoers regexp='^root' line='root ALL=(ALL)       NOPASSWD: ALL' state=present"

- name: Enable services for RedHat Server
  service: name=crond enabled=yes

Add /opt/IBM/informix to bashrc and bash_profile
Add /opt/IBM/informix to bashrc and bash_profile
