aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Make cache file names configurableHEADmasterJoey Loman2017-05-04
|
* Fix flake8 errorGuido Günther2017-01-13
| | | to make CI pass again
* Merge pull request #41 from wenottingham/perfGuido Günther2017-01-12
|\ | | | | Fix some things to make inventory script perform better.
| * Fix some things to make inventory script perform better.Bill Nottingham2017-01-12
|/ | | | | - use requests Session, for HTTP pipelining - only write cache once
* Merge pull request #38 from smnmtzgr/fix-nested-hostgroupsGuido Günther2016-10-14
|\ | | | | grabbing hostgroup_title instead of hostgroup_name...
| * Newer foreman versions (1.13.0 and later) should use hostgroup_titleSimon Metzger2016-10-14
|/ | | | instead of hostgroup_name to correctly return nested hostgroups to ansible
* Python3 (#37)Guido Günther2016-10-03
| | | | | | | | | | | | | | | | | | | | | | | | * Handle python3's configparser as well * tests: Open file in text mode to avoid string bytes conversion with Python3 * tests: drop unnecessary dict These arent sortable in Python3 * Convert returned facts to list While Python2 has a list here Python3 returns dict_values which is not indexable as is. * tests: Parse url for comparison Python3 uses hash seeds for comparison so the QS parts dont have a fixed order. * Test python3.4 and python3.5 as well
* Add pipy badge (#35)Guido Günther2016-09-30
|
* Bump version to 0.0.4Guido Günther2016-09-29
|
* Improve error message with broken config fileGuido Günther2016-09-28
| | | | So far we passed on the python exception. Be a bit more verbose and use defaults for everything but the basic foreman interaction.
* Run flake8 to verify styleGuido Günther2016-09-28
|
* Break the loop if we don't make any progress (#31)Guido Günther2016-09-13
| | | This avoids endless loops when Foreman miscounts the results
* Add travis ci status (#30)Guido Günther2016-09-12
|
* Enable Travis CI (#29)Daniel Lobato García2016-09-06
|
* Merge pull request #26 from theforeman/testsDaniel Lobato García2016-08-18
|\ | | | | Add some tests and conform to pep8
| * Make inventory script pep8 compliantGuido Günther2016-08-14
| |
| * Make setup.py pep8 compliantGuido Günther2016-08-14
| |
| * Add a test for methods invoking _get_json()Guido Günther2016-08-14
| |
| * Add doctest for safe_wordGuido Günther2016-08-14
| |
| * Don't perform all the work in the constructorGuido Günther2016-08-14
| | | | | | | | | | | | | | This is a left over from the cobbler inventory this is based on. Instead add a run() method that performs all the work and split out config file parsing and output to ease testability.
| * Add nosetest and tox setupGuido Günther2016-08-14
|/
* added group by lifecycle_environment and contentview functionalityNicholas Strugnell2016-08-10
| | | | | | cleanups to katello-support stuff added content view and lifecycle environment grouping support
* added content view and lifecycle environment grouping supportNicholas Strugnell2016-08-09
|
* Only call ForemanInventory when __main__ is setGuido Günther2016-08-08
| | | | so we can run tools on it that import the module for analysis
* Allow to disable fact cacheGuido Günther2016-08-08
| | | | | This brings down inventory generation by about 50% and I doubt lots of people use it to fetch facts from other hosts.
* In case of 404 we get an empty list but expect an empty dictGuido Günther2016-08-05
|
* Merge pull request #22 from yankcrime/masterGuido Günther2016-08-05
|\ | | | | Switch out the shebang to invoke python via /usr/bin/env
| * Switch out the shebang to invoke python via /usr/bin/envNick Jones2016-08-04
|/ | | | | Figure out the correct location of python via env, thus ensuring that this script plays nice with things like pyenv.
* Merge pull request #16 from mspaulding06/masterGuido Günther2016-06-17
|\ | | | | Add environment ansible group
| * Add environment ansible groupMatt Spaulding2016-06-17
|/
* Resolve params via all_parameters onlyGuido Günther2016-06-12
| | | | | | | | No need to do manual resolution since Foreman does this internally already. Also reduces the number of API requests since we don't need to resolve hostgroups. Closes: #9
* Use Foreman to calculate resulting set of paramsAriel Salvo2016-06-12
|
* Add facts to hostvars as wellGuido Günther2016-06-10
| | | | | | | | | | | | | | | This simplifies provisioning since one doesn't have to resort to ansible fact caching or having to run a playbook on hosts during the same ansible run just to gather their facts so another host gets access to it. The facts returned by the foreman contain ruby hashes converted to strings like "ansible_cmdline": "{\"BOOT_IMAGE\"=>\"/vmlinuz\", \"resume\"=>\"/dev/sda1\", \"showopts\"=>true, \"quiet\"=>true, \"splash\"=>\"silent\", \"root\"=>\"UUID=3ce19455-c491-42f6-bbf1-38e8596561c0\"}", We don't perform any attempts to reparse these but rather look into fixing this on the foreman side.
* Merge pull request #13 from dLobatog/prefixGuido Günther2016-05-12
|\ | | | | Set prefix for Ansible groups
| * Set prefix for Ansible groupsDaniel Lobato2016-05-12
|/
* Merge pull request #12 from theforeman/handle_404Guido Günther2016-05-04
|\ | | | | Don't fail if host disappears
| * Don't fail if host disappearsGuido Günther2016-04-29
|/ | | | | | | | | | | | | | | | | | | | | | | | | A host might disappear once we query its params. Don't fail like Traceback (most recent call last): File "inventory", line 295, in <module> ForemanInventory() File "inventory", line 52, in __init__ self.update_cache() File "inventory", line 204, in update_cache params = self._resolve_params(host) File "inventory", line 180, in _resolve_params paramgroups += [self._get_params_by_id(host['id'])] File "inventory", line 158, in _get_params_by_id return self._get_json(url) File "inventory", line 137, in _get_json ret.raise_for_status() File "models.py", line 840, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https:parameters?per_page=250&page=1> in this case. We need to do this for disappearing host groups, locations and organizations as well at a later point but VMs disappaer much more frequently..
* Merge pull request #11 from wwitzel3/masterGuido Günther2016-04-14
|\ | | | | read foreman.ini from environment if set
| * Update docs with ini discovery orderWayne Witzel III2016-04-12
| |
| * read foreman.ini from environment if setWayne Witzel III2016-04-05
|/
* Merge pull request #10 from aboyett/expand-cache-pathGuido Günther2016-03-24
|\ | | | | expand the use of '~' in cache path location
| * expand the use of '~' in cache path locationAndy Boyett2016-03-24
|/ | | | | | | | Apply a bit more intelligence to the config parser. This allows the cache files to be anchored within a homedir. [cache] path = ~/.ansible/tmp
* Bump version to 0.0.3v0.0.3Guido Günther2016-03-23
|
* Merge branch 'gh/5'v0.0.2Guido Günther2016-02-29
|\
| * Expand host variables as wellGuido Günther2016-02-29
| | | | | | | | | | | | | | Instead of only allowing groups created from host group params also allow to use host variables like subnet_name. Closes: #5
* | Merge pull request #6 from brandonweeks/paginationGuido Günther2016-02-26
|\ \ | |/ |/| Pagination logic improvements
| * Pagination logic improvementsBrandon Weeks2016-02-25
| | | | | | | | | | * Rewrite _get_json() to not use recursion * Increase per_page limit to 250
* | Don't forget to load params on valid cacheGuido Günther2016-02-18
| |
* | Merge pull request #4 from brandonweeks/paginationGuido Günther2016-02-18
|\| | | | | add support for pagination
| * add support for paginationBrandon Weeks2016-02-17
| |