conjurdemos / cdemo

A tour of Conjur including LDAP sync, scalable machine identity, policy-based mgmt, ssh key mgmt and Splunk integration.
21 stars 18 forks source link

Adds script to check network connectivity before installation #66

Closed ryanprior closed 6 years ago

ryanprior commented 6 years ago

What does this PR do?

It checks for internet connectivity before installing Ansible. Specifically, it checks these URLs:

What is the background?

We've occasionally had reports of failure to install cdemo which were ultimately traced to basic network connectivity problems, eg with NATs and firewalls and so on blocking access to necessary domains.

In order to make it clear up front where the failure is and what the expectations are, this script prints out in plain language whether it's able to connect.

How should the reviewer test this?

The lazy way is to checkout the network-check branch and run bin/check-network. That will run the network check alone and nothing else.

The more methodical way is:

Example sessions

Good connectivity:

$ ./installAnsible.sh 
Checking network connectivity:
  https://hub.docker.com... ✓
  https://github.com... ✓
  https://plugins.jenkins.io... ✓
-----
Installing dependencies
[...]

Bad connectivity:

$ ./installAnsible.sh 
Checking network connectivity:
  https://hub.docker.com... curl: (6) Could not resolve host: hub.docker.com
  https://github.com... curl: (6) Could not resolve host: github.com
  https://plugins.jenkins.io... curl: (6) Could not resolve host: plugins.jenkins.io
❌ connectivity insufficient to install cdemo ❌