Files
MyMovieDB/deploy_remote.yml
jonnybravo 15928cb91e
Some checks failed
Deploy to ras-dan-01 / deploy (push) Failing after -24s
try
2025-08-26 15:24:18 +02:00

61 lines
1.5 KiB
YAML

---
- name: Deploy and start Movie-DB Application
hosts: all
become: False
gather_facts: True
vars:
project_name: movie-db
install_dir: "/opt/{{ project_name }}"
tasks:
- name: Create installation directory
ansible.builtin.file:
path: "{{ install_dir }}"
state: directory
mode: '0755'
- name: Copy project files
ansible.builtin.copy:
src: "{{ item }}"
dest: "{{ install_dir }}/"
owner: root
group: root
mode: '0644'
with_items:
- cert.pem
- docker-compose.yml
- Dockerfile
- genre_list
- imdb_suche.py
- key.pem
- main.py
- moviedb_func.py
- regie_name.csv
- requirements.txt
- name: Copy templates directory
ansible.builtin.copy:
src: templates/
dest: "{{ install_dir }}/templates/"
owner: root
group: root
- name: Start application with Docker Compose
community.docker.docker_compose_v2:
project_src: "{{ install_dir }}"
project_name: "{{ project_name }}"
recreate: always
register: compose_output
- name: Verify that web and db services are running
ansible.builtin.assert:
that:
- movie-db-web in compose_output.services
- compose_output.services["movie-db-web"].state == "running"
- movie-db-db in compose_output.services
- compose_output.services["movie-db-db"].state == "running"