add stages
This commit is contained in:
parent
11d49e0ccb
commit
a647946652
43
roles/deploy-web/tasks/deploy.yml
Normal file
43
roles/deploy-web/tasks/deploy.yml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
# tasks file for deploy-web
|
||||||
|
|
||||||
|
- name: git archive {{ item }}
|
||||||
|
local_action:
|
||||||
|
module: git
|
||||||
|
repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ item }}.git"
|
||||||
|
dest: "/home/valentin/src/"
|
||||||
|
archive: "/tmp/{{ item }}.tar.gz"
|
||||||
|
force: yes
|
||||||
|
update: yes
|
||||||
|
with_items: "{{ project_name }}"
|
||||||
|
when: "project_name is defined"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create directory {{ item }}
|
||||||
|
file:
|
||||||
|
path: "/var/www/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: '500'
|
||||||
|
with_items: "{{ project_name }}"
|
||||||
|
when: "project_name is defined"
|
||||||
|
vars:
|
||||||
|
ansible_become: yes
|
||||||
|
ansible_become_method: sudo
|
||||||
|
ansible_become_password: "{{ sudo_password }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Extract repo {{ item }}
|
||||||
|
unarchive:
|
||||||
|
src: "/tmp/{{ item }}.tar.gz"
|
||||||
|
dest: "/var/www/{{ item }}"
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: '500'
|
||||||
|
with_items: "{{ project_name }}"
|
||||||
|
when: "project_name is defined"
|
||||||
|
vars:
|
||||||
|
ansible_become: yes
|
||||||
|
ansible_become_method: sudo
|
||||||
|
ansible_become_password: "{{ sudo_password }}"
|
@ -1,43 +1,3 @@
|
|||||||
---
|
- name: Deploy project_name
|
||||||
# tasks file for deploy-web
|
import_tasks: deploy.yml
|
||||||
|
tags: ["deploy"]
|
||||||
- name: git archive {{ item }}
|
|
||||||
local_action:
|
|
||||||
module: git
|
|
||||||
repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ item }}.git"
|
|
||||||
dest: "/home/valentin/src/"
|
|
||||||
archive: "/tmp/{{ item }}.tar.gz"
|
|
||||||
force: yes
|
|
||||||
update: yes
|
|
||||||
with_items: "{{ project_name }}"
|
|
||||||
when: "project_name is defined"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Create directory {{ item }}
|
|
||||||
file:
|
|
||||||
path: "/var/www/{{ item }}"
|
|
||||||
state: directory
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
with_items: "{{ project_name }}"
|
|
||||||
when: "project_name is defined"
|
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Extract repo {{ item }}
|
|
||||||
unarchive:
|
|
||||||
src: "/tmp/{{ item }}.tar.gz"
|
|
||||||
dest: "/var/www/{{ item }}"
|
|
||||||
owner: www-data
|
|
||||||
group: www-data
|
|
||||||
mode: '500'
|
|
||||||
with_items: "{{ project_name }}"
|
|
||||||
when: "project_name is defined"
|
|
||||||
vars:
|
|
||||||
ansible_become: yes
|
|
||||||
ansible_become_method: sudo
|
|
||||||
ansible_become_password: "{{ sudo_password }}"
|
|
Loading…
x
Reference in New Issue
Block a user