The following have not been implemented:
The absence of the ability to use a Mysql Config (my.cnf) file for connection config is bad for automation:
- it forces a password to be set in the command line
- it leads to the possibility that the password appears in logs and is shipped off somewhere
- it removes the ability to check if a password should change by detecting a change in the cnf file
As PMM user I need to be able to specify --defaults-file flag as a path to .cnf file so that I can skip passing --user-name and --password options while adding DB and they will be extracted from config file
- User able to specify a path to defaults file
- If username and password is passed along with defaults path, the flags have highest priority and values (username and password) from file are ignored
- Parsing defaults file should be done by pmm-agent****
Also, Feature should be available by API (for future UI improvements) and follow common logic - implement logic in pmm-agent, not pmm-admin
- this is username and password related. We are not adding support of other fields from config file
- If password changed - user need to re-add Service to the system, as it goes with usual --password/–username flags
Out of scope:
- Handling encrypted credentials.
- Add --defaults-file flag to pmm-admin add mysql command
- Add new field `defaults_file` to management API for MySQL
- Add new action to extract credentials from defaults file
- Extract username and password on pmm-agent side
- Use ini parser for it.
- Return Username and password from the action
- Save returned username and password to agent model
- Check connection
How to test:
1. Run PMM server.
2. Run MySQL.
3. Run PMM agent and prepare defaults file. e.g.:
Please remember to change credentials for proper one for MySQL database.
4. Use pmm-admin with --defaults-file parameter and path to file
5. You can replace username/password just to check if have highest priority:
6. It should throws credentials error during connection test