Using Ansible in Python Licensing Question

Hello,

I wanted to import ansible in my Python code; this is for work. But i was told the following:

“Any python code that you import from ansible automatically requires the code your writing to be licensed under the GPL
You are legally required to open source that code even if does not want you to”

Is this true?

As in with all legal questions, check with your company's legal
department. IANAL and this is not legal advice.

The GPL license (under which Ansible is distributed) requires
redistribution under the same license of any code that uses GPL code.

Ansible does ship some code under a BSD v2 license, the files in
lib/ansible/module_utils this is so you can still use the facilities
to easily produce modules but use any licensing they want to
distribute them.

Also, it is generally accepted that calling out to a program does not
subject your code to the GPL in the way that using a library does. So
most lawyers will tell you that you can use /usr/bin/ansible and
/usr/bin/ansible-playbook via python's subprocess.Popen() without
releasing your code as GPL.

As with any legal question, though, and as Brian mentioned, you'll
want to talk to your lawyer about this.

-Toshio

​Is that what Tower does?

- Serge​

Yes. Tower runs ansible and ansible-playbook as subprocesses with
appropriate command line options and environment variables.

Hello Toshio,

This is actually very helpful. If my team is okay with using /usr/bin/ansible* via python’s subprocess.Popen() then that would be great.

Usman