Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after -56s
44 lines
1.2 KiB
YAML
44 lines
1.2 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: Create Folder
|
|
file:
|
|
path: "{{ project_folder }}"
|
|
state: directory
|
|
recurse: true
|
|
|
|
- name: Copy all Files
|
|
copy:
|
|
src: "{{ playbook_dir }}/files/"
|
|
dest: "{{project_folder}}"
|
|
owner: jonnybravo
|
|
# 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 }}
|