46 lines
1.1 KiB
YAML
Raw Normal View History

2022-11-12 15:30:59 +01:00
# tasks file for deploy-web
2022-11-12 20:45:00 +01:00
- name: "git archive {{ item }}"
2022-11-12 15:30:59 +01:00
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
2022-11-12 20:45:00 +01:00
with_items:
- "{{ project_name }}"
2022-11-12 15:30:59 +01:00
when: "project_name is defined"
2022-11-12 20:45:00 +01:00
- name: "Create directory {{ item }}"
2022-11-12 15:30:59 +01:00
file:
path: "/var/www/{{ item }}"
state: directory
owner: www-data
group: www-data
mode: '500'
2022-11-12 20:45:00 +01:00
with_items:
- "{{ project_name }}"
2022-11-12 15:30:59 +01:00
when: "project_name is defined"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-11-12 20:45:00 +01:00
- name: "Extract repo {{ item }}"
2022-11-12 15:30:59 +01:00
unarchive:
src: "/tmp/{{ item }}.tar.gz"
dest: "/var/www/{{ item }}"
owner: www-data
group: www-data
mode: '500'
2022-11-12 20:45:00 +01:00
with_items:
- "{{ project_name }}"
2022-11-12 15:30:59 +01:00
when: "project_name is defined"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"