Commit Graph

11 Commits

Author SHA1 Message Date
James E. Blair 9e22cfdb0f Remove shebang from all python ansible modules
This commit in Ansible:
9142be2f6c

now allows Python modules to specify their interpreter with the shebang.
We expect our roles to use the discovered python interpreter on remote
nodes, and on the executor, we need them to use the virtualenv.  Removing
the specific shebang accomplishes this under Ansible 6, and has no effect
under older versions of Ansible.

Without this, for example, the log upload roles would not have access to
their cloud libraries.

Also update our ansible/cli check in our module files.  Many of our modules
can be run from the command line for ease of testing, but the check that we
perform to determine if the module is being invoked from the command line
or Ansible fails on Ansible 5.  Update it to a check that should work in
all 4 versions of Ansible that Zuul uses.

Change-Id: I4e6e85156459cca032e6c3e1d8a9284be919ccca
2022-09-15 13:48:10 -07:00
Jeremy Stanley e7915b65b7 Collect initial node filesystem sizes/utilization
Include calls to `df -i` (inode counts) and `df -m` (megabytes data)
in validate-host, to aid in troubleshooting build failures where the
builds start out with too little free space. This way the initial
capacity and utilization of all available filesystems will be
recorded with other basic node diagnostic data.

Change-Id: Iba195e7c5cec372c6ba4daf7059da5b6fb6740ec
2021-02-06 20:27:01 +00:00
Jeremy Stanley 763916231f validate-host: Options to require v4 and v6 routes
Make it possible for a site to demand that the validate-host role
finds IPv4 and/or IPv6 routes, making one or both explicitly
mandatory, instead of the default behavior of succeeding as long as
at least one is available. This allows a site to, for example,
discard nodes during a pre playbook if they lack IPv4 connectivity.

Change-Id: Icaa82212468a659a3756ed51cac442de33065b55
2020-11-18 16:01:39 +00:00
Ian Wienand 20bffbcfc0 Remove invalid argument from format_exc() calls
The argument here is an integer "limit", not the exception.

I think that we only notice this on Python 3 because of exception
chaining.  It causes a real failure though because the exception
handler that is meant to fall into "pass" raises another exception
when ipv6 doesn't work.

Change-Id: I0908a0a3dbb2356caabbffd062379751a0b61c41
2019-09-24 12:15:28 +10:00
Paul Belanger 6685c54616 Revert "validate-host: retry network tests and include unbound logs"
This reverts commit 7e00ba32da.

Change-Id: I2c1aa1e834d408de14ad4818ff5c9b58145f44b0
2018-11-19 21:43:40 +00:00
Ian Wienand 7e00ba32da validate-host: retry network tests and include unbound logs
Split the network testing component of the validate-host rule into a
separate task, so it can be retried a couple of times in case
something is a bit slow about bringing up external networking.  Add
failure collection of unbound logs if they appear to be in some common
locations (such as will be there on infra nodes).

Change-Id: Id12f1ba064fa2e5f75b9a5cfba76d238d23d3f57
2018-11-06 14:33:06 +11:00
Ian Wienand b02035f429 Log output and exception when traceroute fails
These traceroutes currently fail in a very opaque way.  We are
occasionally seeing Fedora nodes fail in here (which is odd, because
obviously networking is up enough for zuul to connect) and don't have
much to go on.

When an exception is caught, add the output, return code and basic
traceback to the return attributes, and include them in the failure
case.

Depends-On: https://review.openstack.org/563702
Change-Id: I047bf2b1daa22a5b6bfc12b3f42b108975097409
2018-06-20 09:44:53 +00:00
Zuul 579d9f2202 Merge "Make validate-host read from site-variables" 2017-09-08 22:57:45 +00:00
Dirk Mueller 8949811396 Expand PATH for SUSE systems to include /usr/sbin
The zuul_debug_info library calls traceroute, which is in /usr/sbin
and not in /sbin on SUSE (and those two are not linked to each other).

Also capture the OSError that occurs when the binary isn't there.

Change-Id: Ic5e31a417415f830d7697abfbb2ae71f2ae20935
2017-09-08 13:45:32 +10:00
Monty Taylor f3e89a488c
Make validate-host read from site-variables
Change the default parameters to the role to be zuul site variables.
Because of variable precedence, having these not be site variables means
someone could override them in a job. Since one of the actions is to
read and log the contents of a file, we likely don't want to give people
the ability to do that with an arbitrary file.

The traceroute host isn't as important to be a site variable, but it's
still not actually something that jobs should override - it's a feature
of the deployment.

Both variables work if they are not set, so deployers should still be
able to use this role without defining site-variables. But it should be
made clear to them that if they want those features they really should
define the locations in a site-variable and not in a normal job
variable.

configure-mirror similarly allows in-job override, but maybe that's ok
for now and leaving the site-variable value as a default is fine?

Finally, add a new zuul_site_image_manifest_files list, so that we can
specify more than one file to read. Set the defaults of it to be the
files that the dib nodepool elements emit. We'll also look in to pushing
those manifest files up a level into dib so that expecting nodepool
nodes to have them is even more reasonable.

Change-Id: I632a32fdfac4bfe57eb269ac8e183fb8df34d48f
2017-09-07 11:18:36 -05:00
Monty Taylor 7f64bddb1d
Rename debug-ansible to validate-host
It's doing more than just outputting ansible information.

Change-Id: Icfbef10b1bcf36d75f961cd4319bc062a77efe2a
2017-07-09 11:26:50 -05:00