Commit Graph

40 Commits (97cc0cce7f53b704f8541530e42d5e515584cd95)

Author SHA1 Message Date
David Davis 2d21c7da17 Allow the galaxy client to fetch from a url in role version data (#39396)
Currently if the ansible-galaxy client fetches a role from a galaxy
server, it then fetches the role from Github. This change allows a
galaxy server to provide an alternate source url that points to an
archive that contains the role version.
6 years ago
Leigh Jenkin e224039586 Fixes #12353 #20977 adds new option to galaxy cli to preserve scm meta (#34642) 6 years ago
Adam Miller 6cc5e4c9df
galaxy remove incorrect check for role path before extraction (#35259)
* galaxy remove incorrect check for role path before extraction

Fixes #35217

Currently lib/ansible/galaxy/role.py checks roles_path and will
ignore paths that don't currently exist which it should not because
the path will attempt to be created by the role extraction process
(which is valid and expected behavior) and if unable to write at the
time of role extraction into the role_path, that error will be
handled properly at that point in the process.

Signed-off-by: Adam Miller <admiller@redhat.com>

* add test case for galaxy install with rolefile and rolepath

Verify we don't regress GitHub Issue #35217

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix the integration test

Signed-off-by: Adam Miller <admiller@redhat.com>

* double quote for shellcheck glob warning

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix galaxy install tests to not need remote resources

Signed-off-by: Adam Miller <admiller@redhat.com>

* make shellcheck sanity tests happy

Signed-off-by: Adam Miller <admiller@redhat.com>

* prep git global conf for running the galaxy install tests in docker

Signed-off-by: Adam Miller <admiller@redhat.com>

* move ansible-galaxy tests into their own target, make git conf non-global

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix up tests based on feedback

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove extra newline from aliases file

Signed-off-by: Adam Miller <admiller@redhat.com>
7 years ago
Matt Martz 42a0d71413
Catch exception comparing role versions, and provide a user friendly error message. Fixes #32301 (#34427) 7 years ago
Alexander Saprykin 58e255c2d9 Fix IndexError raised on galaxy-install
This patch fixes IndexError, that may be raised When trying
to install a role with `ansible-galaxy` in case of
access error to roles directory.

Issue: ansible/galaxy#149
7 years ago
Chris Houseknecht 3db768f393 Removes container-enabled warning (#27578) 7 years ago
Brian Coca 8f97aef1a3 Transition inventory into plugins (#23001)
* draft new inventory plugin arch, yaml sample

 - split classes, moved out of init
 - extra debug statements
 - allow mulitple invenotry files
 - dont add hosts more than once
 - simplified host vars
 - since now we can have multiple, inventory_dir/file needs to be per host
 - ported yaml/script/ini/virtualbox plugins, dir is 'built in manager'
 - centralized localhost handling
 - added plugin docs
 - leaner meaner inventory (split to data + manager)
 - moved noop vars plugin
 - added 'postprocessing' inventory plugins
 - fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them
 - grouphost_vars loading as inventory plugin (postprocessing)
 - playbook_dir allways full path
 - use bytes for file operations
 - better handling of empty/null sources
 - added test target that skips networking modules
 - now var manager loads play group/host_vars independant from inventory
 - centralized play setup repeat code
 - updated changelog with inv features
 - asperioribus verbis spatium album
 - fixed dataloader to new sig
 - made yaml plugin more resistant to bad data
 - nicer error msgs
 - fixed undeclared group detection
 - fixed 'ungrouping'
 - docs updated s/INI/file/ as its not only format
 - made behaviour of var merge a toggle
 - made 'source over group' path follow existing rule for var precedence
 - updated add_host/group from strategy
 - made host_list a plugin and added it to defaults
 - added advanced_host_list as example variation
 - refactored 'display' to be availbe by default in class inheritance
 - optimized implicit handling as per @pilou's feedback
 - removed unused code and tests
 - added inventory cache and vbox plugin now uses it
 - added _compose method for variable expressions in plugins
 - vbox plugin now uses 'compose'
 - require yaml extension for yaml
 - fix for plugin loader to always add original_path, even when not using all()
 - fix py3 issues
 - added --inventory as clearer option
 - return name when stringifying host objects
 - ajdust checks to code moving

* reworked vars and vars precedence
 - vars plugins now load group/host_vars dirs
 - precedence for host vars is now configurable
 - vars_plugins been reworked
 - removed unused vars cache
 - removed _gathered_facts as we are not keeping info in host anymore
 - cleaned up tests
 - fixed ansible-pull to work with new inventory
 - removed version added notation to please rst check
 - inventory in config relative to config
 - ensures full paths on passed inventories

* implicit localhost connection local
7 years ago
Dag Wieers c4a7f64c02 ansible/galaxy: PEP8 compliancy (#24696)
- Make PEP8 compliant
7 years ago
Timo Benk 79943b86a1 fix ansible galaxy file mangling (#23703)
without this patch, ansible-galaxy will mangle files containing
the archive parent directory name, eg 'owncloud/files/owncloud.cron'
will become 'owncloud/files/.cron'.

The previous code could affect the entire path and even filenames.
If a file path has the top level dir name as a substring, galaxy
replaces it with ''. In one example, the archive top level dir
is 'go', so 'files/go-bin.sh' becomes 'files/-bin.sh'.

Fixes #22572, #23694, #23623
7 years ago
Matt Martz 3164e8b561 E501 fixes (#22879) 7 years ago
Will Thames 19d390135e Improve galaxy handling of tgz roles
Gerrithub presents tgz downloads that do not have a containing
directory. This causes a stack trace.

As all roles must contain a meta/main.yml, change ansible-galaxy
to use that to determine the enclosing directory (in the case
of multiple meta/main.yml files, use the one with the shortest parent)

Fixes #15413
7 years ago
Matt Clay cb76200c7d PEP 8 E111 & E114 cleanup. (#20838) 8 years ago
Matt Clay d913f69ba1 PEP 8 W291 whitespace cleanup. 8 years ago
Matt Clay 95789f3949 PEP 8 whitespace cleanup. (#20783)
* PEP 8 E271 whitespace cleanup.
* PEP 8 W293 whitespace cleanup.
* Fix whitespace issue from recent PR.
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
Chris Houseknecht 599e016315 For container enabled role, display warning only when not ANSIBLE_CONTAINER (#18717) 8 years ago
jctanner b494d55bde Cast input role version to string before comparing to available versions (#18269)
* Cast input role version to string before comparing to avaialble versions

Fixes #10262
8 years ago
Chris Houseknecht 77de83730d Add warnings when installing container type roles 8 years ago
jctanner af2ce7725b Iterate through role paths when installing roles (#17487)
* Iterate through role paths when attempting to install roles
8 years ago
Will Thames 0e16a5f3ee Retain local tar.gz roles during galaxy install (#16592)
Don't treat local tar.gz files as temporary when cleaning
up at the end of an ansible-galaxy install
8 years ago
Brian Coca 011320793b moved validate info from vvv to debug 8 years ago
Chris Houseknecht 2261b2e59a Fix missing ignore_certs (#16018) 8 years ago
Greg Sidelinger 11ffc0bfee Fix issue with ansible-galaxy and --ignore-certs
The --ingore-certs flag was not honored for https://server/role.tar.gz roles in the requirements file.
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
James Cammarata 58a6cf822a Merge pull request #13203 from willthames/galaxy_10620
Allow tree-ish versions for ansible-galaxy
8 years ago
Toshio Kuratomi b1a56051bd Prevent traceback.
https://github.com/ansible/ansible/issues/13743#issuecomment-171520585

In some circumstance, the file fails to open.  When that occurs, we
can't try to close it in the finally clause.  Using a context manager is
the cleanest way to change the code to account for that case.
9 years ago
chouseknecht 4f84769a17 Galaxy 2.0 9 years ago
Mick Bass 9761250a4b Allow tree-ish to be used for galaxy role version
Ensure that ansible-galaxy version can be a branch, a tag, or any tree-ish
supported by git including specific commit IDs.  For git scm roles, adds an
explicit git checkout of the specified role_version prior to the git archive.
This means that we'll always archive from HEAD of whatever role_version is
checked out. role_version can be a branch, a tag, or any <tree-ish> supported
by git including specific commit IDs.  These changes also ensure
ansible-galaxy works for scm clones when specified version differs from
repository default branch.
9 years ago
Toshio Kuratomi f34b55ac2b Add python3-compat boilerplate to all .py files in lib/ansible 9 years ago
James Cammarata 3b8eaf6128 Cleaning up some ansible-galaxy stuff 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
James Cammarata 053c41e79d Fix typo in ansible module_utils import from galaxy code 9 years ago
Toshio Kuratomi 3db8070aa3 Fix urlopen usage to use open_url instead
Add a travis test for urlopen usage
9 years ago
Toshio Kuratomi 30552cf7e9 Fix problems with undefined references to self.display and remove method that's no longer called 9 years ago
James Cammarata 2a50957ad8 Fix galaxy install dep failure
Also fixes issue where force does not force reinstall of deps

Fixes #10425
9 years ago
Brian Coca 514fa73fcd galaxy fixes 9 years ago
Brian Coca 8153c34abf now returns false on bad role_data 9 years ago
Brian Coca 96bcf50a94 implemented requirements file in v2
fixes #11179
9 years ago
Will Thames 9abd9a8f57 Make ansible-galaxy work with galaxy.ansible.com
Now works with role files that use Ansible Galaxy roles
Still work to do on making this work with internal roles
9 years ago
James Cammarata ce3ef7f4c1 Making the switch to v2 9 years ago