Wiredcraft / devops-ansible

Ansible folder structure, including playbooks / plugins / etc.
0 stars 1 forks source link

Need better conditional exec / relation between services #24

Closed zbal closed 8 years ago

zbal commented 11 years ago

ex. php and nginx or php and apache - one need php-fpm, the other needs libapache2-mod-php5; and all the related configs. We can't really install everything by default as the dependencies would led to install php, libphp, fpm, nginx, apache, etc. and .. it sucks to manage...

The other thing is about shared config; php comes in 3 flavors: cli, fpm, apache - by default they all have their individiual config files; we are currently "sharing" them via links - there is no way to perform manual change / or high level of customization per service as everything gets overwrote on server sync.

@JuhaS @zbal - put your thoughts; before, we were creating fake groups in the env per service, and were able to run conditional exec by checking if the current server belonged to one of the service (group); ex:

- name: Ensure php extension is installed
  apt: pkg=libapache2-mod-php5 state=present
  when_string: '"php" in "$group_names"'
zbal commented 11 years ago

Relying on the inventory only, we should be able to use stuff like when_string: '"service_name"' is defined - effectively checking that we have for ex. a "php" var (object) defined in the host itself.

That would require to have all the default values added. Or That we need to generate an inventory that includes the previously existing groups