Search code examples
ansiblemc

How to generate MC config via ansible


I am making an ansible project for setting up the environment. And I'm stuck on a seemingly simple task - I need to create the Midnight commander config after installing it. The problem is that the config is generated the first time the application is launched. But I need to do without it. I cannot load a pre-prepared config, because it differs depending on the distributions and their versions, and sometimes a lot. I thought to run somehow mc through ansible, but haven't figured out how yet. Maybe anyone has smart thoughts?


Solution

  • I tried to do as the respected @phd advises, in the end, something went wrong on my old server with centos7. I was almost desperate and wanted to add to the readme the need to run mc to generate the config, but this morning I got a possibly brilliant idea - to fill in the config only with the parameters that I want to change. As a result, I made a config with the parameters skin, command_prompt and a few more, loaded it and it works! Perhaps I haven't noticed something yet, but it looks like all these parameters are optional and if mc doesn't find them, it sets the default value (and it looks like it can get these values ​​from somewhere else).

    upd This is victory. When opening MC with my config - it overwrites it, adding missing parameters there. I'm happy.