======
Automation scripts for turning up system configuration.
+
+Instructions
+------------
+
+```
+ansible-playbook turnup.yaml --extra-vars @<credentials_file>.yaml \
+ --extra-vars key_file=<path_to_fernet_key> --ask-vault-password
+```
--- /dev/null
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- hosts: servers
+ vars_files:
+ - sources.yaml
+ tasks:
+ - stat:
+ path: "{{ item.dest }}/{{ item.name }}"
+ with_items: "{{ files }}"
+ register: files_stats
+ - name: Finish if nothing is missing
+ meta: end_play
+ when: "files_stats.results | selectattr('stat.exists', 'equalto', False) \
+ | length == 0"
+ - name: Obtain an access token for Google Drive
+ include_tasks: gdrive_auth.yaml
+ vars:
+ redirect_uri: "urn:ietf:wg:oauth:2.0:oob"
+ scope: "https://www.googleapis.com/auth/drive.readonly"
+ - name: Download from Google Drive if missing
+ include_tasks: download.yaml
+ vars:
+ key: "{{ lookup('file', '{{ key_file }}') }}"
+ with_items: "{{ files }}"
+ when: "(item.dest + '/' + item.name) is not exists"