Commit Graph

33 Commits

Author SHA1 Message Date
Ian Wienand b2ae863f50
Add names to include tasks
Latest ansible-lint is finding this.  It seems reasonable enough to
ensure the task is named; it's always nice to have context about what
is happening as you read the file.

Change-Id: Ia7e490aaba99da9694a6f3fdb1bca9838221b30a
2022-11-07 10:37:53 +11:00
Albin Vass 6f2ff3f1b8 bindep: remove set_fact usage when converting string to list
This can cause problems where set_fact isn't able to override the
variable when bindep is used with include_role and bindep_file is set as
a variable in the include_role task.

Change-Id: I3099f1802f2d30df1265a9abc11a53c923ed4832
2021-02-01 15:09:07 +01:00
Michal 522a78385a Allow bindep role to read from more then one bindep file
Extend bindep role to be able to install packages from
multiple paths at once. This behavior is fully compatible
with current implementation, however it allows to pass
number of bindep file paths.

Change-Id: I70d42f25837ff282aad534f9ead965d12858ac9b
2020-11-02 17:17:47 +01:00
Sorin Sbarnea a73d432078 bindep: Fixed runtime warnings
Resolve few ansible runtime warnings.

Change-Id: I3e2d5ec3b5b1fc6bbfaded4b8bece035f9880517
2020-08-24 18:32:16 +01:00
Albin Vass 534968883d bindep: update include to include_tasks
include is being deprecated and import_tasks is supported
since 2.4 so update bindep to use that instead.

Change-Id: Id6961e4184abf394e8592bb79e4053e6b9a9eefe
2020-05-26 08:01:06 +00:00
Andreas Jaeger 7e04128a8b Capitalize task names
We capitalize the first word in task names in general - and when you
follow a log and suddenly see a single lower-case one flying along...

Fix those names that I could find and that are not variables etc.

Change-Id: I9ccde577413270d49fd790c41767b859366dc2f6
2020-05-16 17:46:17 +02:00
Ian Wienand 9ed79fd389 bindep: use virtualenv_command from ensure-pip
This role currently assumes virtualenv is installed when installing
bindep; instead run ensure-pip to both ensure the pip package
requirements are there, and use the abstracted virtualenv command it
provides.

Change-Id: I4dbd7d23fe770c07dc333dd8579d4f8978410a95
2020-05-13 11:35:45 +10: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
Paul Belanger 4ce2d40d68 Don't create bindep venv if bindep_file is not found
There is no need to install bindep, if we don't have a bindep file.

Change-Id: I33685e4905ceff23a6b772163ffce1a76143d2eb
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-03-30 12:27:36 -04:00
Andreas Jaeger 002956ee54 Update tox-docs to follow build-sphinx better
The build-sphinx job uses compile and test bindep profiles, update tox-docs to use the same.

tox-docs used to run tools/test_setup due to inheriting from unittests,
remove that inheritance since we do not need it.

Update role bindep to have a default for zuul_work_dir. If this role is
used without unittests, zuul_work_dir is unset.

Change-Id: I5df8b9cd90bf5e4f4c84c7b4514fb9c575898e31
2018-08-22 07:54:42 +02:00
Monty Taylor 5854988a65
Revert "Revert "Install build bindep profiles alongside doc and test""
Try again with "compile" as the new bindep profile name.

This reverts commit ac5912fd8a.

Change-Id: I4a03c9c2377d0676fe6f5d11d2948a319b0ba341
2018-07-08 16:12:44 -04:00
Jeremy Stanley ac5912fd8a Revert "Install build bindep profiles alongside doc and test"
This reverts commit e3d911b3ef.

Puppet projects for OpenStack are already using a "build" bindep
profile which isn't satisfiable for some platforms on which they run
jobs. Revert for now while we consider either fixing them or
switching to a different profile name for this purpose.

Change-Id: I4131b6d67faf9e10004887e7b0b73c01ec7d421c
2018-07-07 00:31:40 +00:00
Monty Taylor e3d911b3ef
Install build bindep profiles alongside doc and test
In order to be able to separate out depends needed for building wheels,
depends needed for running tests and depends needed for running
software, we can tag build depends with a 'build' profile. However,
doing that then means we don't have all of the things we need for
building docs or testing things.

Add build to the profile list for both docs builds and test installs.

Change-Id: I0689acb53789d3650926a3e11aec4570df5d950c
Needed-By: https://review.openstack.org/580159
2018-07-05 17:42:19 -05:00
Tristan Cacqueray e2058a6b75 Fix deprecation warning of ansible-2.5
This change fixes this upcoming deprecation warning:

[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using
`result|skipped` instead use `result is skipped`. This feature will be removed
in version 2.9.

Change-Id: Ic0c93f2ea896ead76922694e6150882d8a280daf
2018-06-04 00:17:18 +00:00
Tristan Cacqueray 8a6b1215c3 bindep: use shell instead of command with executable
As of Ansible 2.4, the parameter 'executable' is
no longer supported with the 'command' module.

Also check for return code since it the |succeed changed
and now always returns True when using failed_when: false.

Change-Id: I4c33db7f3d6fd613a6144f7520054cbcf50684e1
2018-02-22 06:40:11 +00:00
Tristan Cacqueray ea5c3d08da bindep: skip package install when not needed
When bindep test doesn't output package, there is no need
to run the package task.

Change-Id: I6f13e060a6d9657d3dec4f43a0b9c2dbff2d362d
2017-12-05 09:09:34 +00:00
Tristan Cacqueray 184f036fd8 bindep: fix install bindep_command fact name
After installing bindep, the role should set the bindep_command fact
instead of bindep_found_command. Otherwise the role fail later:

Task: Define bindep_command fact
The error was: 'bindep_command' is undefined

Change-Id: I11a21c9678c75b7887a8a58c25925dc87e7c9315
2017-12-05 08:52:31 +00:00
Monty Taylor 1ea07ceee2
Update bindep role defaults to be more sane
The default for bindep dir should really be zuul.project.src_dir.

Also, this is a CI system. Let's default profile to test.

Change-Id: Ibc0e7617195865c50ea2bb0e969963f0525ea9b1
2017-10-17 16:18:22 +02:00
Zuul 8f28435e35 Merge "Don't install bindep if there's no bindep file" 2017-09-07 18:00:31 +00:00
Monty Taylor a18999e002
Don't install bindep if there's no bindep file
Change-Id: I60f229f06e9655bead1f38a8e2d70c3048c0269b
2017-09-05 21:50:09 -05:00
Zuul 5083adc2a8 Merge "Only do the bindep_command if bindep_file is defined" 2017-09-05 22:37:14 +00:00
Jamie Lennox 60328fef8c Only do the bindep_command if bindep_file is defined
If there is no bindep file at all in the repository (which is likely
because tox depends on bindep and won't always be useful) then
bindep_file is never set. Then when the set_face bindep_command comes
around it tries to reference the unset bindep_file and fails.

Change-Id: I7be6be88209810eed715daaa4bb41315e838272d
Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
2017-09-05 16:22:24 +10:00
Jamie Lennox 4ac946c4f2 Pass correct variables to install bindep
The result of creating a temporary directory for bindep is a dictionary
of data include mode, uuid, and other things. When installing bindep
into that new directory we only want to specify the path to that dir.

Change-Id: If98f87ff44356911b78984eb884f7cd65660cebb
Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
2017-09-05 10:40:08 +10: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
James E. Blair 912f976155 Use new sphinx roles in docs
Change-Id: I92ce6b2f137f5dcb6fdee70c101c6b9d8ad5eb11
Depends-On: I9d72d11bfdb700037a6a08f92a2dbfa95ee519ad
2017-08-11 15:10:40 -07:00
Paul Belanger 829297c37a
Ensure we load roles for linting
Did didn't have ansible-lint setup properly, as a results our roles
weren't actually linted properly.

Fix variable linting issues and ignore ANSIBLE0012.

Change-Id: I07aa940245e700c9f08df0f1920720f0ed9d3de0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-17 16:50:06 -04:00
Jenkins e680449351 Merge "Use package module to install bindep packages" 2017-07-13 18:50:41 +00:00
Monty Taylor fe6dc2204d
Use package module to install bindep packages
We can pass in a list of packages and the package managers we care about
should accept a list as input. We can't do the with_items trick because
the package action plugin does not support it.

Change-Id: Id79f33caa7cb3ab7255490d02cd2b43fc7d5227b
2017-07-13 08:07:03 -05:00
Paul Belanger 5738468cd8
Add openstack-doc-build job for documentation testing
Start gating on documentation changes. Eventually add support for
publishing them.

Change-Id: I9e75fee12e7d74db51661b6a1071a510788cde74
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-11 11:13:13 -04:00
Monty Taylor 242f0bfff4
Rework bindep role to be more ansible and less shell
There's still a chunk of shell, because it's honestly better than doing
the equiv with package manager modules would be.

Also, make zuul_work_dir a parameter we pass in from the playbook. The
bindep role itself is otherwise totally non-zuul specific.

Change-Id: I95e78dd25a1a54b3ce5f2ddb18228a183d3c06ad
2017-07-09 09:27:09 -05:00
Monty Taylor 1ba3e583f3
Make sure bindep is on the node
OpenStack nodes pre-install bindep, but other nodes may not. Check to
see if bindep is on the node. If so, use it. If not, make a temp dir
that we remove at the end of the role and install bindep into a virtualenv
in that tempdir.

Change-Id: I3f34c178254add2143dc7f1b9758844480d7d914
2017-07-09 07:46:07 -05:00
Monty Taylor 055de47b4e
Add zuul_work_dir default to one-project roles
We'd like to be able to make some jobs that run tox on other projects
for ease of testing. This should allow us to do that.

Change-Id: I774a76eaaea16d8ea218b439a099b5c9335c2fc5
2017-07-07 17:04:46 -05:00
Monty Taylor 4b9fc09a1c
Port in tox jobs from openstack-zuul-jobs
The original idea was that we'd have a "python27" job. But it turns out
that "python27" isn't actually as universal as you might think.
"tox-py27" on the other hand is a thing that can and should always work
for people who want to run tox with the py27 env.

Port in the jobs we had in openstack-zuul-jobs.

Also, copy in the text of the old shell scripts so that we can iterate on
them and make them better piecemeal.

These are named zuul-tox not tox because we already have tox jobs
defined elsewhere. We'll need to do the naming dance while we work on
them.

Change-Id: I813f3f2ae138c07918556bc81655518023527131
2017-07-06 11:18:47 -05:00