Closed odra closed 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
@laurafitzgerald I've changed the state task to enable/disable a proxy based on the proxy_host env var.
@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
@wei-lee sure, I will just add some additional info around the proxy authentication limitation
@odra sorry missed this one. Will do the verification steps again with the new changes
@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?
Verfication Steps
proxy_host=<masked>
proxy_port=3128
proxy_user=
proxy_pass=
proxy_device=Ethernet
proxy_ctx=["webproxy","securewebproxy"]
Ran ansible-playbook -i inventory-sample sample-build-playbook.yml --tags=osx_configure_proxy --ask-sudo-pass
networksetup -getwebproxy Ethernet
Results in Enabled: Yes
proxy_host
valuenetworksetup -getwebproxy Ethernet
Results in Enabled: No
Results as expected: Verified
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_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.
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: