Update roles/build_fastapi/tasks/main.yml

This commit is contained in:
2024-02-02 16:51:45 +08:00
parent 750523f69a
commit b32e400592

View File

@@ -34,6 +34,7 @@
path: "{{ build_root_abspath }}"
pull: false
tag: "{{ demobackend_version }}"
- name: run docker
community.docker.docker_container:
name: demobackend
@@ -42,16 +43,10 @@
image: "helloworld-fastapi:{{ demobackend_version }}"
ports:
- "8080:8080"
- name: wait for the api ready
wait_for:
host: 0.0.0.0
port: 8080
delay: 10
check_mode: false
- name: testing api locally
shell: "curl -k localhost:8080"
register: reg_curl_result
check_mode: false
- name: show curl result
debug:
msg: "{{ reg_curl_result.stdout }}"