Files
PythonFlaskAusgaben/start.yml
jonnybravo a78d1589e8
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after -47s
run
2025-03-31 14:25:52 +02:00

37 lines
1.1 KiB
YAML

- name: Start PythonFlask
gather_facts: True
become: False
hosts: FlaskServer
# connection: local
vars:
project_folder: "/home/jonnybravo/.docker/pythonflask-ausgaben"
docker_project_name: "pythonflaskausgabe"
tasks:
- name: Copy all Files
copy:
src: "{{ playbook_dir }}/"
dest: "{{project_folder}}"
remote_src: True
- name: Start Docker COmpose
community.docker.docker_compose_v2:
project_src: "{{ project_folder }}"
project_name: "{{docker_project_name}}"
recreate: always
register: compose_output
#- name: Show output
# debug:
# var: compose_output
# - name: "check this"
# debug:
# msg:
# - "{{ compose_output.containers | selectattr('Service', 'equalto', 'python-app')| first }}"
- name: Verify that web and db services are running
ansible.builtin.assert:
that:
- pythonapp.State == 'running'
vars:
pythonapp: >-
{{ compose_output.containers | selectattr("Service","equalto", "python-app") | first }}