[add] ansible deploy

This commit is contained in:
2020-01-15 20:20:45 +03:00
parent 7f03514c3e
commit 527c6c53f6
15 changed files with 89 additions and 13 deletions

11
ansible/ansible.cfg Normal file
View File

@@ -0,0 +1,11 @@
[defaults]
hash_behaviour = merge
host_key_checking = False
#callback_whitelist = profile_tasks
display_skipped_hosts = False
stdout_callback = yaml
bin_ansible_callbacks = True
[ssh_connection]
pipelining = True
ssh_args = -o ForwardAgent=yes

14
ansible/deploy.yml Normal file
View File

@@ -0,0 +1,14 @@
---
- hosts: all
vars:
ansible_user: "{{ deploy_user }}"
roles:
- ansible-deploy
- build
post_tasks:
- include_role:
name: ansible-deploy
tasks_from: complete.yml
- include_role:
name: service
tasks_from: restart.yml

View File

@@ -0,0 +1,2 @@
all:
hosts: localhost

View File

@@ -0,0 +1,9 @@
---
project_name: puzzlez
project_user: holop
deploy_user: "{{ project_user }}"
deploy_project: "{{ project_name }}"
deploy_repo_url: "git@bitbucket.org:infernalgames/{{ project_name }}.git"
deploy_repo_version: master
deploy_npm: yes

View File

@@ -0,0 +1,4 @@
all:
hosts: shmyga.ru
vars:
config_src: "/home/holop/puzzlez/config.json"

5
ansible/requirements.yml Normal file
View File

@@ -0,0 +1,5 @@
---
- name: ansible-deploy
src: git@bitbucket.org:shmyga/ansible-deploy.git
version: master
scm: git

View File

@@ -0,0 +1,2 @@
config_src: "{{ deploy_release_dir }}/config.{{ inventory_hostname }}.json"
config_dest: "{{ deploy_release_dir }}/config.json"

View File

@@ -0,0 +1,11 @@
---
- name: "Copy config"
copy:
src: "{{ config_src }}"
dest: "{{ config_dest }}"
remote_src: true
- name: "Gulp build"
command: "{{ deploy_release_dir }}/node_modules/.bin/gulp default"
args:
chdir: "{{ deploy_release_dir }}"