- name: Install matrix
import_playbook: server/matrix.yaml
+- name: Install metadata
+ import_playbook: server/metadata.yaml
+
- name: Install nginx
import_playbook: server/nginx.yaml
--- /dev/null
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- hosts: servers
+ tasks:
+ - name: Checkout configuration
+ command: |
+ git --work-tree=/srv/git --git-dir=/srv/git/metadata.git checkout main \
+ --force "*.git/*"
+ become: yes
+ - name: Checkout additional configuration
+ command: |
+ git --work-tree=/etc/sudoers.d --git-dir=/srv/git/metadata_prod.git \
+ checkout main --force "90-git*"
+ become: yes
+ - name: Install ansible
+ package:
+ name:
+ - ansible
+ state: latest
+ become: yes
+ - name: Find all post-receive scripts
+ find:
+ paths: "/srv/git"
+ recurse: yes
+ patterns: "post-receive"
+ register: post_receive_scripts
+ - name: Ensure correct permissions on the post-receive scripts
+ file:
+ path: "{{ item.path }}"
+ owner: git
+ group: git
+ mode: '0744'
+ become: yes
+ with_items: "{{ post_receive_scripts.files }}"
+ - name: Ensure correct permissions on the additional configuration
+ file:
+ path: "/etc/sudoers.d/90-git"
+ owner: root
+ group: root
+ mode: '0440'
+ become: yes
dest: "/srv/git"
owner: "git"
group: "www-data"
+ - name: "metadata_prod.git"
+ uid: "1L5G_bXUC2QduZlPLhS4-wmOTNMxwgCXq"
+ dest: "/srv/git"
+ owner: "git"
+ group: "www-data"
- name: "notify.git"
uid: "1JimiRQnm3drG8pSR_NrKs9q0ZXJ_KYzt"
dest: "/srv/git"