|
|
|
@@ -13,6 +13,26 @@ prek_home := env("PREK_HOME", justfile_directory() / "var/prek") |
|
|
|
default: |
|
|
|
@{{ just_executable() }} --list --justfile "{{ justfile() }}" |
|
|
|
|
|
|
|
# Initialize inventory files |
|
|
|
inventory domain ip: |
|
|
|
#!/usr/bin/env sh |
|
|
|
VARS_DIR="inventory/host_vars/{{ domain }}" |
|
|
|
VARS_FILE="inventory/host_vars/{{ domain }}/vars.yml" |
|
|
|
HOSTS_FILE="inventory/hosts" |
|
|
|
|
|
|
|
mkdir -p "$VARS_DIR" |
|
|
|
cp examples/vars.yml "$VARS_FILE" |
|
|
|
cp examples/hosts inventory/hosts |
|
|
|
sed -i 's/^matrix_domain:.*/matrix_domain: {{ domain }}/' "$VARS_FILE" |
|
|
|
PASSWORD=`openssl rand -base64 64 | head -c 64`; \ |
|
|
|
sed -i "s#^matrix_homeserver_generic_secret_key:.*#matrix_homeserver_generic_secret_key: '$PASSWORD'#" "$VARS_FILE" |
|
|
|
sed -i 's/^matrix\.example\.com/{{ domain }}/' "$HOSTS_FILE" |
|
|
|
sed -i 's/ansible_host=<[^>]\+>/ansible_host={{ ip }}/' "$HOSTS_FILE" |
|
|
|
echo "Check and configure your files at:" |
|
|
|
echo $VARS_FILE |
|
|
|
echo $HOSTS_FILE |
|
|
|
|
|
|
|
|
|
|
|
# Pulls external Ansible roles |
|
|
|
roles: |
|
|
|
#!/usr/bin/env sh |
|
|
|
|