You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
#- name: Execute the flask init command
|
|
# ansible.builtin.shell: |
|
|
# source bootstrap.sh
|
|
# flask db init
|
|
# args:
|
|
# chdir: /opt/app/
|
|
# creates: actes_princiers.sqlite
|
|
# executable: /usr/bin/bash
|
|
|
|
#- name: Start the flask run application
|
|
# ansible.builtin.shell: |
|
|
# source bootstrap.sh
|
|
# flask run &
|
|
# args:
|
|
# chdir: /opt/app/
|
|
# executable: /usr/bin/bash
|
|
|
|
- name: Template a file to /etc/file.conf
|
|
ansible.builtin.template:
|
|
src: templates/princelyacts.service.jinja
|
|
dest: /etc/systemd/system/princelyacts.service
|
|
#owner: "{{ system_user }}"
|
|
#group: "{{ system_user }}"
|
|
mode: '0777'
|
|
|
|
- name: start systemd app service
|
|
systemd: name=princelyacts.service state=restarted enabled=yes
|
|
|
|
- name: check if flask app runs
|
|
ansible.builtin.shell: netstat -tulnp | grep :5000
|
|
register: flask_status
|
|
|
|
- name: check if flask app is up
|
|
ansible.builtin.assert:
|
|
that:
|
|
- flask_status != 0
|
|
fail_msg: "flask web application service is down (status:{!"
|
|
success_msg: "flask web application is up and running..."
|