Skip to content

Commit

Permalink
Ansible: Add proxy configuration for Windows downloads (open-telemetr…
Browse files Browse the repository at this point in the history
…y#1875)

* Ansible: Add proxy configuration for Windows downloads

* Add variables to documentation, rename to start with win_ prefix

* Update deployments/ansible/roles/collector/tasks/otel_win_install.yml

Co-authored-by: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com>

* Update deployments/ansible/roles/collector/tasks/win_fluentd_install.yml

Co-authored-by: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com>

* Update deployments/ansible/roles/collector/README.md

Co-authored-by: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com>

* code review

* add CHANGELOG

Co-authored-by: Jeff Cheng <83052155+jeffreyc-splunk@users.noreply.github.com>
  • Loading branch information
atoulme and jeffreyc-splunk authored Aug 17, 2022
1 parent 421bd8b commit ffd7b75
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deployments/ansible/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## ansible-v0.11.0

### 💡 Enhancements 💡

- Support downloading the Splunk Collector Agent and fluentd using a proxy on Windows.

## ansible-v0.10.0

### 💡 Enhancements 💡
Expand Down
10 changes: 10 additions & 0 deletions deployments/ansible/roles/collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ how to use the role in a playbook with minimal required configuration:
- `splunk_ballast_size_mib`: Memory ballast size in MiB that will be set to the Splunk
OTel Collector. (**default:** 1/3 of `splunk_memory_total_mib`)

#### Windows Proxy

The collector and fluentd installation on Windows relies on [win_get_url](https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_get_url_module.html),
which allows setting up a proxy to download the collector binaries.

- `win_proxy_url` (Windows only): An explicit proxy to use for the request. By default, the request will use the IE defined proxy unless `win_use_proxy` is set to `no`. (**default:** ``)
- `win_use_proxy` (Windows only): If set to `no`, it will not use the proxy defined in IE for the current user. (**default:** `no`)
- `win_proxy_username` (Windows only): The username to use for proxy authentication. (**default:** ``)
- `win_proxy_password` (Windows only): The password for `win_proxy_username`. (**default:** ``)

### Fluentd

- `install_fluentd`: Whether to install/manage fluentd and dependencies for log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
ansible.windows.win_get_url:
url: "{{win_base_url}}/splunk-otel-collector/msi/{{package_stage}}/latest.txt"
dest: "%TEMP%"
proxy_password: "{{ win_proxy_password | default(omit) }}"
proxy_url: "{{ win_proxy_url | default(omit) }}"
proxy_username: "{{ win_proxy_username | default(omit) }}"
use_proxy: "{{ win_use_proxy }}"
register: latest
when: splunk_otel_collector_version == "latest"

Expand All @@ -23,6 +27,10 @@
url: "{{win_base_url}}/splunk-otel-collector/msi/{{package_stage}}/splunk-otel-collector-\
{{splunk_otel_collector_version}}-amd64.msi"
dest: "%TEMP%"
proxy_password: "{{ win_proxy_password | default(omit) }}"
proxy_url: "{{ win_proxy_url | default(omit) }}"
proxy_username: "{{ win_proxy_username | default(omit) }}"
use_proxy: "{{ win_use_proxy }}"
register: otel_msi_package

- name: Install splunk-otel-collector-msi
Expand Down
1 change: 1 addition & 0 deletions deployments/ansible/roles/collector/tasks/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@
registry_key: HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
package_stage: release
win_base_url: https://dl.signalfx.com
win_use_proxy: "no"
when: ansible_os_family == "Windows"
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
ansible.windows.win_get_url:
url: "{{td_agent_base_url}}/4/windows/{{win_fluentd_msi}}"
dest: "%TEMP%"
proxy_password: "{{ win_proxy_password | default(omit) }}"
proxy_url: "{{ win_proxy_url | default(omit) }}"
proxy_username: "{{ win_proxy_username | default(omit) }}"
use_proxy: "{{ win_use_proxy }}"
register: fluentd_msi

- name: Install Fluentd on Windows
Expand Down

0 comments on commit ffd7b75

Please sign in to comment.