summaryrefslogtreecommitdiff
path: root/lib/ansible/galaxy
Commit message (Collapse)AuthorAgeFilesLines
...
* Save the command line arguments into a global contextToshio Kuratomi2019-01-033-13/+14
| | | | | | | | | | | | | | * Once cli args are parsed, they're constant. So, save the parsed args into the global context for everyone else to use them from now on. * Port cli scripts to use the CLIARGS in the context * Refactor call to parse cli args into the run() method * Fix unittests for changes to the internals of CLI arg parsing * Port callback plugins to use context.CLIARGS * Got rid of the private self._options attribute * Use context.CLIARGS in the individual callback plugins instead. * Also output positional arguments in default and unixy plugins * Code has been simplified since we're now dealing with a dict rather than Optparse.Value
* Update bare exceptions to specify Exception.Toshio Kuratomi2018-12-163-9/+9
| | | | | This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
* Add a Singleton metaclass, use it with Display (#48935)Matt Martz2018-11-204-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add a Singleton class, use it with Display * update six import * Move remaining failes to display singleton * Fix rebase issues * Singleton improvements * Add code-smell for 'from __main__ import display'. ci_complete * s/self/cls/g * Add docs for no-main-display * Address linting issues * Add changelog fragment. ci_complete * Implement reentrant lock for class instantiation in Singleton * Add Display singleton porting guide
* Support .yaml extension for meta file (#46505)Jiri Tyr2018-11-091-21/+23
|
* Do not use str() on exceptions (#46950)Martin Krizek2018-11-092-4/+5
|
* ansible-galaxy: fix searching with unicodeMartin Krizek2018-10-181-3/+3
|
* Link to the Galaxy platforms list from the meta file template (#34046)Aidan Feldman2018-09-172-2/+8
| | | | | | * Link to the Galaxy platforms list from the meta file template Fixes https://github.com/ansible/galaxy/issues/52. * make ansible/ansible text match mazer text on platforms
* Fix invalid Dockerfile created by "galaxy init --type apb" (#42017)Derek Whatley2018-07-171-0/+1
|
* Fix galaxy client executing queries with invalid http method (#42201)Alexander Saprykin2018-07-021-2/+2
| | | Fixes: ansible/galaxy#796
* Update APB templates (#41559)David Zager2018-06-144-7/+4
|
* Allow the galaxy client to fetch from a url in role version data (#39396)David Davis2018-04-302-2/+7
| | | | | | 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.
* Ansible Galaxy: skel for network role #37241 (#37251)Victor da Costa2018-03-0917-0/+522
| | | | | | | | * Skel for network role (#37241) Skel and boilerplate for network role. * Add network option as valid type
* Add APB role_type to ansible-galaxy init (#36789)Dylan Murray2018-03-0931-1/+199
| | | | | | | | | | | | * Add APB role_type to ansible-galaxy init * Add handlers scaffolding * Fix shippable errors by setting default * Add unit tests and fix shippable * Updates init description
* Fixes #12353 #20977 adds new option to galaxy cli to preserve scm meta (#34642)Leigh Jenkin2018-02-211-7/+2
|
* galaxy remove incorrect check for role path before extraction (#35259)Adam Miller2018-01-301-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Catch exception comparing role versions, and provide a user friendly error ↵Matt Martz2018-01-111-1/+8
| | | | message. Fixes #32301 (#34427)
* Fix a typo in the readme of the skeleton used by ansible-galaxy. (#33807)Haidara Mohamed El Mouctar2017-12-131-1/+1
| | | `ansible-container init` instead of `ansible-contiainer init`
* Fix IndexError raised on galaxy-installAlexander Saprykin2017-11-141-4/+4
| | | | | | | | 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
* Removes container-enabled warning (#27578)Chris Houseknecht2017-08-011-6/+1
|
* Fix wildcard import in galaxy/token.pyToshio Kuratomi2017-07-271-1/+2
|
* Fix undefined variables, basestring usage, and some associated python3 issuesToshio Kuratomi2017-07-251-1/+2
|
* Transition inventory into plugins (#23001)Brian Coca2017-05-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* ansible/galaxy: PEP8 compliancy (#24696)Dag Wieers2017-05-185-27/+25
| | | - Make PEP8 compliant
* fix ansible galaxy file mangling (#23703)Timo Benk2017-04-191-1/+1
| | | | | | | | | | | | 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
* Update module_utils.six to latest (#22855)Toshio Kuratomi2017-03-233-8/+7
| | | | | | | | * Update module_utils.six to latest We've been held back on the version of six we could use on the module side to 1.4.x because of python-2.4 compatibility. Now that our minimum is Python-2.6, we can update to the latest version of six in module_utils and get rid of the second copy in lib/ansible/compat.
* E501 fixes (#22879)Matt Martz2017-03-221-2/+5
|
* Add role skeleton support (#17079)azenk2017-03-014-0/+0
| | | | | | | | | | | | | | | | | | | * 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
* Remove `platform` var from container_enabled meta (#22096)Chris Houseknecht2017-02-281-11/+12
|
* Improve galaxy handling of tgz rolesWill Thames2017-02-271-7/+16
| | | | | | | | | | | 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
* Remove unnecessary shebangs and execute bits.Matt Clay2017-02-223-6/+0
|
* PEP 8 E111 & E114 cleanup. (#20838)Matt Clay2017-01-301-1/+1
|
* PEP 8 cleanup. (#20789)Matt Clay2017-01-281-1/+1
| | | | | | | * PEP 8 E703 cleanup. * PEP 8 E701 cleanup. * PEP 8 E711 cleanup. * PEP 8 W191 and E101 cleanup.
* PEP 8 W291 whitespace cleanup.Matt Clay2017-01-273-7/+7
|
* PEP 8 whitespace cleanup. (#20783)Matt Clay2017-01-273-8/+8
| | | | | | * PEP 8 E271 whitespace cleanup. * PEP 8 W293 whitespace cleanup. * Fix whitespace issue from recent PR.
* Fix infrequent PEP 8 issues.Matt Clay2017-01-271-1/+1
|
* Remove platforms api request from galaxy 'init'Adrian Likins2017-01-251-12/+12
| | | | | | | | | 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
* Improve ansible-galaxy handling of role versions (#12904)Will Thames2017-01-171-1/+10
| | | | | | | | | | | | | | | | | | | * 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
* Previous fix to this failed to account for open_url returning a filehandle ↵Toshio Kuratomi2017-01-101-4/+4
| | | | | | | | | | | | | | | | | (#20097) * Previous fix to this failed to account for open_url returning a filehandle Fixes the bugs introduced by c6fb355 * read() from HTTPError for python-3.6+ HTTPError is funny. It contains a filehandle to read the response from and also makes it available via a read() method. On earlier versions of python (2 and 3) the read() method was enough to make it work with json.load(). The newer version of json.load() needs a more complete file interface than this and has stopped working. Read the bytes, transform to str and pass it in manually to fix it.
* Convert all results from open_url() into text before deserializing the json. ↵Toshio Kuratomi2017-01-101-4/+4
| | | | | (#20069) Fixes #20012
* For container enabled role, display warning only when not ANSIBLE_CONTAINER ↵Chris Houseknecht2016-12-021-2/+2
| | | | (#18717)
* Cast input role version to string before comparing to available versions ↵jctanner2016-10-311-1/+1
| | | | | | | | (#18269) * Cast input role version to string before comparing to avaialble versions Fixes #10262
* Allow setting alternate_role_name for galaxy CLI (#17418)Monty Taylor2016-10-271-4/+8
| | | | | | | | | | | | | | | 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
* Add --container-enabled option to `ansible-galaxy init` command. (#18157)Chris Houseknecht2016-10-2721-35/+200
|
* Add warnings when installing container type rolesChris Houseknecht2016-10-093-15/+29
|
* Iterate through role paths when installing roles (#17487)jctanner2016-09-091-31/+45
| | | | * Iterate through role paths when attempting to install roles
* Move uses of to_bytes, to_text, to_native to use the module_utils version ↵Toshio Kuratomi2016-09-061-5/+5
| | | | | | | | (#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.
* Enable most unittests on python3 (just some vault unittests and a logging ↵Toshio Kuratomi2016-08-252-9/+7
| | | | | | | | | | 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
* Migrate basestring to a python3 compatible type (#17199)Toshio Kuratomi2016-08-231-9/+11
|
* Fixes #163 in galaxy-issuess-hertel2016-07-211-0/+1
|
* Retain local tar.gz roles during galaxy install (#16592)Will Thames2016-07-061-4/+7
| | | | Don't treat local tar.gz files as temporary when cleaning up at the end of an ansible-galaxy install