]> git.ekhem.eu.org Git - turnup.git/commitdiff
Add a script for deploying password files.
authorJakub Czajka <jakub@ekhem.eu.org>
Wed, 27 Sep 2023 21:17:59 +0000 (23:17 +0200)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
password_store.yaml [new file with mode: 0644]
turnup.yaml

diff --git a/password_store.yaml b/password_store.yaml
new file mode 100644 (file)
index 0000000..89e396d
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- hosts: servers
+  vars:
+    repos:
+      - /srv/git/password_store.git
+    dest: "/srv/prod/password_store"
+  tasks:
+    - name: Ensure destination directory exists
+      file:
+        path: "{{ dest }}"
+        mode: 0775
+        state: directory
+        owner: git
+        group: git
+      become: true
+    - name: Checkout files to the destination directory
+      command: |
+        git --work-tree={{ dest }} --git-dir={{ item }} checkout master --force
+      become: yes
+      with_items: "{{ repos }}"
index f7b38a9b77c31409d21b92e11334ebc183135a9b..b1c8a96ef834b064f9bb87f484da137443725cd5 100644 (file)
@@ -33,3 +33,6 @@
 
 - name: Deploy website
   import_playbook: website.yaml
+
+- name: Deploy password store
+  import_playbook: password_store.yaml