Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository 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
mediaserver
envsetup
Commits
93b9eb58
Commit
93b9eb58
authored
4 years ago
by
Baptiste DE RENZO
Browse files
Options
Downloads
Patches
Plain Diff
Fix postgres maintenance playbook lint
parent
aecdc437
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
ansible/playbooks/postgres-maintenance.yml
+6
-6
6 additions, 6 deletions
ansible/playbooks/postgres-maintenance.yml
with
6 additions
and
6 deletions
ansible/playbooks/postgres-maintenance.yml
+
6
−
6
View file @
93b9eb58
...
...
@@ -23,13 +23,13 @@
when
:
rephacheck['stdout'] != "standby"
-
name
:
check if node is currently in standby
command
:
"
repmgr
standby
switchover
-f
/etc/postgresql/11/main/repmgr.conf
--siblings-follow
--dry-run"
become
:
yes
become
:
true
become_user
:
postgres
when
:
rephacheck['stdout'] == "standby"
register
:
standby_dry_run
-
name
:
switch standby node to primary
command
:
"
repmgr
standby
switchover
-f
/etc/postgresql/11/main/repmgr.conf
--siblings-follow"
become
:
yes
become
:
true
become_user
:
postgres
when
:
-
standby_dry_run is succeeded
...
...
@@ -51,10 +51,10 @@
file
:
path
:
/var/lib/postgresql/11/main/
state
:
absent
force
:
yes
force
:
true
-
name
:
copy data from primary
command
:
"
repmgr
-f
/etc/postgresql/11/main/repmgr.conf
--force
--verbose
standby
clone
-h
{{
hostvars[groups['postgres_primary'][0]]['ansible_default_ipv4']['address']
}}
-d
repmgr
-U
repmgr
-c"
become
:
yes
become
:
true
become_user
:
postgres
register
:
copy_from_primary
-
name
:
start postgresql
...
...
@@ -64,7 +64,7 @@
when
:
copy_from_primary is succeeded
-
name
:
register node as standby
command
:
"
repmgr
-f
/etc/postgresql/11/main/repmgr.conf
--force
--verbose
standby
register"
become
:
yes
become
:
true
become_user
:
postgres
when
:
copy_from_primary is succeeded
...
...
@@ -74,7 +74,7 @@
tasks
:
-
name
:
kill repmgrd
command
:
"
pkill
repmgrd"
ignore_errors
:
yes
ignore_errors
:
true
-
name
:
restart repmgrd
systemd
:
name
:
repmgrd
...
...
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