---
- name: start filebeat
  shell: systemctl start filebeat
  sudo: true
- name: setsebook command
  shell: setsebool -P httpd_can_network_connect=1
  sudo: true
- name: kill current app process if needed
  shell: pkill supervisord
  sudo: true
  ignore_errors: yes
- name: start application
  shell: supervisord -c /data-act/backend/dataact{{ APP }}/config/supervisord.conf &
  sudo: true
  environment:
    PYTHONPATH: "/data-act/backend"
    env: "{{ ENV }}"
  args:
    chdir: /data-act/backend/dataact{{ APP }}/

---
- name: start filebeat
  shell: systemctl start filebeat
  sudo: true
- name: setsebook command
  shell: setsebool -P httpd_can_network_connect=1
  sudo: true
- name: create app log if it doesn't exist
  shell: touch /data-act/app.json-log
  ignore_errors: yes
- name: set owner of app log to ec2-user
  shell: chown ec2-user /data-act/app.json-log
  sudo: true
- name: kill current app process if needed
  shell: pkill supervisord
  sudo: true
  ignore_errors: yes
- name: start application
  shell: supervisord -c /data-act/backend/dataact{{ APP }}/config/supervisord.conf &
  sudo: true
  environment:
    PYTHONPATH: "/data-act/backend"
    env: "{{ ENV }}"
  args:
    chdir: /data-act/backend/dataact{{ APP }}/

Create app.son-log and set its ownership to ec2-user
Create app.son-log and set its ownership to ec2-user
