2

What is the industry standard practise for the order of ansible commands?

a) copy configuration BEFORE installation of packaged

b) copy configuration AFTER installation of packaged


The a) has advantage that the installed packages will run as wanted on the first start, which seems better for security.

But b) seems more logical (or at least I was used to install and config packages this way...)

mvorisek
  • 485
  • 6
  • 19
  • This is complicated, because Debian based systems have the unfortunate misfeature of [starting services as soon as they're installed](https://serverfault.com/q/567474/126632) -- and, strangely, they do this intentionally. – Michael Hampton Jan 04 '18 at 23:09

1 Answers1

3

Either would work. Just be sure the side effects from possibly starting the service on the default configuration are tolerable, and reload anything necessary after to make the new configuration take effect.

Configuration after package is sensible to me. Installing a package tends to create a directory where configuration files can be placed. It is convenient to assume this already exists, and let the package manager own that directory.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • 1
    Configuring after package is almost always the way to go IMHO, packages could overwrite your changes, or refuse starting with your configuration, leaving package manager in some blocked state, ... parent directories could be missing, as well as owner/group. – SYN Jan 06 '18 at 21:06