added ci/cd

This commit is contained in:
Alexander Detsch 2021-04-04 15:35:36 +02:00
parent b8bbfff381
commit e24b0f3660
6 changed files with 111 additions and 0 deletions

22
deployment/deployment.yml Normal file
View file

@ -0,0 +1,22 @@
---
- hosts: snickers-docker
gather_facts: no
vars:
verbose: false
compose_folder: "/mnt/docker-storage/radiator-web/"
tasks:
- name: Ensures {{ compose_folder }} dir exists
stat:
path: "{{ compose_folder }}docker-compose.yml"
register: file_details
- name: Fail if docker-compose file doesn't exist
fail:
msg: "docker-compose.yml doesn't exist in expected location (expected in {{ compose_folder }})"
when: not file_details.stat.exists
- name: Update container image
community.general.docker_compose:
project_src: "{{ compose_folder }}"
pull: yes

10
deployment/hosts.yml Normal file
View file

@ -0,0 +1,10 @@
all:
vars:
ansible_python_interpreter: /usr/bin/python3
hosts:
snickers-docker:
ansible_host: 192.168.200.11
ansible_port: 22
ansible_user: root
ansible_ssh_extra_args: '-o StrictHostKeyChecking=no'
ansible_ssh_common_args: '-o ProxyCommand="ssh -o StrictHostKeyChecking=no -i "${ANSIBLE_SSH_KEY_PRIVATE}" -W %h:%p root@vserver8.alex-detsch.de -p 52"'