forked from StackStorm/ansible-st2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade st2.conf to add new services: timersengine, workflowengine
This makes sure that new services (timersengine, workflowengine) get added to st2.conf on upgrade. Also makes the list of st2_services version dependent. As there is no good way to tell 'present' from 'latest', a service restart may fail when st2_version='present' and the actual version is not 2.9 or greater. But, if a user has pinned a version, then this safely only starts/restarts the services that are valid for that version. Resolves StackStorm#196
- Loading branch information
1 parent
7a1b20e
commit ac87d08
Showing
4 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: timer config deprecation notice | ||
when: "'timer' in st2_config" | ||
debug: | ||
msg: | | ||
The 'timer' section in st2_config is deprecated. | ||
We recommend renaming 'timer' to 'timersengine'. | ||
See https://docs.stackstorm.com/upgrade_notes.html#st2-v2-9 | ||
- name: Ensure timersengine section is present in st2.conf on upgrade | ||
when: "'timersengine' not in st2_config" | ||
include: config.yml _conf_section_name={{ _conf_section.key }} _conf_options={{ _conf_section.value }} | ||
with_dict: | ||
timersengine: | ||
enable: "{{ (st2_config.timer|default({})).enable|default(true) }}" | ||
local_timezone: "{{ (st2_config.timer|default({})).local_timezone|default('America/Los_Angeles') }}" | ||
logging: conf/logging.timersengine.conf | ||
loop_control: | ||
loop_var: _conf_section | ||
|
||
- name: Update timer.logging in st2.conf on upgrade | ||
when: "('timer' in st2_config) and ('logging' not in st2_config.timer)" | ||
include: config.yml _conf_section_name={{ _conf_section.key }} _conf_options={{ _conf_section.value }} | ||
with_dict: | ||
timer: | ||
logging: conf/logging.timersengine.conf | ||
loop_control: | ||
loop_var: _conf_section | ||
|
||
- name: Remove timer section | ||
when: "('timersengine' in st2_config) and ('timer' not in st2_config)" | ||
ini_file: | ||
dest: /etc/st2/st2.conf | ||
section: "timer" | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Ensure workflow_engine section is present in st2.conf on upgrade | ||
when: "('workflow_engine' not in st2_config) or ('logging' not in st2_config.workflow_engine)" | ||
include: config.yml _conf_section_name={{ _conf_section.key }} _conf_options={{ _conf_section.value }} | ||
with_dict: | ||
workflow_engine: | ||
logging: conf/logging.workflowengine.conf | ||
loop_control: | ||
loop_var: _conf_section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters