47 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
2022-12-19 23:46:55 +01:00
repo: "https://{{ git_username | urlencode }}:{{ git_password | urlencode }}@git.valczeryba.ovh/v4l3n71n/{{ item.name }}.git"
2022-11-12 15:30:59 +01:00
dest: "/home/valentin/src/"
2022-12-19 23:46:55 +01:00
archive: "/tmp/{{ item.name }}.tar.gz"
2022-11-12 15:30:59 +01:00
force: yes
update: yes
2022-12-19 23:46:55 +01:00
when: "item.name is defined"
2022-11-12 20:45:00 +01:00
with_items:
2022-12-19 23:46:55 +01:00
- "{{ project }}"
2022-11-12 15:30:59 +01:00
2022-12-19 23:46:55 +01:00
- name: "Create directory "
2022-11-12 15:30:59 +01:00
file:
2022-12-19 23:46:55 +01:00
path: "/var/www/{{ item.name }}"
2022-11-12 15:30:59 +01:00
state: directory
owner: www-data
group: www-data
mode: '500'
2022-12-19 23:46:55 +01:00
when: "item.name is defined"
2022-11-12 20:45:00 +01:00
with_items:
2022-12-19 23:46:55 +01:00
- "{{ project }}"
2022-11-12 15:30:59 +01:00
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
2022-12-19 23:46:55 +01:00
- name: "Extract repo "
2022-11-12 15:30:59 +01:00
unarchive:
2022-12-19 23:46:55 +01:00
src: "/tmp/{{ item.name }}.tar.gz"
dest: "/var/www/{{ item.name }}"
2022-11-12 15:30:59 +01:00
owner: www-data
group: www-data
mode: '500'
2022-12-19 23:46:55 +01:00
when: "item.name is defined"
2022-11-12 20:45:00 +01:00
with_items:
2022-12-19 23:46:55 +01:00
- "{{ project }}"
2022-11-12 15:30:59 +01:00
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"