Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-public
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
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
system
ansible-public
Commits
7a540360
Commit
7a540360
authored
3 years ago
by
Antoine SCHILDKNECHT
Browse files
Options
Downloads
Patches
Plain Diff
Fix MS rsync destination | refs
#35462
parent
9dcaa33a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/mediaserver/tasks/main.yml
+22
-22
22 additions, 22 deletions
roles/mediaserver/tasks/main.yml
with
22 additions
and
22 deletions
roles/mediaserver/tasks/main.yml
+
22
−
22
View file @
7a540360
...
...
@@ -91,8 +91,9 @@
creates
:
/etc/nginx/sites-available/mediaserver-{{ item.name }}.conf
throttle
:
1
-
name
:
synchronize configuration between servers
ignore_errors
:
true
# noqa ignore-errors
-
name
:
synchronize configuration between servers
# noqa 303
# Cannot use the ansible synchronization module, cause there is no way to set a destination IP intead of the destination ansible hostname
# noqa 303 = warn to use the synchronization module instead of rsync in the command module
when
:
-
groups['mediaserver'] | length >
1
-
inventory_hostname != groups['mediaserver'][0]
...
...
@@ -102,42 +103,41 @@
-
/etc/celerity
-
/etc/sysusers.d
-
/var/www
synchronize
:
src
:
"
{{
item
}}"
dest
:
"
{{
item
}}"
mode
:
push
copy_links
:
true
delete
:
true
recursive
:
true
set_remote_user
:
false
existing_only
:
true
command
:
|
rsync \
-avh \
-e "ssh -o StrictHostKeyChecking=no" \
--delete \
"{{ item }}/" \
"root@{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ item }}/"
notify
:
-
restart mediaserver
-
restart nginx
-
restart systemd-sysusers
delegate_to
:
"
{{
groups['mediaserver'][0]
}}"
changed_when
:
false
tags
:
mediaserver-synchronize
-
name
:
synchronize letsencrypt configuration between servers
ignore_errors
:
true
# noqa ignore-errors
-
name
:
synchronize letsencrypt configuration between servers
# noqa 303
# Cannot use the ansible synchronization module, cause there is no way to set a destination IP intead of the destination ansible hostname
# noqa 303 = warn to use the synchronization module instead of rsync in the command module
when
:
-
groups['mediaserver'] | length >
1
-
inventory_hostname != groups['mediaserver'][0]
-
letsencrypt_enabled | d(false)
loop
:
-
/etc/letsencrypt
synchronize
:
src
:
"
{{
item
}}"
dest
:
"
{{
item
}}"
mode
:
push
copy_links
:
true
delete
:
true
recursive
:
true
set_remote_user
:
false
existing_only
:
true
command
:
|
rsync \
-avh \
-e "ssh -o StrictHostKeyChecking=no" \
--delete \
"{{ item }}/" \
"root@{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ item }}/"
notify
:
-
restart nginx
delegate_to
:
"
{{
groups['mediaserver'][0]
}}"
changed_when
:
false
tags
:
mediaserver-synchronize
-
name
:
configure email sender address
...
...
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