ansible / ansible-jupyter-kernel

Jupyter Notebook Kernel for running Ansible Tasks and Playbooks
Other
534 stars 62 forks source link

Excessive files in /tmp #94

Open elixx opened 2 years ago

elixx commented 2 years ago

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

  1. Install Jupyter Hub and JupyterLab
  2. Install ansible-jupyter (tried both from git and Pypl)
  3. Create a new notebook with Ansible kernel
  4. Create cells from the README and attempt to run them, for example
    #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.

elixx commented 2 years ago

The directories in /tmp do not get cleaned up, so successive kernel restarts and re-attempts will certainly lead to an out-of-space condition, eventually.