Skip to content

Commit

Permalink
Fix setting HTTPS?_PROXY for receptor (#22)
Browse files Browse the repository at this point in the history
This change also introduced per-receptor-instance environment files instead of
setting the proxy directly in the template systemd unit.
  • Loading branch information
adamruzicka authored Jul 15, 2020
1 parent 602c15c commit 2bf6c63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
tags: register_with_sources
- name: Create Receptor systemd unit files per account and start them
block:
- name: Genereate environment files
copy:
dest: "{{ receptor_config_dir }}/{{ account_dir }}/receptor.env"
content: |
HTTP_PROXY={{ http_proxy }}
HTTPS_PROXY={{ http_proxy }}
loop: "{{ account_dirs }}"
loop_control:
loop_var: account_dir
- name: Generate template unit file
template:
src: receptor@.service.j2
Expand Down
3 changes: 1 addition & 2 deletions templates/receptor@.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ After=network.target

[Service]
ExecStart=/usr/bin/receptor -c {{receptor_config_dir}}/%i/receptor.conf -d {{receptor_data_dir}}/%i node
Environment=HTTP_PROXY="{{ http_proxy }}"
Environment=HTTPS_PROXY="{{ http_proxy }}"
EnvironmentFile=-{{ receptor_config_dir }}/%i/receptor.env

[Install]
WantedBy=multi-user.target

0 comments on commit 2bf6c63

Please sign in to comment.