Commit Graph

32 Commits

Author SHA1 Message Date
Ian Wienand af3f79121a
linter: Use capitals for names
This is pretty trivial, but consistency is probably better in this
regard and it does guide you to writing a sentence that is human
parsable, which is the point of it.

Change-Id: Iaab9bb6aec0ad0f1d3cae10364c1f1b37d02801e
2022-11-07 10:37:53 +11:00
Ian Wienand 6d23d20f2f linters: add names to blocks
This is preparation for a later version of ansbile-lint, which finds
missing names on blocks.  This seems a reasonable rule, and the
Ansible manual says [1]

  Names for blocks have been available since Ansible 2.3. We recommend
  using names in all tasks, within blocks or elsewhere, for better
  visibility into the tasks being executed when you run the playbook.

This simply adds a name tag for blocks that are missing it.  This
should have no operational change, but allows us to update the linter
in a follow-on change.

[1] https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html

Change-Id: I92ed4616775650aced352bc9088a07e919f1a25f
2022-07-27 17:13:39 +10:00
Sorin Sbarnea 90d263941a More E208
Change-Id: I8c3d224682d7d6780d6ad7823e390c47114e702b
2020-11-05 08:33:28 +00:00
Albin Vass 965c602af3 upload-logs: do not synchronize owner
Change-Id: I46228648363af065a2d4b5d1a6fe44c625420824
2020-05-18 17:05:32 +02:00
Albin Vass 9062289151 Check for loop_control in with_ type loops
Change-Id: I191265df7709a6262b44a428d78fe28ffaeb4b75
2020-05-01 13:45:34 +02:00
Paul Belanger 550e5da4b4 Allow upload-logs to toggle compression of console logs
We should make it easy for users to view console logs by default.
Today, we compress and upload logs and by default apache / nginx will
not properly display them as plain text.  This commit changes the
default to not compress, but allows more advanced users to enable this
logic.  As mostly likley it also means additional configuration for
your web server.

Change-Id: Ic446db4f85e2098db8fa4568f8c5140ba564e931
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-09-20 17:03:58 +00:00
Clark Boylan fd2b753088 Add build shard log path docs to upload-logs(-swift)
The upload logs roles can make use of the build logs sharding via their
calls into set-zuul-log-path-fact. Document this.

Change-Id: Ia57fc6a47227657f9fac70074e453cf8d4c16c26
2019-09-05 15:27:18 +00:00
Jeremy Stanley 2711d10186 Be consistent about spaces before and after vars
With the arrival of ansible-lint 4, Jinja2 variable expansions must
include spaces before and after the variable name inside the
brackets.

Adjust the new violations accordingly and remove the rule
206 exclusion.

Change-Id: Ib3ff7b0233a5d5cf99772f9c2adc81861cf34ffa
2019-08-07 20:17:41 +01:00
James E. Blair 2ef4caed78 Document upload-logs reliance on add-fileserver
Change-Id: I0e12756e1f2a876e4f44678d61d64010bee33311
2019-01-22 14:41:11 -08:00
Monty Taylor 5cd8fbeb58
Update ANSIBLE_LIBRARY to use envsitepackagesdir
We install zuul via test-requirements, so the zuul files should be in a
directory under the site-packges of the virtualenv that tox installed it
in to. Update the path to point correctly to that location.

Remove the ansible-lint skip tags which should now work because the
library path should be pointing to a location that actually holds the
content.

Change-Id: If2d4b39267c4b9a3102a951143b568f8447af8d9
2018-10-18 09:23:25 -05:00
Monty Taylor 4997f9bee0
Just use chmod instead of file for log permissions
The file module with recurse goes to the bad place when the content has
a symlink to '.'. Rather than fighting it - just use chmod -R, which
does what we want.

Change-Id: Id3e23e67727d8ac7f29c87d6865b54dc729ccaf4
2018-06-18 12:20:34 -05:00
Zuul 819cc19d3f Merge "Fix ansible-lint job" 2018-03-29 13:52:58 +00:00
Colleen Murphy d1956bd9f7 Fix ansible-lint job
The 'linters' tox environment was not running on roles, it was only
running on playbooks. This change adds a command to the linters
environment to ensure all roles are linted.

Since these weren't being linted, there were some problems with them.
The first was a warning about usage of the shell module. Both of these
usages seemed appropriate, so this patch adds a skip_ansible_lint tag to
each task that was failing. The second is a warning "no action detected
in task" for zuul modules. This is due to the fact that the linter
cannot find the custom module. One option is to set the ANSIBLE_LIBRARY
path to point to the zuul ansible library directory[1], but the linter
virtualenv does not actually have zuul installed. Instead, we just
disable the linter for the failing tasks.

This also cleans up a comment in the tox file that was referring to a
nonexistent zuul job.

[1] https://github.com/willthames/ansible-review/issues/16

Change-Id: Ie49da9a09733b623bb25c5a4c8aa07eacacf4b33
2018-03-28 23:10:22 +02:00
James E. Blair b1a039970a Add a flag to disable no_log on upload-logs
So that it is possible to debug this role, add a flag which disables
setting no_log on the synchronize task.

Change-Id: Ie433ada5ff6cb15b68f19e8678244af9ce9faa13
Depends-On: https://review.openstack.org/556881
2018-03-27 09:17:18 -07:00
Monty Taylor 3d02630d1b
Add flag for turning off successful job logs
As a relief valve for times of storage pressure on the receiving end,
add a flag that can be set to skip log uploads for sucessful jobs.

It uses the same logic as emit-ara-html.

zuul_site_upload_logs == true (the default) will always upload logs
zuul_site_upload_logs == false will never upload logs
zuul_site_upload_logs == 'failure' will only upload failure logs

Setting this variable should be done in site variables.

Change-Id: I2a55730976520b75dcc98f86f34b7929f9243e62
2018-01-25 12:46:01 -06:00
Monty Taylor c999f9325f
Only upload logs when jobs fail
We're having some major disk issues. Help the situation by only
uploading failure logs.

Change-Id: I4156fb59570d98b16c775752639c2fe23e5777c5
2018-01-25 09:17:28 -06:00
Andreas Jaeger 0506323c2b Ansible linting fixes
Fix a few problems noticed when using this in project-config:
* Ignore apt-get warning in configure-mirrors
* All tasks should be named in upload-logs, emit-job-header
* use git_config in mirror-workspace-git-repos
* Ignore git warnings in mirror-workspace-git-repos

Change-Id: Ibcdc8d5a42fb081b5faa0cc89460e4cf88d369ba
2017-10-27 19:18:15 +02:00
Monty Taylor 76dc3d8e09
chmod the files on the executor
Change-Id: I86f95c59cdd184bfd65e974c15ec93dc9eb93309
2017-09-26 16:32:07 -05:00
Monty Taylor 93b6ab260a
Ensure logs are readable before uploading them
Change-Id: I24cc4aaa1a47819243121dff4b93346792246b57
2017-09-26 15:46:17 -05:00
James E. Blair dcd89b2686 Revert "Fix linting issues found via project-config"
This has syntax errors.

This reverts commit d3128dab95.

Change-Id: Ida6569d384f50095cc228625c7d6e73e154270ae
2017-09-14 13:10:22 -06:00
Jesse Keating d3128dab95 Fix linting issues found via project-config
There are no playbooks that use the roles in this repo in a way that
would lint them, however running linters in project-config found
numerous issues in these roles. Correct the roles.

Change-Id: I017532c8aed8fd90474052423c7ba2510cf84631
Signed-off-by: Jesse Keating <omgjlk@us.ibm.com>
2017-09-13 14:56:59 -06:00
David Moreau-Simard b910a8c1c8 Gzip the job-output.json file
With the necessary mimetype [1], we can gzip the job-output.json file
which clocks in at easily >=1MB per job, so let's do that.

[1]: http://git.openstack.org/cgit/openstack-infra/puppet-openstackci/tree/templates/logs.vhost.erb?id=71fbde489ca51faa5723771e326ca5892d063b01#n49

Change-Id: I88a70b4114874e9c7785639b5747ca2c19387b5d
2017-09-10 17:09:40 -06:00
Monty Taylor 00e673c36b
Rename log_path and generate-log-url
Make log_path zuul_log_path because log_path is rather generic.

Rename generate-log-url to set-zuul-log-path-fact to make it
clearer what it does.

Change-Id: I91ae1e396b3ef04939edebaeea8e5b16cc50315a
2017-09-09 16:49:51 -06:00
Monty Taylor 97d5602faa
Split the log_path creation into its own role
This is so that we can call it in the pre playbook for emitting info.
As part of doing this, use include_role to run it from upload-logs as it
always wants to be used there.

Change-Id: Ibd7d6bdb6275d052bcef2af068882e9b2876ef83
2017-09-06 18:57:41 -05:00
Tristan Cacqueray 4fdad7a741 upload-logs/bindep: fix indentation
These roles are failing yamllint:
  roles/upload-logs/tasks/main.yaml
  23:5      error    wrong indentation: expected 6 but found 4  (indentation)

  roles/bindep/tasks/install.yaml
  7:3       error    wrong indentation: expected 4 but found 2  (indentation)

Change-Id: I189dd08c4d1c091d1e53ca87d52dbaf3f89ba45f
2017-09-03 01:11:30 +00:00
Monty Taylor 85a987cc38
Remove bogus post_tasks line from upload-logs
Bad copy-pasta

Change-Id: If637b0d6f22e345b1a4e462585080a890a9acc26
2017-08-20 09:18:06 -05:00
Monty Taylor 674e7347e4
Add zuul_return call into upload-logs role
We can pass in the fileserver, but if you're using upload-logs, you're
going to need it to return data, so move this functionality into the
role.

Change-Id: I987b1060acd3e6d96519010673fd21eba781f162
2017-08-18 19:21:39 -05:00
James E. Blair 912f976155 Use new sphinx roles in docs
Change-Id: I92ce6b2f137f5dcb6fdee70c101c6b9d8ad5eb11
Depends-On: I9d72d11bfdb700037a6a08f92a2dbfa95ee519ad
2017-08-11 15:10:40 -07:00
Tobias Henkel 68ee0780be Rename uuid to build
In change If9ebdc783dcef4f8dea9fa491b40ae49416e5cf1 in zuul uuid was
renamed to build. This must be also reflected here.

Change-Id: I46101d7a9ecc1513647f19d1d377480d5afa9a5d
2017-07-21 09:46:04 +02:00
Monty Taylor 08524b447b
gzip console log before uploading it
Maybe let's not be storing uncompressed log files, k?

Change-Id: I3ca2299d59e2dbb976d742a5d4d1ddf6acc16ffb
2017-07-21 05:44:53 +09:00
Paul Belanger 3bdb8935b8
Add missing / for log server path
Fix a typo in our log pulishing.

Change-Id: Ic660e475878ac7e872f630faa15e3f71118e3dab
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-14 10:06:09 -04:00
James E. Blair cfffd4431b Move some base job roles from openstack-zuul-roles
Change-Id: I7ac8d2335518c06808461f2fb30ea896709f09ed
2017-07-13 15:13:41 -07:00