Skip to content

Commit

Permalink
Merge pull request #33 from gaima8/service_state
Browse files Browse the repository at this point in the history
Allow having the instance service in states other than started
  • Loading branch information
robertdebock authored Jan 9, 2021
2 parents 62133ce + 5dc5add commit 62303e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ tomcat_instances:
access_log_prefix: "{{ tomcat_access_log_prefix }}"
access_log_suffix: "{{ tomcat_access_log_suffix }}"
access_log_pattern: "{{ tomcat_access_log_pattern }}"
service_state: started
service_enabled: yes

# The explicit version to use when referring to the short name.
tomcat_version7: 7.0.107
Expand Down
6 changes: 3 additions & 3 deletions tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
user_name: "{{ instance.user | default(tomcat_user) }}"
group_name: "{{ instance.group | default(tomcat_group) }}"

- name: start and enable tomcat instance
- name: set tomcat instance service to {{ instance.service_state | default('started') }} and {{ instance.service_enabled | default('yes') }}
service:
name: "{{ instance.name }}"
state: started
enabled: yes
state: "{{ instance.service_state | default('started') }}"
enabled: "{{ instance.service_enabled | default('yes') }}"

- name: loop over wars
include: war.yml
Expand Down

0 comments on commit 62303e4

Please sign in to comment.