-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4522aa8
commit b68a58e
Showing
9 changed files
with
1,123 additions
and
861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
--- | ||
target_os: ubuntu | ||
hostname: identity | ||
|
||
### Install packages with grog.package | ||
package_list: | ||
- name: sudo | ||
- name: git | ||
- name: curl | ||
- name: restic | ||
- name: wget | ||
|
||
pull_backup: false | ||
lnxlink_diskuse: true | ||
|
||
### Bash Aliases | ||
|
||
bash_docker: true | ||
bash_autorestic: true | ||
bash_systemctl: true | ||
bash_apt: true | ||
|
||
### Autorestic Config | ||
autorestic_config_user: "{{ main_username}}" | ||
autorestic_user_directory: /home/"{{ main_username}}" | ||
autorestic_run_check: false | ||
autorestic_config_yaml: | ||
version: 2 | ||
backends: | ||
local_docker: | ||
type: rest | ||
path: 'http://192.168.1.5:8500/identity' | ||
key: "{{ secret_restic_repo_password }}" | ||
rest: | ||
user: "{{ secret_restic_rest_user }}" | ||
password: "{{ secret_restic_rest_password }}" | ||
locations: | ||
docker: | ||
from: '/home/{{ main_username }}/docker' | ||
to: | ||
- local_docker | ||
options: | ||
forget: | ||
keep-daily: 1 | ||
keep-weekly: 4 | ||
keep-monthly: 2 | ||
|
||
### Cronjobs | ||
cronjobs: | ||
- name: Restic Prune | ||
job: /usr/local/bin/runitor -uuid {{ secret_hc_restic_prune_virtuosity }} -- /usr/local/bin/autorestic forget -a -- prune | ||
user: "{{ main_username }}" | ||
minute: 20 | ||
hour: 22 | ||
weekday: 1 | ||
- name: Restic Check | ||
job: /usr/local/bin/runitor -uuid {{ secret_hc_restic_check_virtuosity }} -- /usr/local/bin/autorestic exec -a -- check | ||
user: "{{ main_username }}" | ||
minute: 20 | ||
hour: 2 | ||
day: 1 | ||
- name: Media Backup | ||
job: /usr/local/bin/runitor -uuid {{ secret_hc_restic_backup_virtuosity }} -- /usr/local/bin/autorestic backup -a -c /home/{{ main_username }}/.autorestic.yml | ||
user: root | ||
minute: 20 | ||
hour: 0 | ||
|
||
### Docker-Compose with ironicbadger.docker_compose_generator | ||
appdata_path: "/home/{{ main_username }}/docker" | ||
containers: | ||
### | ||
- service_name: dawarich-app | ||
container_name: dawarich-app | ||
active: true | ||
image: freikin/dawarich:0.13.6 | ||
restart: unless-stopped | ||
volumes: | ||
- "{{ appdata_path }}/dawarich/gem:/usr/local/bundle/gems" | ||
- "{{ appdata_path }}/dawarich/public:/var/app/public" | ||
stdin_open: true | ||
tty: true | ||
entrypoint: dev-entrypoint.sh | ||
command: bin/dev | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
- RAILS_ENV=development | ||
- REDIS_URL=redis://dawarich-redis:6379/0 | ||
- DATABASE_HOST=dawarich-db | ||
- DATABASE_USERNAME=dawarich | ||
- DATABASE_PASSWORD={{ secret_dawarich_db_pass }} | ||
- DATABASE_NAME=dawarich | ||
- MIN_MINUTES_SPENT_IN_CITY=60 | ||
- APPLICATION_HOST=localhost | ||
- APPLICATION_HOSTS=localhost | ||
- TIME_ZONE={{ ntp_timezone }} | ||
- APPLICATION_PROTOCOL=http | ||
- DISTANCE_UNIT=mi | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "100m" | ||
max-file: "5" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.50' # Limit CPU usage to 50% of one core | ||
memory: '2G' # Limit memory usage to 2GB | ||
include_global_env_vars: false | ||
### | ||
- service_name: dawarich-db | ||
container_name: dawarich-db | ||
active: true | ||
image: postgres:15.8-alpine | ||
restart: always | ||
volumes: | ||
- "{{ appdata_path }}/dawarich/db:/var/lib/postgresql/data" | ||
- "{{ appdata_path }}/dawarich/shared:/var/shared" | ||
environment: | ||
- POSTGRES_DB=dawarich | ||
- POSTGRES_USER=dawarich | ||
- POSTGRES_PASSWORD={{ secret_dawarich_db_pass }} | ||
mem_limit: 200M | ||
include_global_env_vars: false | ||
### | ||
- service_name: dawarich-redis | ||
container_name: dawarich-redis | ||
active: true | ||
image: redis:7.4.0 | ||
restart: unless-stopped | ||
command: redis-server | ||
volumes: | ||
- "{{ appdata_path }}/dawarich/shared:/var/shared/redis" | ||
include_global_env_vars: false | ||
### | ||
- service_name: dawarich-sidekiq | ||
container_name: dawarich-sidekiq | ||
active: true | ||
image: freikin/dawarich:0.13.6 | ||
restart: unless-stopped | ||
volumes: | ||
- "{{ appdata_path }}/dawarich/gem:/usr/local/bundle/gems" | ||
- "{{ appdata_path }}/dawarich/public:/var/app/public" | ||
stdin_open: true | ||
tty: true | ||
entrypoint: dev-entrypoint.sh | ||
command: sidekiq | ||
environment: | ||
- RAILS_ENV=development | ||
- REDIS_URL=redis://dawarich-redis:6379/0 | ||
- DATABASE_HOST=dawarich-db | ||
- DATABASE_USERNAME=dawarich | ||
- DATABASE_PASSWORD={{ secret_dawarich_db_pass }} | ||
- DATABASE_NAME=dawarich | ||
- APPLICATION_HOST=localhost | ||
- APPLICATION_HOSTS=localhost | ||
- BACKGROUND_PROCESSING_CONCURRENCY=10 | ||
- APPLICATION_PROTOCOL=http | ||
- DISTANCE_UNIT=mi | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "100m" | ||
max-file: "5" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.50' # Limit CPU usage to 50% of one core | ||
memory: '2G' # Limit memory usage to 2GB | ||
include_global_env_vars: false | ||
### | ||
- service_name: portainer_agent | ||
container_name: portainer_agent | ||
active: true | ||
image: portainer/agent:2.21.0 | ||
restart: always | ||
ports: | ||
- 9001:9001 | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /var/lib/docker/volumes:/var/lib/docker/volumes | ||
environment: | ||
- AGENT_SECRET={{ secret_portainer_key }} | ||
include_global_env_vars: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
- name: create main user directories | ||
file: | ||
path: /home/{{ main_username }}/{{ item }} | ||
state: directory | ||
owner: "{{ main_username }}" | ||
group: "{{ main_groupname }}" | ||
loop: | ||
- docker | ||
- docker/dawarich | ||
|
||
### Backup Restore | ||
- name: Create restore script | ||
copy: | ||
dest: /home/{{ main_username }}/restore.sh | ||
owner: "{{ main_username }}" | ||
group: "{{ main_username }}" | ||
mode: +x | ||
content: | | ||
#!/bin/bash | ||
/usr/local/bin/autorestic restore -f -l docker --from local_docker --to / | ||
when: pull_backup == true | ||
- name: Run restore script | ||
command: /bin/bash ./restore.sh | ||
args: | ||
chdir: "/home/{{ main_username }}" | ||
when: pull_backup == true | ||
- name: Remove restore script | ||
file: | ||
path: /home/{{ main_username }}/restore.sh | ||
state: absent | ||
when: pull_backup == true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.