Allow mysql_config_include_files to contain raw content#551
Allow mysql_config_include_files to contain raw content#551frazew wants to merge 1 commit intogeerlingguy:masterfrom
Conversation
|
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
|
I don't think this should be considered stale, it simply has not been reviewed yet but that's ok 😄 |
In some cases, specifying a known src path in `mysql_config_include_files` is not possible / complicated and it may be much cleaner to provide raw file content to be sent. In that case, we need to use the `ansible.builtin.copy` module. We can extend the current implementation by simply filtering on whether `src` or `content` is set in each item in `mysql_config_include_files`
49e7642 to
19f403e
Compare
|
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
|
Still relevant! Let's keep it open if that's ok |
|
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
|
This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. |
Summary
In some cases, specifying a known src path in
mysql_config_include_filesis not possible / complicated and it may be much cleaner to provide raw file content to be sent. In that case, we need to use theansible.builtin.copymodule. We can extend the current implementation by simply filtering on whethersrcorcontentis set in each item inmysql_config_include_filesThis PR also adds a label definition to the loop, that becomes necessary to avoid printing entire files with the default loop label
Example
For example if you want to use
mysql_config_include_fileswith a file stored inside another role (because that's where it's the most practical place to store it currently), you need to:Instead, for very simple configuration snippets it's cleaner to store them in the inventory / group_vars, and this PR then allows you to do that: