I am going to give it a stab. So what you are describing is securing passwords in a vault. There are lots of ways you can do this. I like Window-Vault if you are doing something small. If you are using Ansible, Ansible-Vault works. Hashicorp makes a really good one too.
Now for storing. You could store passwords in a Password manager, like Bitwarden for instance. This would solve most of your problems.
To store passwords without a manager, ensure you have Encryption at rest, and Encryption in Transit. Encryption at rest is on the disk. Encryption in Transit is SSL/TLS.
You can store the passwords as a hash locally, but it isn't really that much more secure. As you stated, you can reverse the encryption if you can get physical access. Most choose to encrypt the disk and encrypt transit, and handle the rest via access to the machine or storage location via a user name and strong password (maybe a firewall too).
It isn't bad to store passwords in plain text somewhere. Eventually they have to be decrypted. The important thing is securing the storage location and the transit.