---
- name: Install
  yum: name=haproxy.x86_64 state=present

- name: Install socat
  yum: name=socat state=present

- name: enable service
  service: name=haproxy enabled=yes
  notify:
    - restart haproxy

- name: enable rsyslog
  service: name=rsyslog enabled=yes
  notify:
    - restart rsyslog

- name: enable syslog for haproxy
  lineinfile: dest=/etc/rsyslog.conf line="{{ item }}" insertafter="^# Provides UDP syslog reception"
  with_items:
    - "$ModLoad imudp"
    - "$UDPServerRun 514"
    - "$UDPServerAddress 127.0.0.1"
  notify: restart rsyslog

- name: configure the file in which haproxy-logging ends up
  copy: src=syslog_haproxy.conf dest=/etc/rsyslog.d/haproxy.conf mode=0644
  notify: reload rsyslog

- name: Copy config
  template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
  notify: reload haproxy


- name: start rsyslog
  service: name=rsyslog state=started

- name: start
  service: name=haproxy state=started

---
- name: Install
  yum: name=haproxy.x86_64 state=present

- name: Install socat
  yum: name=socat state=present

- name: enable service
  service: name=haproxy enabled=yes
  notify:
    - restart haproxy

- name: enable rsyslog
  service: name=rsyslog enabled=yes
  notify:
    - reload rsyslog

- name: enable syslog for haproxy
  lineinfile: dest=/etc/rsyslog.conf line="{{ item }}" insertafter="^# Provides UDP syslog reception"
  with_items:
    - "$ModLoad imudp"
    - "$UDPServerRun 514"
    - "$UDPServerAddress 127.0.0.1"
  notify: reload rsyslog

- name: configure the file in which haproxy-logging ends up
  copy: src=syslog_haproxy.conf dest=/etc/rsyslog.d/haproxy.conf mode=0644
  notify: reload rsyslog

- name: Copy config
  template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
  notify: reload haproxy


- name: start rsyslog
  service: name=rsyslog state=started

- name: start
  service: name=haproxy state=started

Fix call to syslogd restart
Fix call to syslogd restart