This commit is contained in:
19
start.yml
19
start.yml
@@ -5,27 +5,26 @@
|
||||
connection: local
|
||||
vars:
|
||||
project_folder: "/home/jonnybravo/.docker/pythonflask-ausgaben"
|
||||
docker_project_name: "pythonflaskausgabe"
|
||||
tasks:
|
||||
- name: Finde all Files
|
||||
find:
|
||||
paths: "{{ playbook_dir }}"
|
||||
recurse: True
|
||||
register: find_output
|
||||
- debug:
|
||||
var: find_output.files
|
||||
- name: Copy all Files
|
||||
copy:
|
||||
src: "{{ playbook_dir }}/"
|
||||
dest: "{{project_folder}}"
|
||||
remote_src: True
|
||||
# loop:
|
||||
# - "{{ find_output.files }}"
|
||||
- name: Start Docker COmpose
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ project_folder }}"
|
||||
project_name: pythonflaskausgabe
|
||||
project_name: "{{docker_project_name}}"
|
||||
recreate: always
|
||||
register: compose_output
|
||||
- name: Show output
|
||||
debug:
|
||||
var: compose_output
|
||||
- name: Verify that web and db services are running
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- python-app.State == 'running'
|
||||
vars:
|
||||
python-app: >-
|
||||
{{ output.containers | selectattr("Service", "python-app") | first }}
|
||||
|
||||
Reference in New Issue
Block a user