ansible-elastic-cloud-enterprise icon indicating copy to clipboard operation
ansible-elastic-cloud-enterprise copied to clipboard

Make role idempotent and controllable by variables in addition to --skip-tags

Open l4r-s opened this issue 2 years ago • 1 comments

Hi

It would be nice if this role would be idempotent (only show changed on an ansible task if it realy changed somtehing on the system). Furthermore --skip-tags setup_filesystem is prone to error because it is not the default behavior when running ansible.

This PR tries to fix this while remaining backwards compatible.

It changes the following:

  • only show changed on an ansible task if it realy changes something on the system (makes it easy to re-run the role more than once)
  • Ensure the needed kernel params in GRUB_CMDLINE_LINUX are only present once. Even if they are already defined in different order
  • Reboot after GRUB_CMDLINE_LINUX is changed (controllable with ece_do_bootloader_reboot)
  • Only execute Update if the ece_version number is higher than the running one
  • Use ece_do_* variables in addition to the --skip-tags functionality (the default value of the variables represent the same behavior as it would be used with the --skip-tags)
  • Implement ece_do_cloudinit to disable all cloud-init related tasks
  • Use handler to restart docker service if something changes, instead of stopping it and starting it with every run
  • Changing {{ data_dir }}/docker to elastic User and group makes IMHO no sense, since the docker service will change it back to root after a restart. So this PR removes it

l4r-s avatar Apr 19 '23 13:04 l4r-s

💚 CLA has been signed