47 lines
1.1 KiB
YAML

# 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_name }}.git"
dest: "/home/valentin/src/"
archive: "/tmp/{{ item.name }}.tar.gz"
force: yes
update: yes
when: "item.git_name is defined"
with_items:
- "{{ project }}"
- name: "Create directory "
file:
path: "/var/www/{{ item.git_name }}"
state: directory
owner: www-data
group: www-data
mode: '500'
when: "item.git_name is defined"
with_items:
- "{{ project }}"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: "Extract repo "
unarchive:
src: "/tmp/{{ item.git_name }}.tar.gz"
dest: "/var/www/{{ item.git_name }}"
owner: www-data
group: www-data
mode: '500'
when: "item.git_name is defined"
with_items:
- "{{ project }}"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"