Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
borgbackup_client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSI Ansible
borgbackup_client
Commits
1bdfe4cf
Verified
Commit
1bdfe4cf
authored
3 years ago
by
David Mehren
Browse files
Options
Downloads
Patches
Plain Diff
Make more target details configurable
parent
73264667
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+3
-0
3 additions, 0 deletions
defaults/main.yml
tasks/main.yml
+2
-2
2 additions, 2 deletions
tasks/main.yml
tasks/onserver.yml
+8
-8
8 additions, 8 deletions
tasks/onserver.yml
templates/config.yaml.j2
+1
-1
1 addition, 1 deletion
templates/config.yaml.j2
with
14 additions
and
11 deletions
defaults/main.yml
+
3
−
0
View file @
1bdfe4cf
---
borgbackup_target_group
:
borgbackup
borgbackup_target_user
:
borgbackup
borgbackup_compression
:
"
zstd"
borgbackup_exclude_dirs
:
-
sh:/home/*/.gvfs
...
...
@@ -30,6 +32,7 @@ borgbackup_exclude_dirs:
-
sh:/home/*/**/bower_components
borgbackup_pool
:
"
/mnt/borgpool"
borgbackup_repo_path
:
"
backup"
borgbackup_keep_within
:
7d
borgbackup_keep_daily
:
21
borgbackup_keep_weekly
:
8
...
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
2
−
2
View file @
1bdfe4cf
...
...
@@ -17,7 +17,7 @@
-
name
:
Check if Repo already exists
stat
:
path
:
"
{{
borgbackup_pool
}}/{{
ansible_hostname
}}/
backup
"
path
:
"
{{
borgbackup_pool
}}/{{
ansible_hostname
}}/
{{
borgbackup_repo_path
}}
"
register
:
repo
delegate_to
:
"
{{
borgbackup_target_host
}}"
...
...
@@ -37,7 +37,7 @@
key
:
"
{{
borgbackup_target_ip
}}
ssh-ed25519
{{
hostvars[borgbackup_target_host]['ansible_ssh_host_key_ed25519_public']
}}"
-
name
:
Create Borg Repo
command
:
"
borg
init
-e
repokey
borgbackup@{{
borgbackup_target_ip
}}:
backup
"
command
:
"
borg
init
-e
repokey
{{
borgbackup
_target_user
}}
@{{
borgbackup_target_ip
}}:
{{
borgbackup_repo_path
}}
"
environment
:
BORG_PASSPHRASE
:
"
{{
borgbackup_key
}}"
when
:
not repo.stat.exists
...
...
This diff is collapsed.
Click to expand it.
tasks/onserver.yml
+
8
−
8
View file @
1bdfe4cf
---
-
name
:
Create Group
group
:
name
:
"
borgbackup"
name
:
"
{{
borgbackup
_target_group
}}
"
ignore_errors
:
true
register
:
create_group
-
name
:
Create Group Fallback
command
:
addgroup borgbackup
command
:
"
addgroup
{{
borgbackup
_target_group
}}"
register
:
create_group_fallback
failed_when
:
-
create_group_fallback.rc !=
0
...
...
@@ -16,13 +16,13 @@
-
name
:
Create User
user
:
name
:
"
borgbackup"
group
:
"
borgbackup"
name
:
"
{{
borgbackup
_target_user
}}
"
group
:
"
{{
borgbackup
_target_group
}}
"
ignore_errors
:
true
register
:
create_user
-
name
:
Create User Fallback
command
:
adduser -D -G borgbackup
borgbackup
command
:
"
adduser
-D
-G
{{
borgbackup
_target_group
}}
{{
borgbackup_target_user
}}"
register
:
create_user_fallback
failed_when
:
-
create_user_fallback.rc !=
0
...
...
@@ -33,8 +33,8 @@
-
name
:
Set permissions
file
:
path
:
"
{{
item
}}"
owner
:
"
borgbackup"
group
:
"
borgbackup"
owner
:
"
{{
borgbackup
_target_user
}}
"
group
:
"
{{
borgbackup
_target_group
}}
"
mode
:
0700
state
:
directory
with_items
:
...
...
@@ -43,7 +43,7 @@
-
name
:
Add public key
authorized_key
:
user
:
"
borgbackup"
user
:
"
{{
borgbackup
_target_user
}}
"
key
:
"
{{
borgbackup_source_key
}}"
# yamllint disable-line rule:line-length
key_options
:
"
command=
\"
cd
{{
hostvars[borgbackup_target_host]['borgbackup_pool']
|
default(borgbackup_pool)
}}/{{
borgbackup_source_host
}};borg
serve
--restrict-to-path
{{
hostvars[borgbackup_target_host]['borgbackup_pool']
|
default(borgbackup_pool)
}}/{{
borgbackup_source_host
}}
\"
,restrict"
This diff is collapsed.
Click to expand it.
templates/config.yaml.j2
+
1
−
1
View file @
1bdfe4cf
...
...
@@ -7,7 +7,7 @@ location:
# Paths to local or remote repositories.
repositories:
- borgbackup@{{ borgbackup_target_ip }}:
backup
-
"{{
borgbackup
_target_user }}
@{{ borgbackup_target_ip }}:
{{ borgbackup_repo_path }}"
exclude_patterns:
{% for item in borgbackup_exclude_dirs %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment