Skip to content
Snippets Groups Projects
Commit 0bcad88f authored by Lars Beckers's avatar Lars Beckers
Browse files

static-website: add basic role for static deployments

parent 14b744a0
No related branches found
No related tags found
No related merge requests found
---
static_websites: []
# - path: /var/www/website
# git_url: ''
# umask: 022
# git_version: HEAD
# deploy_key: "{{ inventory_dir }}/files/deploy-keys/website"
---
- name: ensure the deploy keys are available
copy:
src: "{{ item.deploy_key }}"
dest: "/root/.ssh/{{ item.deploy_key|basename }}"
owner: root
group: root
mode: 0600
when:
- item.deploy_key is defined
- item.deploy_key != ''
with_items: "{{ static_websites }}"
tags:
- static-website
# https://github.com/ansible/ansible/issues/27699
- name: ensure git module is able to clone
command: mount -o remount,exec /tmp
tags:
- static-website
- name: ensure we have up-to-date websites
git:
repo: "{{ item.git_url }}"
dest: "{{ item.path }}"
key_file: "/root/.ssh/{{ item.deploy_key|default(None, true)|basename or omit }}"
version: "{{ item.git_version|default('HEAD') }}"
umask: "{{ item.umask|default('022') }}"
with_items: "{{ static_websites }}"
tags:
- static-website
- name: ensure git module is not able to clone anymore
command: mount -o remount,noexec /tmp
tags:
- static-website
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment