From 0d7f88263df8d3d995290d15100fff76552872ea Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Wed, 27 Sep 2023 23:17:59 +0200 Subject: [PATCH] Add a script for deploying password files. --- password_store.yaml | 22 ++++++++++++++++++++++ turnup.yaml | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 password_store.yaml diff --git a/password_store.yaml b/password_store.yaml new file mode 100644 index 0000000..89e396d --- /dev/null +++ b/password_store.yaml @@ -0,0 +1,22 @@ +# Copyright (c) 2023 Jakub Czajka +# 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 }}" diff --git a/turnup.yaml b/turnup.yaml index f7b38a9..b1c8a96 100644 --- a/turnup.yaml +++ b/turnup.yaml @@ -33,3 +33,6 @@ - name: Deploy website import_playbook: website.yaml + +- name: Deploy password store + import_playbook: password_store.yaml -- 2.39.5