UKCloud / openshift-deployment-ansible

3 stars 1 forks source link

Squid error handling #137

Closed k8soneill closed 5 years ago

k8soneill commented 5 years ago

Fail task added to capture errors at oc login and avoid blank whitelist update. Failed reconfigures now also populate a configmap in the whitelist project with the relevant error messages for customer. Error format is:

"2019/05/16 22:22:39| ERROR: 'registry.access.redhat.com' is a subdomain of '.redhat.com'\n2019/05/16 22:22:39| ERROR: You need to remove 'registry.access.redhat.com' from the ACL named 'whitelist'\nFATAL: Bungled /etc/squid/squid.conf line 18: acl whitelist dstdomain \"/etc/squid/sites.whitelist.txt\"\nSquid Cache (Version 3.5.20): Terminated abnormally.\nCPU Usage: 0.014 seconds = 0.005 user + 0.009 sys\nMaximum Resident Size: 31392 KB\nPage faults with physical i/o: 0", "stderr_lines": ["2019/05/16 22:22:39| ERROR: 'registry.access.redhat.com' is a subdomain of '.redhat.com'", "2019/05/16 22:22:39| ERROR: You need to remove 'registry.access.redhat.com' from the ACL named 'whitelist'", "FATAL: Bungled /etc/squid/squid.conf line 18: acl whitelist dstdomain \"/etc/squid/sites.whitelist.txt\"", "Squid Cache (Version 3.5.20): Terminated abnormally.", "CPU Usage: 0.014 seconds = 0.005 user + 0.009 sys", "Maximum Resident Size: 31392 KB", "Page faults with physical i/o: 0"

The first and second line which contain relevant error messages will be shown back to the customer:

2019/05/16 22:22:39| ERROR: 'registry.access.redhat.com' is a subdomain of '.redhat.com' 2019/05/16 22:22:39| ERROR: You need to remove 'registry.access.redhat.com' from the ACL named 'whitelist'