| Commit message (Collapse) | Author | Age |
| |
|
|
|
| |
to make CI pass again
|
|\
| |
| | |
Fix some things to make inventory script perform better.
|
|/
|
|
|
| |
- use requests Session, for HTTP pipelining
- only write cache once
|
|\
| |
| | |
grabbing hostgroup_title instead of hostgroup_name...
|
|/
|
|
| |
instead of hostgroup_name to correctly return nested hostgroups to ansible
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
| |
So far we passed on the python exception. Be a bit more verbose and use
defaults for everything but the basic foreman interaction.
|
| |
|
|
|
| |
This avoids endless loops when Foreman miscounts the results
|
| |
|
| |
|
|\
| |
| | |
Add some tests and conform to pep8
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|
|
|
|
|
| |
cleanups to katello-support stuff
added content view and lifecycle environment grouping support
|
| |
|
|
|
|
| |
so we can run tools on it that import the module for analysis
|
|
|
|
|
| |
This brings down inventory generation by about 50% and I doubt lots
of people use it to fetch facts from other hosts.
|
| |
|
|\
| |
| | |
Switch out the shebang to invoke python via /usr/bin/env
|
|/
|
|
|
| |
Figure out the correct location of python via env, thus ensuring that
this script plays nice with things like pyenv.
|
|\
| |
| | |
Add environment ansible group
|
|/ |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Set prefix for Ansible groups
|
|/ |
|
|\
| |
| | |
Don't fail if host disappears
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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..
|
|\
| |
| | |
read foreman.ini from environment if set
|
| | |
|
|/ |
|
|\
| |
| | |
expand the use of '~' in cache path location
|
|/
|
|
|
|
|
|
| |
Apply a bit more intelligence to the config parser. This allows the
cache files to be anchored within a homedir.
[cache]
path = ~/.ansible/tmp
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Instead of only allowing groups created from host group params also
allow to use host variables like subnet_name.
Closes: #5
|
|\ \
| |/
|/| |
Pagination logic improvements
|
| |
| |
| |
| |
| | |
* Rewrite _get_json() to not use recursion
* Increase per_page limit to 250
|
| | |
|
|\|
| |
| | |
add support for pagination
|
| | |
|