+ Ansible script for sending up server fiesl to a vps
This commit is contained in:
parent
bb69c37a5a
commit
a0bf263014
49
aws/playbooks/update-service.yml
Normal file
49
aws/playbooks/update-service.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# This playbooks basically takes a build/ directory similar to what the Gitlab
|
||||||
|
# pipelines generate and uploads those files to the desired directory
|
||||||
|
---
|
||||||
|
- hosts: mainhost
|
||||||
|
remote_user: admin
|
||||||
|
vars:
|
||||||
|
app_dir: /opt/app
|
||||||
|
tasks:
|
||||||
|
- name: Build skeleton root directory
|
||||||
|
file:
|
||||||
|
path: '{{app_dir}}'
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Build skeleton css directory
|
||||||
|
file:
|
||||||
|
path: '{{app_dir}}/css'
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Build skeleton js directory
|
||||||
|
file:
|
||||||
|
path: '{{app_dir}}/js'
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Build skeleton templates directory
|
||||||
|
file:
|
||||||
|
path: '{{app_dir}}/templates'
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Update Binary installation
|
||||||
|
copy:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
with_items:
|
||||||
|
- { src: ../../build/static/css/style.css, dest: '{{app_dir}}/'}
|
||||||
|
- { src: ../../build/static/js/index.js, dest: '{{app_dir}}/js/'}
|
||||||
|
- { src: ../../build/static/js/category.js, dest: '{{app_dir}}/js/'}
|
||||||
|
- { src: ../../build/static/cantfindshit.jpg, dest: '{{app_dir}}/'}
|
||||||
|
- { src: ../../build/static/favicon.png, dest: '{{app_dir}}/'}
|
||||||
|
- { src: ../../build/templates/list.html.tera, dest: '{{app_dir}}/templates/list.html.tera'}
|
||||||
|
- { src: ../../build/templates/video.html.tera, dest: '{{app_dir}}/templates/video.html.tera'}
|
||||||
|
- { src: ../../build/Rocket.toml, dest: '{{app_dir}}/'}
|
||||||
|
- { src: ../../build/server, dest: '{{app_dir}}/'}
|
||||||
|
|
||||||
|
- name: Restart web service
|
||||||
|
become: yes
|
||||||
|
become_method: sudo
|
||||||
|
service:
|
||||||
|
name: app
|
||||||
|
state: restarted
|
Loading…
Reference in New Issue
Block a user