3 ms·
Problem is sometime platforms differ a bit, so it's better to patch the config file. For instance (I know there's vagrant and stuff), I develop on a Mac but de
by hbbio 13y ago
Problem is sometime platforms differ a bit, so it's better to patch the config file.
For instance (I know there's vagrant and stuff), I develop on a Mac but deploy on linux. My sed handles that pretty well.
- dalore 13y agoThe platforms may differ, but a known version should be able to use the same config on the different platforms.
- hbbio 13y agoJust looked up a real "sed" example in linux vs linux. DigitalOcean ships VM that don't have an admin group. So when I tried DO, I added: grep -q 'admin' /etc/group || groupadd admin Or, for changing the sshd port: sed -i -r 's/^#?Port [0-9]*/Port '"$PORT"'/' /etc/ssh/sshd_config Works great on all platforms... regardless of the default sshd_config.
- dalore 13y agoYou realise that the tools like ansible are made for making sure the groups and users you specify in your config are going to be on the server? That's the point of them. Don't rely on a presetup environment, you'r ansible scripts should setup the environment for everything you need.
- txutxu 13y agoIf the compile options in both platform matches. And nginx is full of compile options and modules to enable and disable, so maybe "the same config in the same version" does not work on different platforms.
- dalore 13y agoThen that's not a same known version is. Nginx doesn't support different loadable modules so compiling it differently make them different versions. If you're reliant on modules being in there you compile it yourself with a source deb/rpm/etc from nginx. If you don't need a module then don't compile it in.
- falcolas 13y agoWhile possible to patch using Ansible (lineinfile), it's typically easier to use templates with host vars instead. i.e. define a set of default values which are for your deploys, and then a host specific variable for your local machine which provides the alternate values. Does it beat sed? Probably not in the short term, but it makes it easier to not forget to sed a file when deploying (not to mention adding the ability to skip changing the remote file and sighup nginx when the file hasn't changed).