You could make a SCM inventory and throw in https://github.com/ansible/ansible/blob/devel/contrib/inventory/openshift.pyHowever, I believe that the current state of inventory plugins are dramatically further advanced than this, and in my experience gives a lot of out-of-the-box functionality. You should still be able to use inventory plugins in SCM inventory by using the related folder (inventory_plugins I believe). However, there are some gotchas you may run into.I'm working on the transition of inventory plugins for the builtin sources (of which k8s are not one), but OpenShift will probably be my go-to example for making a user-defined inventory plugin in AWX. If you have any feedback from using plugins in AWX now, certainly let me know.Alangithub: AlanCoding
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/8a3b5417-75b6-47bc-843d-1bdedbd5ce97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
plugin: k8s connections: host: https://192.168.64.4:8443 token: xxxxxxxxxxxxxxxx ssl_verify: false
2018-12-16 21:05:43,544 INFO awx.main.commands.inventory_import Updating inventory 2: dev-rancher22018-12-16 21:05:43,557 INFO awx.main.commands.inventory_import Reading Ansible inventory source: /var/lib/awx/projects/_6__k8s_inventory3Traceback (most recent call last):4 File "/usr/bin/awx-manage", line 9, in <module>5 load_entry_point('awx==2.1.2.0', 'console_scripts', 'awx-manage')()6 File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 150, in manage7 execute_from_command_line(sys.argv)8 File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line9 utility.execute()10 File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute11 self.fetch_command(subcommand).run_from_argv(self.argv)12 File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv13 self.execute(*args, **cmd_options)14 File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute15 output = self.handle(*args, **options)16 File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 994, in handle17 self.is_custom)18 File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 245, in load_inventory_source19 is_custom=is_custom).load()20 File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 180, in load21 data = self.command_to_json(base_args + ['--list'])22 File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 163, in command_to_json23 self.method, proc.returncode, stdout, stderr))24RuntimeError: ansible-inventory failed (rc=1) with stdout:26stderr:27 [WARNING]: * Failed to parse /var/lib/awx/projects/_6__k8s_inventory/k8s.yaml28with k8s plugin: This module requires the OpenShift Python client. Try `pip29install openshift`3031 [WARNING]: Unable to parse /var/lib/awx/projects/_6__k8s_inventory/k8s.yaml as32an inventory source3334 [WARNING]: * Failed to parse35/var/lib/awx/projects/_6__k8s_inventory/playbook.yaml with k8s plugin:36'AnsibleSequence' object has no attribute 'get'3738 [WARNING]: Unable to parse39/var/lib/awx/projects/_6__k8s_inventory/playbook.yaml as an inventory source4041 [WARNING]: Unable to parse /var/lib/awx/projects/_6__k8s_inventory as an42inventory source4344ERROR! No inventory was parsed, please check your configuration and options.
--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project...@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/c86a026e-5fac-40bd-a5fd-e88eaa3c3889%40googlegroups.com.
pip install openshiftCollecting openshift Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module> File "/tmp/pip-build-tP31DU/openshift/setup.py", line 50, in <module> packages=find_packages(include='openshift.*'), TypeError: find_packages() got an unexpected keyword argument 'include'
----------------------------------------Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tP31DU/openshift/You are using pip version 8.1.2, however version 18.1 is available.You should consider upgrading via the 'pip install --upgrade pip' command.bash-4.2$ pip install --upgrade setuptoolsCache entry deserialization failed, entry ignoredCollecting setuptools Cache entry deserialization failed, entry ignored Downloading https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573kB) 100% |################################| 573kB 1.7MB/sInstalling collected packages: setuptools Found existing installation: setuptools 0.9.8 Uninstalling setuptools-0.9.8:Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 326, in run strip_file_prefix=options.strip_file_prefix, File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 736, in install requirement.uninstall(auto_confirm=True) File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall paths_to_remove.remove(auto_confirm) File "/usr/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove renames(path, new_path) File "/usr/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames shutil.move(old, new) File "/usr/lib64/python2.7/shutil.py", line 302, in move os.unlink(src)OSError: [Errno 13] Permission denied: '/usr/bin/easy_install'You are using pip version 8.1.2, however version 18.1 is available.You should consider upgrading via the 'pip install --upgrade pip' command.