I am trying to figure out a Barman-2.13 installation via Ansible from the source code from github as barman user inside /opt/barman (which also is the home of the barman user). I use the barman manual as a guideline.

The challenge I am facing is that I do not have root priviledges on the target (a rhel8 VM) and likewise can not use /etc/barman which is the default location for the barman.conf file.

How would you go about this? Or, in other words, where to put the barman.conf and have barman know about it? I wonder whether I have to adjust the setup.py for this?


The barman manual clearly states in several places that some commands must be run as the root user, for example:

Installing Barman is as easy. As root user simply type:
. . .
Then, as root simply type:

Simply put, if you do not already have this access to your VM, then you need to get it.
You might be able to get a "single-user" installation up and running without root/sudo access to the VM, but I seriously recommend you get yourself the Right Tools for the the Right Job.

  • you mean barman operation requires sudo, right? I have not gotten that far I have to admit.
    – vrms
    Nov 23 '21 at 9:41
  • Correct. At the very least, you ought to have it for installation and upgrades. I don't know if you need it for "day-to-day" operations.
    – Phill W.
    Nov 23 '21 at 10:11
  • well if you don't need it for day to day operations, then you don't need it. You just have to answer the question at hand here: "where to put the barman.conf & conf.d/* files else than /etc/barman?" The Installation runs through without sudo as barman user (i.e). Or am I misunderstanding something fundamentally?
    – vrms
    Nov 23 '21 at 12:36
  • @vrms: So how do you intend to /install/ the software? Package Managers are usually restricted for use by the root user only.
    – Phill W.
    Nov 26 '21 at 15:08
  • 1.) download and unpack the archive as the barman user, 2.) run ./setup.py with the --user flag ... should install barman in the home of the user running the script. As it is described in the installation from sources section of the manual
    – vrms
    Nov 27 '21 at 15:55

It looks like I found the answer here

in short ... a $HOME/.barman.conf (home dir of the barman user) overrides the default systemwide /etc/barman/barman.conf.

If things are set up this way you would not need sudo any longer. Neiterh for installing, nor operating barman I think.

If this is not accurate I am happy to hear arguments on why not.

  • Yes, I confirm that's the right approach (having designed that interface). I provided the explanation here: sourceforge.net/p/pgbarman/tickets/94/#b748/9e65 The idea of the /etc file is to be managed via configuration managers and as such we recommend that permissions stay as 'root'. Nothing/nobody prevents you from having one instance of Barman per system user, each with their own configuration files in the home directory and individual cron entries. ;) Nov 26 '21 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.