Commit Graph

68 Commits (424e1946f435c5228b450d802a16a585a7798665)

Author SHA1 Message Date
Matt Martz 3164e8b561 E501 fixes (#22879) 7 years ago
azenk bdf0ab451e Add role skeleton support (#17079)
* Add role skeleton support

The default role skeleton used by ansible-galaxy is good, but it doesn't
allow organizations to customize it to suit their needs.  This patch
addresses that by adding the option to point ansible-galaxy at a
role skeleton directory.  The contents of this directory are then
copied (or rendered) into the output role directory.  Appropriate
command line options and configuration entries are added to allow for
further customization from the role skeleton.

* Remove dependency on platforms list from test

Platforms are no longer provided to the template by galaxy init.
Removing the code in our test meta/main.yml template that relied on it.

* Fix whitespace issue
7 years ago
Brian Coca e3107cdeb6 removed unused imports and var 7 years ago
Scott Buchanan 8c6606aeee fix non-zero exit code on missing role file (#19002) 7 years ago
Adrian Likins 1e08e9a55f Remove platforms api request from galaxy 'init'
Instead of populating the platform comment in the default
meta/main.yml with a dict of platforms fetch from the
galaxy REST API, this removes the API call and adds a
commented out example platforms list to the default meta/main.yml

Fixes #18103
8 years ago
Will Thames 5ee5593cbf Improve ansible-galaxy handling of role versions (#12904)
* Improve ansible-galaxy handling of role versions

Ensure that role versions are considered when deciding
whether or not to (re-)install a role.

Issue a warning when the version of a dependency conflicts
with the version of an already installed role

Display what version of a role is being installed
Show the versions when upgrading/downgrading a role.

Implements #11266

* Improve force logic for galaxy version changes

Ensure that force is required to change role versions
8 years ago
Carlos E. Garcia 0b8011436d minor spelling changes 8 years ago
Chris Houseknecht dceb2a0393 Remove extra display statements and add docs (#18229)
* Add docs for ansible-galaxy import --role-name option.

* Add docs for ansible-galaxy init --container-enabled option.
8 years ago
Monty Taylor bd9ca5ef28 Allow setting alternate_role_name for galaxy CLI (#17418)
When using the ansible-galaxy CLI to import roles, it's not possible to
specify an alternate_role_name, even though the REST API seems to allow
such a thing (at least on investigation of the interactions the web app
makes) That makes importing things like:
openstack/openstack-ansible-os_cloudkitty wind up with roles named
"openstack-ansible-os_cloudkitty" instead of "os_cloudkitty".

Also, the web ui is smart and imports
"openstack-infra/ansible-role-puppet" as openstack-infra.puppet ... but
the CLI imports it as openstack-infra.ansible-role-puppet. Add that
filtering as well.

Issue ansible/galaxy-issues:#185
8 years ago
Chris Houseknecht d60bc492b6 Add --container-enabled option to `ansible-galaxy init` command. (#18157) 8 years ago
Toshio Kuratomi 1efe782b46 Refactor parsing of CLI args so that we can modify them in the base class
Implement tag and skip_tag handling in the CLI() class.  Change tag and
skip_tag command line options to be accepted multiple times on the CLI
and add them together rather than overwrite.

* Make it configurable whether to merge or overwrite multiple --tags arguments
* Make the base CLI class an abstractbaseclass so we can implement
  functionality in parse() but still make subclasses implement it.
* Deprecate the overwrite feature of --tags with a message that the
  default will change in 2.4 and go away in 2.5.

* Add documentation for merge_multiple_cli_flags
* Fix galaxy search so its tags argument does not conflict with generic tags
* Unit tests and more integration tests for tags
8 years ago
Toshio Kuratomi f4cd1c6321 Fix galaxy's parsing of the command line. (#17569)
Also make the parsing of the action in both galaxy and vault more
robust.

Fixes #17534
May Fix #17563
8 years ago
Toshio Kuratomi 4ed88512e4 Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because
of licensing.  So once created it we had two sets of functions that did
the same things but had different implementations.  To remedy that, this
change removes the ansible.utils.unicode versions of those functions.
8 years ago
Toshio Kuratomi 44d979c8f5 Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass:

* galaxy imports
* dictionary iteration in role requirements
* swap_stdout helper for unittests
* Normalize to text string in a facts.py function
8 years ago
James Cammarata 4bc85e150a Merge pull request #12807 from Lujeni/devel
Ansible-galaxy requirements support a include directive
8 years ago
jctanner 2bf2e0fdfd Force relative role paths to be absolute and correct errors about missing path(s). (#16088)
Addresses #10811
8 years ago
Adrian Likins 1468538414 galaxy info displayed 'galaxy_info' section wrong
The output of 'ansible-galaxy info' was formatting the
'galaxy_info' key with one char per line.

Previously, when building the output string, items in
role_info that had a dict for value, the label for
it's key ('galaxy_info' for ex) was being added to
the text list in addition to being appended. Only
the append is needed.

Also added a unit test in test/units/cli/test_galaxy.py,
but skip it on py3 until galaxy is py3 compatible.

fixes #15177
8 years ago
Brian Coca e63bf1d86e fix version/help when missing action
also fixed issues with galaxy cli options
8 years ago
Brian Coca eaa7b9c0b7 treat roles_path as the list it is for galaxy list 8 years ago
Chris Houseknecht 2261b2e59a Fix missing ignore_certs (#16018) 8 years ago
Brian Coca 941564b366 API now connects to server lazily (#15632)
This should fix most issues with offline operation.

Fixes #14486
Fixes #13991

Alternate to #15363 and #15593
8 years ago
Chris Houseknecht 2dd687acdd Merge pull request #15256 from alikins/galaxy_roles_path_fix_15255
Fix galaxy roles_path cli usage. (#15255)
8 years ago
Adrian Likins 05b46091e4 Fix galaxy roles_path cli usage.
If we specify a roles_path from the cli, use a
optparse action callback to make sure the roles_path
is set to a path list.

Fixes #15255
8 years ago
Justin Phelps d604c8c3a6 Remove trailing whitespace from the galaxy init Jinja2 template. Default a description. 8 years ago
THEBAULT Julien 7c2ff0e66b Ansible-galaxy support the include directive 8 years ago
Toshio Kuratomi fa9822df0f Changes to convert to unicode at the borders
The module docs and vault changes solve issues where tracebacks can
happen.  The galaxy changes are mostly refactoring to be more pythonic
with a small chance that a unicode traceback could have occurred there
without the changes.  The change in __init__.py when we actually call
the pager makes things more robust but could hide places where we had
bytes coming in already so I didn't want to change that without auditing
where the text was coming from.

Fixes #14178
9 years ago
Sergii Korochkin 1325c21ca0 Adding support for scm-based role source urls (incl. integration test to cover it) 9 years ago
Brian Coca eb4ab5fa2a Revert "Show version without supplying a dummy action"
This reverts commit 11b55be5bb.
Parsing before action will fail if one of the action specific options is used
As per issue #13743
9 years ago
muffl0n 11b55be5bb Show version without supplying a dummy action
fixes #12004
parsing x2 does not seem to break anything
9 years ago
Brian Coca d3deb24ead output color is now configurable 9 years ago
chouseknecht 06dde0d332 Fixed documentation typos and bits that needed clarification. Fixed missing spaces in VALID_ACTIONS. 9 years ago
chouseknecht 342dee0023 Define and handle ignore_certs correctly. Preserve search term order. Tweak to Galaxy docsite. 9 years ago
chouseknecht bc73920090 Updated ansible-galaxy man page. Removed -b option for import. 9 years ago
chouseknecht d8e6bc98a2 Fix overloaded options. Show an error when no action given. Don't show a helpful list of commands and descriptions. 9 years ago
Brian Coca 8e445c551a removed unused imports in galaxy/cli 9 years ago
chouseknecht 4f84769a17 Galaxy 2.0 9 years ago
Toshio Kuratomi 4d637e5780 Use self.args when we parse arguments that way the arguments can be constructed manually 9 years ago
Toshio Kuratomi 62979efa14 Finish up plugin porting to global display
Also remove display = display which does nothing
9 years ago
Toshio Kuratomi 318bfbb207 Migrate cli and dependencies to use global display 9 years ago
Will Thames 91b6004149 Allow blank lines and comments/spaces in galaxy spec files
Fixes #10641 again. (Regression)
Added test to discourage future such regression.
9 years ago
Brian Coca 1ecad5aed2 now galaxy correctly detects empty requirements file
also allow for 'scm' and 'src' not to be populated in requirements entries
9 years ago
Toshio Kuratomi f34b55ac2b Add python3-compat boilerplate to all .py files in lib/ansible 9 years ago
Brian Coca 638bc14566 now deps is always a list 9 years ago
Florian Apolloner 354383874f Show a nice error if the role name is missing. 9 years ago
James Cammarata 8107c4efc7 Fixing a bug in galaxy parsing of text spec file lines 9 years ago
James Cammarata 9c9897805f More ansible-galaxy fixes for the old spec file format 9 years ago
James Cammarata 3b8eaf6128 Cleaning up some ansible-galaxy stuff 9 years ago
Brian Coca 6f88f79de9 removed dupe install code, now trap errors forom role.install 9 years ago
Brian Coca f73329401b galaxy updates
better error reporting on fetching errors
use scm if it exists over src
unified functions in requirements
simplified logic
added verbose to tests
cleanup code refs, unused options and dead code
moved get_opt to base class
fixes #11920
fixes #12612
fixes #10454
9 years ago
Brian Coca 8528b20702 fixed usage text 9 years ago