ansible / ansible-jupyter-kernel Goto Github PK
View Code? Open in Web Editor NEWJupyter Notebook Kernel for running Ansible Tasks and Playbooks
License: Other
Jupyter Notebook Kernel for running Ansible Tasks and Playbooks
License: Other
Traceback:
File "/usr/lib/python2.7/site-packages/ansible_kernel/kernel.py", line 786, in do_shutdown
child.kill()
File "/usr/lib64/python2.7/site-packages/psutil/__init__.py", line 271, in wrapper
raise NoSuchProcess(self.pid, self._name)
Add #handler cell type for declaring a handler
Is your feature request related to a problem? Please describe.
Currently the play context does not end under normal operation.
Describe the solution you'd like
Ansible-playbook command provides a summary at the end of the run. Provide the same functionality in the Jupyter Notebook. It would be nice to have a well designed HTML summary for the tasks.
Describe alternatives you've considered
Not providing a summary. This is the current state of the tool.
Describe the bug
When running a jupyter notebook (with jupyter notebook
command), there available ansible exports in File -> Download As.
When running jupyterlab (with jupyter lab
command), the menu is called Exports, and doesn't contain ansible exports choices.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In jupyterlab there should be an option to export notebook as ansible playbooks.
Screenshots
Expected behaviour in jupyter notebook:
Missing menu item in jupyterlab:
Desktop (please complete the following information):
Just looking for how to do become: yes and provide a password.
I'm trying to do debug: var: ansible_lvm['vgs'] which needs root access.
I can use ansible localhost -m setup in jupyter notebook cell but I cannot use any module like
debug: msg="Test". It shows messages under the below.
fatal: [localhost]: FAILED! => Unable to retrieve file contents
Could not find or access '/private/var/folders/x6/d0kxr33j18vcg53bb29jqjh40000gn/T/ansible_kernel_playbookhz0dr5by/project/next_task0.yml' on the Ansible Controller.
If you are using a module and expect the file to exist on the remote, see the remote_src option
Playbook ended
Context lost!
Can anyone help?
Add files recommend for PYPI. Then push to PYPI
Add exporters for ansible playbooks and ansible task files.
Each cell type is written to separate files. It would be ideal to have all these files written out in a directory and then that entire directory zipped-up and downloaded on export.
$ uname -srm
Linux 4.9.0-6-amd64 x86_64
$ cat /etc/issue
Debian GNU/Linux 9 \n \l
$ pip install ansible-kernel
Requirement already satisfied: ansible-kernel in ./anaconda3/lib/python3.6/site-packages (0.4.2)
Requirement already satisfied: ansible in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (2.6.1)
Requirement already satisfied: jupyter in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (1.0.0)
Requirement already satisfied: psutil in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (5.4.5)
Requirement already satisfied: docopt in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (0.6.2)
Requirement already satisfied: tqdm in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (4.23.4)
Requirement already satisfied: PyYAML in ./anaconda3/lib/python3.6/site-packages (from ansible-kernel) (3.12)
Requirement already satisfied: setuptools in ./anaconda3/lib/python3.6/site-packages (from ansible->ansible-kernel) (39.1.0)
Requirement already satisfied: jinja2 in ./anaconda3/lib/python3.6/site-packages (from ansible->ansible-kernel) (2.10)
Requirement already satisfied: cryptography in ./anaconda3/lib/python3.6/site-packages (from ansible->ansible-kernel) (2.2.2)
Requirement already satisfied: paramiko in ./anaconda3/lib/python3.6/site-packages (from ansible->ansible-kernel) (2.4.1)
Requirement already satisfied: notebook in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (5.5.0)
Requirement already satisfied: qtconsole in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (4.3.1)
Requirement already satisfied: jupyter-console in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (5.2.0)
Requirement already satisfied: nbconvert in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (5.3.1)
Requirement already satisfied: ipykernel in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (4.8.2)
Requirement already satisfied: ipywidgets in ./anaconda3/lib/python3.6/site-packages (from jupyter->ansible-kernel) (7.2.1)
Requirement already satisfied: MarkupSafe>=0.23 in ./anaconda3/lib/python3.6/site-packages (from jinja2->ansible->ansible-kernel) (1.0)
Requirement already satisfied: idna>=2.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible->ansible-kernel) (2.6)
Requirement already satisfied: asn1crypto>=0.21.0 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible->ansible-kernel) (0.24.0)
Requirement already satisfied: six>=1.4.1 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible->ansible-kernel) (1.11.0)
Requirement already satisfied: cffi>=1.7 in ./anaconda3/lib/python3.6/site-packages (from cryptography->ansible->ansible-kernel) (1.11.5)
Requirement already satisfied: pynacl>=1.0.1 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible->ansible-kernel) (1.2.1)
Requirement already satisfied: pyasn1>=0.1.7 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible->ansible-kernel) (0.4.3)
Requirement already satisfied: bcrypt>=3.1.3 in ./anaconda3/lib/python3.6/site-packages (from paramiko->ansible->ansible-kernel) (3.1.4)
Requirement already satisfied: ipython-genutils in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (0.2.0)
Requirement already satisfied: pyzmq>=17 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (17.0.0)
Requirement already satisfied: traitlets>=4.2.1 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (4.3.2)
Requirement already satisfied: Send2Trash in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (1.5.0)
Requirement already satisfied: nbformat in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (4.4.0)
Requirement already satisfied: jupyter-client>=5.2.0 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (5.2.3)
Requirement already satisfied: tornado>=4 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (5.0.2)
Requirement already satisfied: jupyter-core>=4.4.0 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (4.4.0)
Requirement already satisfied: terminado>=0.8.1 in ./anaconda3/lib/python3.6/site-packages (from notebook->jupyter->ansible-kernel) (0.8.1)
Requirement already satisfied: ipython in ./anaconda3/lib/python3.6/site-packages (from jupyter-console->jupyter->ansible-kernel) (6.4.0)
Requirement already satisfied: prompt_toolkit<2.0.0,>=1.0.0 in ./anaconda3/lib/python3.6/site-packages (from jupyter-console->jupyter->ansible-kernel) (1.0.15)
Requirement already satisfied: pygments in ./anaconda3/lib/python3.6/site-packages (from jupyter-console->jupyter->ansible-kernel) (2.2.0)
Requirement already satisfied: mistune>=0.7.4 in ./anaconda3/lib/python3.6/site-packages (from nbconvert->jupyter->ansible-kernel) (0.8.3)
Requirement already satisfied: entrypoints>=0.2.2 in ./anaconda3/lib/python3.6/site-packages (from nbconvert->jupyter->ansible-kernel) (0.2.3)
Requirement already satisfied: bleach in ./anaconda3/lib/python3.6/site-packages (from nbconvert->jupyter->ansible-kernel) (2.1.3)
Requirement already satisfied: pandocfilters>=1.4.1 in ./anaconda3/lib/python3.6/site-packages (from nbconvert->jupyter->ansible-kernel) (1.4.2)
Requirement already satisfied: testpath in ./anaconda3/lib/python3.6/site-packages (from nbconvert->jupyter->ansible-kernel) (0.3.1)
Requirement already satisfied: widgetsnbextension~=3.2.0 in ./anaconda3/lib/python3.6/site-packages (from ipywidgets->jupyter->ansible-kernel) (3.2.1)
Requirement already satisfied: pycparser in ./anaconda3/lib/python3.6/site-packages (from cffi>=1.7->cryptography->ansible->ansible-kernel) (2.18)
Requirement already satisfied: decorator in ./anaconda3/lib/python3.6/site-packages (from traitlets>=4.2.1->notebook->jupyter->ansible-kernel) (4.3.0)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in ./anaconda3/lib/python3.6/site-packages (from nbformat->notebook->jupyter->ansible-kernel) (2.6.0)
Requirement already satisfied: python-dateutil>=2.1 in ./anaconda3/lib/python3.6/site-packages (from jupyter-client>=5.2.0->notebook->jupyter->ansible-kernel) (2.7.3)
Requirement already satisfied: pexpect; sys_platform != "win32" in ./anaconda3/lib/python3.6/site-packages (from ipython->jupyter-console->jupyter->ansible-kernel) (4.5.0)
Requirement already satisfied: jedi>=0.10 in ./anaconda3/lib/python3.6/site-packages (from ipython->jupyter-console->jupyter->ansible-kernel) (0.12.0)
Requirement already satisfied: backcall in ./anaconda3/lib/python3.6/site-packages (from ipython->jupyter-console->jupyter->ansible-kernel) (0.1.0)
Requirement already satisfied: simplegeneric>0.8 in ./anaconda3/lib/python3.6/site-packages (from ipython->jupyter-console->jupyter->ansible-kernel) (0.8.1)
Requirement already satisfied: pickleshare in ./anaconda3/lib/python3.6/site-packages (from ipython->jupyter-console->jupyter->ansible-kernel) (0.7.4)
Requirement already satisfied: wcwidth in ./anaconda3/lib/python3.6/site-packages (from prompt_toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter->ansible-kernel) (0.1.7)
Requirement already satisfied: html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre in ./anaconda3/lib/python3.6/site-packages (from bleach->nbconvert->jupyter->ansible-kernel) (1.0.1)
Requirement already satisfied: ptyprocess>=0.5 in ./anaconda3/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->ipython->jupyter-console->jupyter->ansible-kernel) (0.5.2)
Requirement already satisfied: parso>=0.2.0 in ./anaconda3/lib/python3.6/site-packages (from jedi>=0.10->ipython->jupyter-console->jupyter->ansible-kernel) (0.2.0)
Requirement already satisfied: webencodings in ./anaconda3/lib/python3.6/site-packages (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->jupyter->ansible-kernel) (0.5.1)
and when I run
$ jupiter notebook
It opens a tab in my browser. In the top right under "New" I only see "Python3" under Notebook and and under other I see "textfile, folder, terminal" as the three options.
Add a command line tool to convert Ansible playbooks into notebooks.
Syntax errors in task cells and other cells should have useful feedback. Use the pager function to pop the feedback so that users can learn by trial-and-error.
Currently ignore_errors is used to allow the playbook context to continue after a task fails. The block/rescue/always syntax can allow the kernel to continue running the playbook context for unreachable hosts too. Also investigate resetting unreachable hosts with meta: clear_host_errors.
- name: Attempt and graceful roll back demo
block:
- debug:
msg: 'I execute normally'
- command: /bin/false
- debug:
msg: 'I never execute, due to the above task failing'
rescue:
- debug:
msg: 'I caught an error'
- command: /bin/false
- debug:
msg: 'I also never execute :-('
always:
- debug:
msg: "This always executes"
- meta: clear_host_errors
For module and role development it is useful to have a python cell type to quickly prototype python which can be exported into the module or role.
Investigate HTML formatting the result data instead of showing the raw JSON.
This might be as simple as using include_role or perhaps adding a #role cell type. This should also include tab completion for role names perhaps using galaxy to get the role names availalble
Cache the available module names and module arguments from ansible-doc for use in tab-completion and docs pager.
Describe the bug
In the case of running ansible_kernel on a python3.6 install of jupyterhub/lab; when using the #vault_password keyword the following error is raised.
TypeError Traceback (most recent call last)
<ipython-input-1-2c7e8874a5d5> in <module>
1 import ansible_kernel.widgets
2 style = {'description_width': 'initial'}
----> 3 ansible_kernel.widgets.VaultPassword(description='Vault Password:', style=style)
TypeError: a bytes-like object is required, not 'str'
To Reproduce
Dockerfile below:
FROM centos:latest
RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash - && \
yum -y install https://centos7.iuscommunity.org/ius-release.rpm && \
yum -y install epel-release && \
yum -y install python36u python36u-libs python36u-devel python36u-pip nodejs gcc && \
pip3.6 --cert /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem install --upgrade pip
RUN pip3.6 install jupyterhub jupyterlab notebook && \
pip3.6 install ansible ansible-kernel ipython && \
pip3.6 install ipywidgets && \
npm install -g configurable-http-proxy
RUN jupyter labextension install @jupyterlab/hub-extension && \
jupyter labextension install @jupyter-widgets/jupyterlab-manager &&\
jupyter nbextension enable --py widgetsnbextension --sys-prefix && \
python3.6 -m ansible_kernel.install
RUN useradd -ms /bin/bash -p "$(openssl passwd -1 test)" test
RUN echo $'import os \n\
c = get_config() \n\
c.Spawner.cmd = [\'jupyter-labhub\'] \n' > jupyterhub_config.py
CMD jupyterhub -f jupyterhub_config.py
Spin up container with:
docker build --rm -f "bug_reproduce\Dockerfile" -t bug_reproduce:latest bug_reproduce
docker run -p 8000:8000 -d -it --name jupyter_bug bug_reproduce
Expected behavior
Interactive widget should appear as per second screenshot
Screenshots
This is the error which is seen within the ansible_kernel.
This is what should be seen (this example is run directly from python kernel).
Desktop (please complete the following information):
Additional Information
Not sure if it is relevant but running the python snippet shown above in the second screenshot throws the same error when run with #python keyword on ansible_kernel.
Describe the bug
ansible kernel hangs under MacOSX and python 3.7.
To Reproduce
Create a fresh conda environent, and ansible kernel does not work.
$ conda create -n ansible python=3.7
$ pip install ansible-kernel
$ python -m ansible_kernel.install
$ jupyter notebook
[W 11:50:09.718 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 11:50:09.720 NotebookApp] The port 8888 is already in use, trying another port.
[I 11:50:09.720 NotebookApp] The port 8889 is already in use, trying another port.
[I 11:50:09.728 NotebookApp] Serving notebooks from local directory: /Users/bpeng1
[I 11:50:09.728 NotebookApp] The Jupyter Notebook is running at:
[I 11:50:09.728 NotebookApp] http://bcbm-bpeng.mdanderson.edu:8890/
[I 11:50:09.728 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 11:50:14.887 NotebookApp] Creating new notebook in
[I 11:50:15.881 NotebookApp] Kernel started: cae4aef6-83f6-4f08-89ec-1d9e3262f363
/Users/bpeng1/anaconda3/envs/ansible/lib/python3.7/site-packages/ansible_kernel/modules.py:4: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
modules = yaml.load(f.read())
/Users/bpeng1/anaconda3/envs/ansible/lib/python3.7/site-packages/ansible_kernel/module_args.py:4: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
module_args = yaml.load(f.read())
[W 11:51:15.951 NotebookApp] Timeout waiting for kernel_info reply from cae4aef6-83f6-4f08-89ec-1d9e3262f363
[I 11:52:16.453 NotebookApp] Saving file at /Untitled.ipynb
^C[I 11:52:52.442 NotebookApp] interrupted
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
A number of PRs have been merged that would help problems seen with the most recent PyPI version (0.9.0).
Describe the solution you'd like
Describe alternatives you've considered
Additional context
On conda-forge we're having issues re-building the old version due to various upstream drift. We might be able to get it building with very old versions, but as the fixes are in place, it would be lovely to just package a new version that works with up-to-date (and patched) dependencies.
Describe the bug
Ansible-runner backend sends more messages than we expect for roles in plays. This causes the next task to display the extra messages.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Don't display multiple extra output messages.
Replace direct call to ansible with call to ansible-runner instead.
Describe the bug
An output variable from python is unavailable in a debug action under a ansible task.
To Reproduce
#python
x = 5
x
5
#task
debug:
var: x
TASK [debug] *******************************************************************
ok: [localhost] => {
"x": "VARIABLE IS NOT DEFINED!"
}
Expected behavior
Variable should be defined.
I am getting lots of extraneous output when running any playbook through the ansible jupyter kernel. See screenshot for an example. I don't get that output when running the same playbook through ansible CLI in a bash jupyter kernel. I'm using jupyter-lab 3.0.7 and ansible 2.10.5 on a Mac. Any help to remove that output welcome. Thanks !
Describe the bug
When Ansible Kernel 0.8.0 is running in Docker container, the following error occurred.(Ansible Kernel is running on Python3.6)
The same error does not occur in python2.
To Reproduce
# docker run -p 8888:8888 -d -it --name jupyter centos:centos7
# docker exec -it jupyter bash
# yum -y install epel-release
# yum -y install python36 python36-devel gcc
# curl https://bootstrap.pypa.io/get-pip.py | python36
# pip3 install jupyter jupyterlab
# pip3 install ansible ansible-kernel ipython
# python36 -m ansible_kernel.install
# jupyter lab --ip=0.0.0.0 --allow-root
Screenshots
Desktop (please complete the following information):
Additional context
I fixed the bug as follows.
--- before/kernel.py 2018-09-29 14:31:59.057127090 +0000
+++ after/kernel.py 2018-09-29 14:32:22.212129487 +0000
@@ -432,7 +432,7 @@
if message_data.get('full_results', None) and self.registered_variable is not None:
logger.debug('full_results %s', type(message_data.get('full_results')))
- self.shell.run_cell("{0} = json.loads('{1}')".format(self.registered_variable,
+ self.shell.run_cell("import json; {0} = json.loads('{1}')".format(self.registered_variable,
message_data.get('full_results')))
if message_data.get('results', None):
thanks.
Describe the bug
When loading a simple playbook in the Ansible kernel (from example docs), full copies of the user's home directory are created in /tmp/ and eventually the system runs out of disk space.
To Reproduce
#inventory
[all]
ahost ansible_connection=local
anotherhost examplevar=val
---
#play
name: Hello World
hosts: all
gather_facts: false
---
#task
debug:
Expected behavior
Clean return of cell output
Desktop (please complete the following information):
Additional context
This appears to be (possibly expected) behaviour of copy_files() in ansible-jupyter-kernel/ansible_kernel/kernel.py:242
, but I'm not sure why it needs all of my home directory and not restricted to a subset / subdirectory.
@jctanner requested a cell type to define libraries of modules.
I am trying to integrate some ipython magics with ansible on SOS kernel. I am able to set ansible_runner directory and use defined var and hosts files. But using ansible_kernel, I am not able to achieve the same. I tried going through the code, where inside ansible/config/base.yml ### DEFAULT_HOST_LIST: has /etc/ansible/hosts as default. But adding any inventory there doesnt seem to work.
Is there any existing method to control inventory? Having a method to control inventory and play storage files can help share common resources across notebooks without having to rewrite common code.
Thankyou for any help in advance.
Describe the bug
When Ansible Kernel 0.8.0 is running in Python 3, the following error occurred.
The same error does not occur in python2.
Traceback (most recent call last):
File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/jupyter/venv/lib64/python3.6/site-packages/ansible_kernel/__main__.py", line 6, in <module>
IPKernelApp.launch_instance(kernel_class=AnsibleKernel)
File "/home/jupyter/venv/lib64/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/jupyter/venv/lib64/python3.6/site-packages/ipykernel/kernelapp.py", line 483, in start
self.kernel.start()
File "/home/jupyter/venv/lib64/python3.6/site-packages/ipykernel/kernelbase.py", line 290, in start
self._publish_status('starting')
File "/home/jupyter/venv/lib64/python3.6/site-packages/ipykernel/kernelbase.py", line 327, in _publish_status
ident=self._topic('status'),
File "/home/jupyter/venv/lib64/python3.6/site-packages/jupyter_client/session.py", line 748, in send
stream.send_multipart(to_send, copy=copy)
File "/home/jupyter/venv/lib64/python3.6/site-packages/ansible_kernel/kernel.py", line 68, in send_multipart
result = channel.send_multipart(msg, *args, **kwargs)
File "/home/jupyter/venv/lib64/python3.6/site-packages/ansible_kernel/kernel.py", line 1173, in send_multipart
if msg0.startswith("comm"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
To Reproduce
$ python36 -m venv venv
$ source venv/bin/activate
$ pip3 install ansible
$ pip3 install jupyter
$ pip3 install ansible-kernel
$ python -m ansible_kernel.install
$ jupyter notebook
Screenshots
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
I fixed the bug as follows.
--- before/kernel.py 2018-08-29 02:06:43.781003421 +0900
+++ after/kernel.py 2018-08-29 02:06:37.782995367 +0900
@@ -1170,7 +1170,7 @@
msg3_data = json.loads(msg3)
msg6_data = json.loads(msg6)
- if msg0.startswith("comm"):
+ if msg0.startswith(b"comm"):
_, _, comm_id = msg0.partition('-')
if msg3_data['msg_type'] == 'comm_open' and msg6_data['comm_id'] == comm_id:
self.update_widget(comm_id, msg6_data.get('data', {}).get('state', {}))
thanks.
The default inventory is:
[all]
localhost ansible_connection=local
Add this inventory to the ansible bundle zip file if no other inventory is defined.
I can't understand why do that copy , copy other extraneous files ?
And copy file recursive and following the link,
Start jupyter in ~/nbs directory , has a link ~/nbs/mytmp --> to another big directory , and run ansible playbook, that copy's will consumed entire disk space.
At least should check with os.path.islink()
Describe the bug
The last release included an update of the Dockerfile to use the 1.0.0 package. An updated image build lacks to be seen in:
To Reproduce
Expected behavior
The release streams are in sync.
Additional context
The Dockerfile also uses unsupported core components beyond their EOL, such as Python 2 or Fedora 29. Both should be upgraded to their latest stable release, when wanting to use the container with sensitive infrastructure operations.
Describe the bug
Tasks runs for all hosts of the group specified in directive hosts, but any python cells afterward only get the result of the execution on the last host to finish its execution for the task.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Provide a way for python code to be executed each time a task is executed for a host or ensure that variables in register directives are lists that will accumulate the results of each task execution.
Desktop (please complete the following information):
Server (please complete the following information):
Additional context
Add any other context about the problem here.
When hosts are unreachable or tasks fail ansible-playbook will shutdown. The kernel should respond to the appropriately. Either keep ansible-playbook from shutting down, restart ansible-playbook, shutdown the kernel, or all of these outcomes. Pick the outcome that is most appropriate.
Hi,
I have installed ansible using pip and my python3 version is 3.6.9
python3 -m pip install ansible-kernel
python3 -m ansible_kernel.install
and when i run ping: on ansible note book i am getting below error.
and ansible config file location is none. how can i configure hosts which is installed by pip. Please help me to resolve this issue.
detailed log is for ping:
{'counter': 7,
'created': '2021-03-30T15:48:51.176928',
'end_line': 7,
'event': 'runner_on_start',
'event_data': {'host': 'localhost',
'play': 'default',
'play_pattern': 'localhost',
'play_uuid': '080027fe-27d6-ee86-6ea5-000000000006',
'playbook': 'playbook.yml',
'playbook_uuid': 'ced3e0ef-f2b6-4d7c-9d49-ec2ccfc9005e',
'task': 'include_vars',
'task_action': 'include_vars',
'task_args': '',
'task_path': '/tmp/ansible_kernel_playbookph9rtyk5/project/playbook.yml:11',
'task_uuid': '080027fe-27d6-ee86-6ea5-00000000000c',
'uuid': '5f514c6d-9647-42e2-bc29-feb97bbd4eb6'},
'parent_uuid': '080027fe-27d6-ee86-6ea5-00000000000c',
'pid': 5086,
'runner_ident': 'a2ca81eb-9103-4ec9-ba9c-cb741619efd8',
'start_line': 7,
'stdout': '',
'uuid': '5f514c6d-9647-42e2-bc29-feb97bbd4eb6'}
{'counter': 10,
'created': '2021-03-30T15:48:51.223221',
'end_line': 10,
'event': 'runner_on_start',
'event_data': {'host': 'localhost',
'play': 'default',
'play_pattern': 'localhost',
'play_uuid': '080027fe-27d6-ee86-6ea5-000000000006',
'playbook': 'playbook.yml',
'playbook_uuid': 'ced3e0ef-f2b6-4d7c-9d49-ec2ccfc9005e',
'task': 'include_tasks',
'task_action': 'include_tasks',
'task_args': '',
'task_path': '/tmp/ansible_kernel_playbookph9rtyk5/project/playbook.yml:13',
'task_uuid': '080027fe-27d6-ee86-6ea5-00000000000d',
'uuid': '1867cc97-a22f-440d-89e3-f9adc0f25d12'},
'parent_uuid': '080027fe-27d6-ee86-6ea5-00000000000d',
'pid': 5086,
'runner_ident': 'a2ca81eb-9103-4ec9-ba9c-cb741619efd8',
'start_line': 10,
'stdout': '',
'uuid': '1867cc97-a22f-440d-89e3-f9adc0f25d12'}
TASK [ping] ********************************************************************
{'counter': 14,
'created': '2021-03-30T15:48:51.272790',
'end_line': 13,
'event': 'runner_on_start',
'event_data': {'host': 'localhost',
'play': 'default',
'play_pattern': 'localhost',
'play_uuid': '080027fe-27d6-ee86-6ea5-000000000006',
'playbook': 'playbook.yml',
'playbook_uuid': 'ced3e0ef-f2b6-4d7c-9d49-ec2ccfc9005e',
'task': 'ping',
'task_action': 'ping',
'task_args': '',
'task_path': '/tmp/ansible_kernel_playbookph9rtyk5/project/next_task0.yml:1',
'task_uuid': '080027fe-27d6-ee86-6ea5-000000000022',
'uuid': '87039cca-7a86-413b-8a2e-8beab01a3586'},
'parent_uuid': '080027fe-27d6-ee86-6ea5-000000000022',
'pid': 5086,
'runner_ident': 'a2ca81eb-9103-4ec9-ba9c-cb741619efd8',
'start_line': 13,
'stdout': '',
'uuid': '87039cca-7a86-413b-8a2e-8beab01a3586'}
/usr/local/py36/3_6_9/lib/python3.6/site-packages/ansible_kernel/kernel.py:757: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
code_data = yaml.load(code)
/usr/local/py36/3_6_9/lib/python3.6/site-packages/ansible_kernel/kernel.py:814: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
current_task_data = yaml.load(self.current_task)
ok: [localhost] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"ping": "pong"
}
{'counter': 17,
'created': '2021-03-30T15:48:51.841732',
'end_line': 16,
'event': 'runner_on_start',
'event_data': {'host': 'localhost',
'play': 'default',
'play_pattern': 'localhost',
'play_uuid': '080027fe-27d6-ee86-6ea5-000000000006',
'playbook': 'playbook.yml',
'playbook_uuid': 'ced3e0ef-f2b6-4d7c-9d49-ec2ccfc9005e',
'task': 'pause_for_kernel',
'task_action': 'pause_for_kernel',
'task_args': '',
'task_path': '/tmp/ansible_kernel_playbookph9rtyk5/project/next_task0.yml:3',
'task_uuid': '080027fe-27d6-ee86-6ea5-000000000023',
'uuid': 'b4ac8adb-4b45-4ca2-a4c6-103ffd1a9301'},
'parent_uuid': '080027fe-27d6-ee86-6ea5-000000000023',
'pid': 5086,
'runner_ident': 'a2ca81eb-9103-4ec9-ba9c-cb741619efd8',
'start_line': 16,
'stdout': '',
'uuid': 'b4ac8adb-4b45-4ca2-a4c6-103ffd1a9301'}
Regards,
Zain
The tests in /tests
should be run and verified from an automated process. This could be done by running them through jupyter console, using nightwatch to run them in the browser, or both.
The default play is:
name: default
hosts: localhost
gather_facts: false
Add this to the exported playbook file if no play is defined before the tasks.
Describe the bug
I can't run the simplest ansible task "debug:" in my notebook. I see the following error in my terminal: AttributeError: 'AnsibleKernel' object has no attribute 'user_ns'. Error already occurs when i select the ansible kernel for my notebook.
Am I missing something. Tried to follow the installation guide with the Demo example.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Output like in the Demo Video
Desktop:
$ jupyter --version
jupyter core : 4.6.3
jupyter-notebook : 6.1.5
qtconsole : 4.7.7
ipython : 7.19.0
ipykernel : 5.3.4
jupyter client : 6.1.7
jupyter lab : 2.2.9
nbconvert : 6.0.7
ipywidgets : 7.5.1
nbformat : 5.0.8
traitlets : 5.0.5
Additional context
Complete Error Message:
[I 08:43:51.384 LabApp] Kernel started: ecaa3e34-69ff-4142-a632-6606305e905e, name: ansible
/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ansible_kernel/modules.py:4: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
modules = yaml.load(f.read())
/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ansible_kernel/module_args.py:4: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
module_args = yaml.load(f.read())
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ansible_kernel/__main__.py", line 6, in <module>
IPKernelApp.launch_instance(kernel_class=AnsibleKernel)
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/traitlets/config/application.py", line 844, in launch_instance
app.initialize(argv)
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
return method(app, *args, **kwargs)
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 582, in initialize
self.init_kernel()
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 444, in init_kernel
kernel = kernel_factory(parent=self, session=self.session,
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/traitlets/config/configurable.py", line 537, in instance
inst = cls(*args, **kwargs)
File "/home/lus/Code/Jupyter/.venv/lib/python3.8/site-packages/ansible_kernel/kernel.py", line 188, in __init__
user_ns=self.user_ns,
AttributeError: 'AnsibleKernel' object has no attribute 'user_ns'
Describe the bug
If the play is left idle for a few minutes it loses the context. This is due to a timeout in ansible-runner backend.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Don't lose the play context.
$ pip3 install ansible-kernel
Defaulting to user installation because normal site-packages is not writeable
Collecting ansible-kernel
Using cached ansible-kernel-1.0.0.tar.gz (98 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: ansible in /home/user/.local/lib/python3.12/site-packages (from ansible-kernel) (9.1.0)
Collecting ansible-runner>=1.1.0 (from ansible-kernel)
Using cached ansible_runner-2.3.4-py3-none-any.whl.metadata (3.5 kB)
Requirement already satisfied: PyYAML in /home/user/.local/lib/python3.12/site-packages (from ansible-kernel) (6.0.1)
Requirement already satisfied: psutil in /usr/lib64/python3.12/site-packages (from ansible-kernel) (5.9.5)
Collecting jupyter (from ansible-kernel)
Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting tqdm (from ansible-kernel)
Using cached tqdm-4.66.2-py3-none-any.whl.metadata (57 kB)
Collecting docopt (from ansible-kernel)
Using cached docopt-0.6.2-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python3.12/site-packages (from ansible-kernel) (1.16.0)
Collecting ipywidgets (from ansible-kernel)
Using cached ipywidgets-8.1.2-py3-none-any.whl.metadata (2.4 kB)
Requirement already satisfied: pexpect>=4.5 in /usr/lib/python3.12/site-packages (from ansible-runner>=1.1.0->ansible-kernel) (4.8.0)
Requirement already satisfied: packaging in /usr/lib/python3.12/site-packages (from ansible-runner>=1.1.0->ansible-kernel) (23.1)
Collecting python-daemon (from ansible-runner>=1.1.0->ansible-kernel)
Using cached python_daemon-3.0.1-py3-none-any.whl (31 kB)
Requirement already satisfied: ansible-core~=2.16.1 in /home/user/.local/lib/python3.12/site-packages (from ansible->ansible-kernel) (2.16.2)
Requirement already satisfied: comm>=0.1.3 in /home/user/.local/lib/python3.12/site-packages (from ipywidgets->ansible-kernel) (0.2.0)
Requirement already satisfied: ipython>=6.1.0 in /usr/lib/python3.12/site-packages (from ipywidgets->ansible-kernel) (8.14.0)
Requirement already satisfied: traitlets>=4.3.1 in /usr/lib/python3.12/site-packages (from ipywidgets->ansible-kernel) (5.9.0)
Collecting widgetsnbextension~=4.0.10 (from ipywidgets->ansible-kernel)
Using cached widgetsnbextension-4.0.10-py3-none-any.whl.metadata (1.6 kB)
Collecting jupyterlab-widgets~=3.0.10 (from ipywidgets->ansible-kernel)
Using cached jupyterlab_widgets-3.0.10-py3-none-any.whl.metadata (4.1 kB)
Collecting notebook (from jupyter->ansible-kernel)
Using cached notebook-7.0.8-py3-none-any.whl.metadata (10 kB)
Collecting qtconsole (from jupyter->ansible-kernel)
Using cached qtconsole-5.5.1-py3-none-any.whl.metadata (5.1 kB)
Collecting jupyter-console (from jupyter->ansible-kernel)
Using cached jupyter_console-6.6.3-py3-none-any.whl (24 kB)
Requirement already satisfied: nbconvert in /home/user/.local/lib/python3.12/site-packages (from jupyter->ansible-kernel) (7.11.0)
Requirement already satisfied: ipykernel in /home/user/.local/lib/python3.12/site-packages (from jupyter->ansible-kernel) (6.26.0)
Requirement already satisfied: jinja2>=3.0.0 in /home/user/.local/lib/python3.12/site-packages (from ansible-core~=2.16.1->ansible->ansible-kernel) (3.1.2)
Requirement already satisfied: cryptography in /home/user/.local/lib/python3.12/site-packages (from ansible-core~=2.16.1->ansible->ansible-kernel) (41.0.5)
Requirement already satisfied: resolvelib<1.1.0,>=0.5.3 in /home/user/.local/lib/python3.12/site-packages (from ansible-core~=2.16.1->ansible->ansible-kernel) (1.0.1)
Requirement already satisfied: backcall in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (0.1.0)
Requirement already satisfied: decorator in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (5.1.1)
Requirement already satisfied: jedi>=0.16 in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (0.19.0)
Requirement already satisfied: matplotlib-inline in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (0.1.6)
Requirement already satisfied: pickleshare in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (0.7.5)
Requirement already satisfied: prompt_toolkit!=3.0.37,<3.1.0,>=3.0.30 in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (3.0.38)
Requirement already satisfied: pygments>=2.4.0 in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (2.15.1)
Requirement already satisfied: stack_data in /usr/lib/python3.12/site-packages (from ipython>=6.1.0->ipywidgets->ansible-kernel) (0.6.2)
Requirement already satisfied: ptyprocess>=0.5 in /usr/lib/python3.12/site-packages (from pexpect>=4.5->ansible-runner>=1.1.0->ansible-kernel) (0.7.0)
Requirement already satisfied: debugpy>=1.6.5 in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (1.8.0)
Requirement already satisfied: jupyter-client>=6.1.12 in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (8.6.0)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (5.5.0)
Requirement already satisfied: nest-asyncio in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (1.5.8)
Requirement already satisfied: pyzmq>=20 in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (25.1.1)
Requirement already satisfied: tornado>=6.1 in /home/user/.local/lib/python3.12/site-packages (from ipykernel->jupyter->ansible-kernel) (6.3.3)
Requirement already satisfied: beautifulsoup4 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (4.12.2)
Requirement already satisfied: bleach!=5.0.0 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (6.1.0)
Requirement already satisfied: defusedxml in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (0.7.1)
Requirement already satisfied: jupyterlab-pygments in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (0.2.2)
Requirement already satisfied: markupsafe>=2.0 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (2.1.3)
Requirement already satisfied: mistune<4,>=2.0.3 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (3.0.2)
Requirement already satisfied: nbclient>=0.5.0 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (0.9.0)
Requirement already satisfied: nbformat>=5.7 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (5.9.2)
Requirement already satisfied: pandocfilters>=1.4.1 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (1.5.0)
Requirement already satisfied: tinycss2 in /home/user/.local/lib/python3.12/site-packages (from nbconvert->jupyter->ansible-kernel) (1.2.1)
Requirement already satisfied: jupyter-server<3,>=2.4.0 in /home/user/.local/lib/python3.12/site-packages (from notebook->jupyter->ansible-kernel) (2.10.1)
Requirement already satisfied: jupyterlab-server<3,>=2.22.1 in /home/user/.local/lib/python3.12/site-packages (from notebook->jupyter->ansible-kernel) (2.25.1)
Requirement already satisfied: jupyterlab<4.1,>=4.0.2 in /home/user/.local/lib/python3.12/site-packages (from notebook->jupyter->ansible-kernel) (4.0.10)
Requirement already satisfied: notebook-shim<0.3,>=0.2 in /home/user/.local/lib/python3.12/site-packages (from notebook->jupyter->ansible-kernel) (0.2.3)
Collecting docutils (from python-daemon->ansible-runner>=1.1.0->ansible-kernel)
Using cached docutils-0.20.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: lockfile>=0.10 in /usr/lib/python3.12/site-packages (from python-daemon->ansible-runner>=1.1.0->ansible-kernel) (0.12.2)
Requirement already satisfied: setuptools>=62.4.0 in /usr/lib/python3.12/site-packages (from python-daemon->ansible-runner>=1.1.0->ansible-kernel) (67.7.2)
Collecting qtpy>=2.4.0 (from qtconsole->jupyter->ansible-kernel)
Using cached QtPy-2.4.1-py3-none-any.whl.metadata (12 kB)
Requirement already satisfied: webencodings in /home/user/.local/lib/python3.12/site-packages (from bleach!=5.0.0->nbconvert->jupyter->ansible-kernel) (0.5.1)
Requirement already satisfied: parso<0.9.0,>=0.8.3 in /usr/lib/python3.12/site-packages (from jedi>=0.16->ipython>=6.1.0->ipywidgets->ansible-kernel) (0.8.3)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/lib/python3.12/site-packages (from jupyter-client>=6.1.12->ipykernel->jupyter->ansible-kernel) (2.8.2)
Requirement already satisfied: platformdirs>=2.5 in /usr/lib/python3.12/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel->jupyter->ansible-kernel) (3.9.1)
Requirement already satisfied: anyio>=3.1.0 in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (4.0.0)
Requirement already satisfied: argon2-cffi in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (23.1.0)
Requirement already satisfied: jupyter-events>=0.9.0 in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.9.0)
Requirement already satisfied: jupyter-server-terminals in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.4.4)
Requirement already satisfied: overrides in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (7.4.0)
Requirement already satisfied: prometheus-client in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.18.0)
Requirement already satisfied: send2trash>=1.8.2 in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.8.2)
Requirement already satisfied: terminado>=0.8.3 in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.18.0)
Requirement already satisfied: websocket-client in /home/user/.local/lib/python3.12/site-packages (from jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.6.4)
Requirement already satisfied: async-lru>=1.0.0 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab<4.1,>=4.0.2->notebook->jupyter->ansible-kernel) (2.0.4)
Requirement already satisfied: jupyter-lsp>=2.0.0 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab<4.1,>=4.0.2->notebook->jupyter->ansible-kernel) (2.2.0)
Requirement already satisfied: babel>=2.10 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (2.13.1)
Requirement already satisfied: json5>=0.9.0 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (0.9.14)
Requirement already satisfied: jsonschema>=4.18.0 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (4.20.0)
Requirement already satisfied: requests>=2.31 in /home/user/.local/lib/python3.12/site-packages (from jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (2.31.0)
Requirement already satisfied: fastjsonschema in /home/user/.local/lib/python3.12/site-packages (from nbformat>=5.7->nbconvert->jupyter->ansible-kernel) (2.19.0)
Requirement already satisfied: wcwidth in /usr/lib/python3.12/site-packages (from prompt_toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython>=6.1.0->ipywidgets->ansible-kernel) (0.2.5)
Requirement already satisfied: soupsieve>1.2 in /home/user/.local/lib/python3.12/site-packages (from beautifulsoup4->nbconvert->jupyter->ansible-kernel) (2.5)
Requirement already satisfied: cffi>=1.12 in /home/user/.local/lib/python3.12/site-packages (from cryptography->ansible-core~=2.16.1->ansible->ansible-kernel) (1.16.0)
Requirement already satisfied: executing>=1.2.0 in /usr/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets->ansible-kernel) (1.2.0)
Requirement already satisfied: asttokens>=2.1.0 in /usr/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets->ansible-kernel) (2.4.1)
Requirement already satisfied: pure-eval in /usr/lib/python3.12/site-packages (from stack_data->ipython>=6.1.0->ipywidgets->ansible-kernel) (0.2.2)
Requirement already satisfied: idna>=2.8 in /usr/lib/python3.12/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (3.4)
Requirement already satisfied: sniffio>=1.1 in /home/user/.local/lib/python3.12/site-packages (from anyio>=3.1.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.3.0)
Requirement already satisfied: pycparser in /home/user/.local/lib/python3.12/site-packages (from cffi>=1.12->cryptography->ansible-core~=2.16.1->ansible->ansible-kernel) (2.21)
Requirement already satisfied: attrs>=22.2.0 in /home/user/.local/lib/python3.12/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (23.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/user/.local/lib/python3.12/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (2023.11.1)
Requirement already satisfied: referencing>=0.28.4 in /home/user/.local/lib/python3.12/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (0.31.0)
Requirement already satisfied: rpds-py>=0.7.1 in /home/user/.local/lib/python3.12/site-packages (from jsonschema>=4.18.0->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (0.13.0)
Requirement already satisfied: python-json-logger>=2.0.4 in /home/user/.local/lib/python3.12/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (2.0.7)
Requirement already satisfied: rfc3339-validator in /home/user/.local/lib/python3.12/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.1.4)
Requirement already satisfied: rfc3986-validator>=0.1.1 in /home/user/.local/lib/python3.12/site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (0.1.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.12/site-packages (from requests>=2.31->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (3.2.0)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3.12/site-packages (from requests>=2.31->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in /home/user/.local/lib/python3.12/site-packages (from requests>=2.31->jupyterlab-server<3,>=2.22.1->notebook->jupyter->ansible-kernel) (2023.7.22)
Requirement already satisfied: argon2-cffi-bindings in /home/user/.local/lib/python3.12/site-packages (from argon2-cffi->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (21.2.0)
Requirement already satisfied: fqdn in /home/user/.local/lib/python3.12/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.5.1)
Requirement already satisfied: isoduration in /home/user/.local/lib/python3.12/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (20.11.0)
Requirement already satisfied: jsonpointer>1.13 in /home/user/.local/lib/python3.12/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (2.4)
Requirement already satisfied: uri-template in /home/user/.local/lib/python3.12/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.3.0)
Requirement already satisfied: webcolors>=1.11 in /home/user/.local/lib/python3.12/site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.13)
Requirement already satisfied: arrow>=0.15.0 in /home/user/.local/lib/python3.12/site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (1.3.0)
Requirement already satisfied: types-python-dateutil>=2.8.10 in /home/user/.local/lib/python3.12/site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook->jupyter->ansible-kernel) (2.8.19.14)
Using cached ansible_runner-2.3.4-py3-none-any.whl (81 kB)
Using cached ipywidgets-8.1.2-py3-none-any.whl (139 kB)
Using cached tqdm-4.66.2-py3-none-any.whl (78 kB)
Using cached jupyterlab_widgets-3.0.10-py3-none-any.whl (215 kB)
Using cached widgetsnbextension-4.0.10-py3-none-any.whl (2.3 MB)
Using cached notebook-7.0.8-py3-none-any.whl (4.0 MB)
Using cached qtconsole-5.5.1-py3-none-any.whl (123 kB)
Using cached QtPy-2.4.1-py3-none-any.whl (93 kB)
Using cached docutils-0.20.1-py3-none-any.whl (572 kB)
Building wheels for collected packages: ansible-kernel
Building wheel for ansible-kernel (pyproject.toml): started
Building wheel for ansible-kernel (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for ansible-kernel (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [156 lines of output]
/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
By 2024-Sep-26, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/ansible_kernel
copying ansible_kernel/widgets.py -> build/lib/ansible_kernel
copying ansible_kernel/update_module_cache.py -> build/lib/ansible_kernel
copying ansible_kernel/task_args.py -> build/lib/ansible_kernel
copying ansible_kernel/play_args.py -> build/lib/ansible_kernel
copying ansible_kernel/modules.py -> build/lib/ansible_kernel
copying ansible_kernel/module_args.py -> build/lib/ansible_kernel
copying ansible_kernel/kernel.py -> build/lib/ansible_kernel
copying ansible_kernel/install.py -> build/lib/ansible_kernel
copying ansible_kernel/convert_playbook.py -> build/lib/ansible_kernel
copying ansible_kernel/__main__.py -> build/lib/ansible_kernel
copying ansible_kernel/__init__.py -> build/lib/ansible_kernel
creating build/lib/ansible_kernel/roles
copying ansible_kernel/roles/__init__.py -> build/lib/ansible_kernel/roles
creating build/lib/ansible_kernel/plugins
copying ansible_kernel/plugins/__init__.py -> build/lib/ansible_kernel/plugins
creating build/lib/ansible_kernel/exporters
copying ansible_kernel/exporters/ansible_zip.py -> build/lib/ansible_kernel/exporters
copying ansible_kernel/exporters/ansible_tasks.py -> build/lib/ansible_kernel/exporters
copying ansible_kernel/exporters/ansible_playbook.py -> build/lib/ansible_kernel/exporters
copying ansible_kernel/exporters/__init__.py -> build/lib/ansible_kernel/exporters
creating build/lib/ansible_kernel/roles/ansible_kernel_helpers
copying ansible_kernel/roles/ansible_kernel_helpers/__init__.py -> build/lib/ansible_kernel/roles/ansible_kernel_helpers
creating build/lib/ansible_kernel/roles/ansible_kernel_helpers/library
copying ansible_kernel/roles/ansible_kernel_helpers/library/pause_for_kernel.py -> build/lib/ansible_kernel/roles/ansible_kernel_helpers/library
copying ansible_kernel/roles/ansible_kernel_helpers/library/__init__.py -> build/lib/ansible_kernel/roles/ansible_kernel_helpers/library
creating build/lib/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
copying ansible_kernel/roles/ansible_kernel_helpers/action_plugins/pause_for_kernel.py -> build/lib/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
copying ansible_kernel/roles/ansible_kernel_helpers/action_plugins/__init__.py -> build/lib/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
creating build/lib/ansible_kernel/plugins/callback
copying ansible_kernel/plugins/callback/ansible_kernel_helper.py -> build/lib/ansible_kernel/plugins/callback
copying ansible_kernel/plugins/callback/__init__.py -> build/lib/ansible_kernel/plugins/callback
creating build/lib/ansible_kernel/templates
copying ansible_kernel/templates/ansible_playbook.tpl -> build/lib/ansible_kernel/templates
copying ansible_kernel/templates/ansible_tasks.tpl -> build/lib/ansible_kernel/templates
copying ansible_kernel/modules.yml -> build/lib/ansible_kernel
copying ansible_kernel/module_args.yml -> build/lib/ansible_kernel
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/module_args.yml -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/modules.yml -> build/bdist.linux-x86_64/wheel/ansible_kernel
creating build/bdist.linux-x86_64/wheel/ansible_kernel/templates
copying build/lib/ansible_kernel/templates/ansible_tasks.tpl -> build/bdist.linux-x86_64/wheel/ansible_kernel/templates
copying build/lib/ansible_kernel/templates/ansible_playbook.tpl -> build/bdist.linux-x86_64/wheel/ansible_kernel/templates
creating build/bdist.linux-x86_64/wheel/ansible_kernel/exporters
copying build/lib/ansible_kernel/exporters/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/exporters
copying build/lib/ansible_kernel/exporters/ansible_playbook.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/exporters
copying build/lib/ansible_kernel/exporters/ansible_tasks.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/exporters
copying build/lib/ansible_kernel/exporters/ansible_zip.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/exporters
creating build/bdist.linux-x86_64/wheel/ansible_kernel/plugins
creating build/bdist.linux-x86_64/wheel/ansible_kernel/plugins/callback
copying build/lib/ansible_kernel/plugins/callback/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/plugins/callback
copying build/lib/ansible_kernel/plugins/callback/ansible_kernel_helper.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/plugins/callback
copying build/lib/ansible_kernel/plugins/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/plugins
creating build/bdist.linux-x86_64/wheel/ansible_kernel/roles
creating build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers
creating build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
copying build/lib/ansible_kernel/roles/ansible_kernel_helpers/action_plugins/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
copying build/lib/ansible_kernel/roles/ansible_kernel_helpers/action_plugins/pause_for_kernel.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/action_plugins
creating build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/library
copying build/lib/ansible_kernel/roles/ansible_kernel_helpers/library/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/library
copying build/lib/ansible_kernel/roles/ansible_kernel_helpers/library/pause_for_kernel.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers/library
copying build/lib/ansible_kernel/roles/ansible_kernel_helpers/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles/ansible_kernel_helpers
copying build/lib/ansible_kernel/roles/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel/roles
copying build/lib/ansible_kernel/__init__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/__main__.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/convert_playbook.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/install.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/kernel.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/module_args.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/modules.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/play_args.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/task_args.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/update_module_cache.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
copying build/lib/ansible_kernel/widgets.py -> build/bdist.linux-x86_64/wheel/ansible_kernel
running install_egg_info
running egg_info
writing ansible_kernel.egg-info/PKG-INFO
writing dependency_links to ansible_kernel.egg-info/dependency_links.txt
writing entry points to ansible_kernel.egg-info/entry_points.txt
writing requirements to ansible_kernel.egg-info/requires.txt
writing top-level names to ansible_kernel.egg-info/top_level.txt
reading manifest file 'ansible_kernel.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.md'
writing manifest file 'ansible_kernel.egg-info/SOURCES.txt'
Copying ansible_kernel.egg-info to build/bdist.linux-x86_64/wheel/ansible_kernel-1.0.0-py3.12.egg-info
running install_scripts
Installing Ansible Kernel kernelspec
Traceback (most recent call last):
File "/home/user/.local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/user/.local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 404, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 30, in <module>
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-p908b0re/normal/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 403, in run
self.run_command("install")
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-p908b0re/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 14, in run
ModuleNotFoundError: No module named 'jupyter_client'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ansible-kernel
Failed to build ansible-kernel
ERROR: Could not build wheels for ansible-kernel, which is required to install pyproject.toml-based projects
There are many changes that need to be made for python3.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.