From 7ab0a230ebdb901390ff131aee1682191d4be80a Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 7 Nov 2020 22:40:15 -0600 Subject: [PATCH] Add basic git repo cloning role For websites c: --- README.md | 2 -- roles/git/tasks/main.yml | 12 ++++++++++++ site.yml | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 roles/git/tasks/main.yml diff --git a/README.md b/README.md index a48d1a7..d5398c7 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ This branch is kinda-sorta a port of master, so it still needs to reach some for * Matrix(? Do I still want to keep this around? Is there a better alternative? Will my friends even use it?) -* Basic git cloning for websites - * My inane desktop setups * Which are part of the way there, mostly just need some off-the-wall stuff diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml new file mode 100644 index 0000000..9fc76d1 --- /dev/null +++ b/roles/git/tasks/main.yml @@ -0,0 +1,12 @@ +#!/usr/bin/env ansible-playbook +# vim:ft=ansible: +--- +- name: clone git repos + git: + accept_hostkey: yes + depth: "{{ item.depth | default(1, true) }}" + dest: "{{ item.dest }}" + force: "{{ item.force | default(false, true) }}" + repo: "{{ item.repo }}" + version: "{{ item.version | default('HEAD', true) }}" + loop: "{{ git_repos }}" diff --git a/site.yml b/site.yml index d00dca6..7751ae6 100755 --- a/site.yml +++ b/site.yml @@ -65,6 +65,8 @@ ProxyPass / http://127.0.0.1:3000/ nocanon retry=1 - servername: nc.test.desu.ltd documentroot: /var/www/html/nextcloud + - servername: test.desu.ltd + documentroot: /var/www/html/desu.ltd become: yes tags: [ web, apache ] - role: php @@ -76,6 +78,13 @@ - php-pgsql # For general DB stuff become: yes tags: [ web, php ] + - role: git + vars: + git_repos: + - repo: https://git.9iron.club/salt/desultd + dest: /var/www/html/desu.ltd + become: yes + tags: [ web, git ] - role: nextcloud vars: nextcloud_admin_user: admin