Skip to content

Commit 39dfadc

Browse files
author
Sean Robertson
committed
Fix windows task syntax
1 parent f206821 commit 39dfadc

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tasks/install-on-Windows.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,26 @@
9898
with_items:
9999
- '{{ buildkite_agent_builds_dir[ansible_os_family] }}'
100100

101-
- name: configure buildkite-agent as an nssm service
101+
# Only one of the below tasks will run, depending on the type of service logging
102+
- name: configure buildkite-agent as an nssm service with journal-based logging
102103
win_nssm:
103104
name: buildkite-agent
104105
application: '{{ buildkite_agent_executable[ansible_os_family] }}'
105106
arguments: '{{ buildkite_agent_start_command[ansible_os_family] }}'
106-
{% if buildkite_agent_logs_dir[ansible_os_family] is defined %}
107107
stdout_file: '{{ buildkite_agent_logs_dir[ansible_os_family] }}/buildkite-agent.log'
108108
stderr_file: '{{ buildkite_agent_logs_dir[ansible_os_family] }}/buildkite-agent.log'
109-
{% endif %}
110109
executable: '{{ buildkite_agent_nssm_exe }}'
110+
when: buildkite_agent_logs_dir[ansible_os_family] is undefined
111+
112+
- name: configure buildkite-agent as an nssm service with file-based logging
113+
win_nssm:
114+
name: buildkite-agent
115+
application: '{{ buildkite_agent_executable[ansible_os_family] }}'
116+
arguments: '{{ buildkite_agent_start_command[ansible_os_family] }}'
117+
stdout_file: '{{ buildkite_agent_logs_dir[ansible_os_family] }}/buildkite-agent.log'
118+
stderr_file: '{{ buildkite_agent_logs_dir[ansible_os_family] }}/buildkite-agent.log'
119+
executable: '{{ buildkite_agent_nssm_exe }}'
120+
when: buildkite_agent_logs_dir[ansible_os_family] is defined
111121

112122
- name: configure service
113123
win_service:

0 commit comments

Comments
 (0)