aerogear / aerogear-digger-installer

Ansible role for installing AeroGear Digger on OpenShift
https://aerogear.org/
Apache License 2.0
4 stars 17 forks source link

proxy tasks #33

Closed odra closed 7 years ago

odra commented 7 years ago

OSX proxy setup

Adds OSX proxy config/setup if proxy_url is set. Needs sudo password to run.

Changes

How to verify

The following vars needs to be set:

proxy_host: $proxyhost
proxy_port: $proxyport
proxy_user: $proxy_user
proxy_pass: $proxy_pass
proxy_device: $proxy_device
proxy_ctx:
  - webproxy
  - securewebproxy

proxy_device var can be either "Wi-Fi" or "Ethernet" depends on mac machine setup. The following command be used to get a full list of devices: networksetup -listallnetworkservices

Both proxy_user and proxy_pass vars are optional.

 ansible-playbook -vvv -i my-cluster-up-example my-build-playbook.yml --tags osx_configure_proxy --ask-sudo-pass

This should set the mac osx global proxy, which can be verified in settings -> network -> device -> proxies.

The following commands should be used to verify the proxy config:

networksetup -getwebproxy
networksetup -getsecurewebproxy
laurafitzgerald commented 7 years ago

Verification Case: Proxy with Authentication Set variables as suggested in inventory and ran against mac machine with command:

ansible-playbook -vvv -i inventory-sample sample-build-playbook.yml --tags=osx_configure_proxy --ask-sudo-pass

Result Output from scutil --proxy on mac machine has values set.

Case: Proxy without Authentication Commented out auth variables and ran same command. Output of scutil --proxy returns values including the user value. Should this value be overridden to null as the command sent to the machine is: networksetup -setsecurewebproxy Ethernet https://<host> <port>. i.e. no user or password sent.

Needs check

odra commented 7 years ago

@laurafitzgerald I've changed the state task to enable/disable a proxy based on the proxy_host env var.

wei-lee commented 7 years ago

@odra @laurafitzgerald are there anything else needs to be done in this PR? If not, let's merge this one.

@odra can we squash the commits before merging. Thanks

odra commented 7 years ago

@wei-lee sure, I will just add some additional info around the proxy authentication limitation

laurafitzgerald commented 7 years ago

@odra sorry missed this one. Will do the verification steps again with the new changes

laurafitzgerald commented 7 years ago

@wei-lee @odra I think in the case of the proxy with auth case, where there is sometimes a failure and the user is required to carry out the step manually as suggested in the known issues in the README, we could pause the playbook and ask the user to carry out the step before continuing. wdyt?

laurafitzgerald commented 7 years ago

Verfication Steps

networksetup -getwebproxy Ethernet Results in Enabled: Yes

networksetup -getwebproxy Ethernet Results in Enabled: No

Results as expected: Verified