diff --git a/README.md b/README.md index efd32d5..4260f0f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ the httpd module, you will have to add to the list `opensips-http-modules`. Defa (`[]`) - no other modules are installed. * `opensips_config` - specify a configuration template that is going to be used instead of the default opensips configuration file. +* `opensips_start` - specify whether OpenSIPS should be started/restarted. Default value is `yes`. Example Playbook ---------------- diff --git a/handlers/main.yml b/handlers/main.yml index 4d923f3..a4aed2b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,13 +1,13 @@ --- # handlers file for opensips -- name: opensips start +- name: opensips enable service: name: opensips enabled: true - state: started - name: opensips restart service: name: opensips state: restarted + when: opensips_start | default(True) diff --git a/tasks/debian.yml b/tasks/debian.yml index 7d0ba66..fdfbc64 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -29,7 +29,7 @@ name: opensips state: present notify: - - opensips start + - opensips enable - opensips restart register: apt_install_result until: apt_install_result is success @@ -42,7 +42,7 @@ state: present when: opensips_modules is defined and opensips_modules | length notify: - - opensips start + - opensips enable - opensips restart register: apt_modules_install_result until: apt_modules_install_result is success diff --git a/tasks/redhatdnf.yml b/tasks/redhatdnf.yml index eab388b..34b2305 100644 --- a/tasks/redhatdnf.yml +++ b/tasks/redhatdnf.yml @@ -44,7 +44,7 @@ name: opensips state: present notify: - - opensips start + - opensips enable - opensips restart register: dnf_install_result until: dnf_install_result is success @@ -57,7 +57,7 @@ state: present when: opensips_modules is defined and opensips_modules | length notify: - - opensips start + - opensips enable - opensips restart register: dnf_modules_install_result until: dnf_modules_install_result is success diff --git a/tasks/redhatyum.yml b/tasks/redhatyum.yml index d875b4d..8124b75 100644 --- a/tasks/redhatyum.yml +++ b/tasks/redhatyum.yml @@ -44,7 +44,7 @@ name: opensips state: present notify: - - opensips start + - opensips enable - opensips restart register: yum_install_result until: yum_install_result is success @@ -57,7 +57,7 @@ state: present when: opensips_modules is defined and opensips_modules | length notify: - - opensips start + - opensips enable - opensips restart register: yum_modules_install_result until: yum_modules_install_result is success