application: moving fix_git_index_permissions call out of deploy_revision block
postgresql: save role attribute
repmgr: stop repmgrd if server is not a slave
repmgr: create template only if server is slave