Ansible but with Python instead of YAML

62 views
Skip to first unread message

Thomas Güttler

unread,
Feb 1, 2019, 5:42:53 AM2/1/19
to Ansible Project
I am using a different config management tool up to now (not ansible).

I think about switching to ansible.

But I don't like YAML.

I like Python.

Is it doable to use Python syntax instead of YAML?

Is it feasible to do this?


Sudheer S

unread,
Feb 1, 2019, 6:33:48 AM2/1/19
to ansible...@googlegroups.com


On 01/02/19 4:12 PM, Thomas Güttler wrote:
I am using a different config management tool up to now (not ansible).

I think about switching to ansible.

But I don't like YAML.

Ansible embraces YAML.

I like Python.

Is it doable to use Python syntax instead of YAML?
Technically, yes. But you'll hardly reap the benefits of Ansible without YAML.


Is it feasible to do this?

I can't think of a situation where using Ansible without YAML would be feasible.

Having said that, what makes you dislike YAML so much so that you would think of using something like Ansible without YAML?

-

Sudheer



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/61ba0cc3-49de-4c2d-8b92-93a6583f2929%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Güttler

unread,
Feb 1, 2019, 8:07:25 AM2/1/19
to Ansible Project


Am Freitag, 1. Februar 2019 12:33:48 UTC+1 schrieb Sudheer S:


On 01/02/19 4:12 PM, Thomas Güttler wrote:
I am using a different config management tool up to now (not ansible).

I think about switching to ansible.

But I don't like YAML.

Ansible embraces YAML.
I like Python.

Is it doable to use Python syntax instead of YAML?
Technically, yes. But you'll hardly reap the benefits of Ansible without YAML.

Is it feasible to do this?

I can't think of a situation where using Ansible without YAML would be feasible.

Having said that, what makes you dislike YAML so much so that you would think of using something like Ansible without YAML?


I know how to create dicts, lists, strings, multiline-strings with python. The syntax is easy and simple.

I am lazy. I just don't know why I should learn a new language.


Jonathan Lozada De La Matta

unread,
Feb 1, 2019, 8:56:54 AM2/1/19
to ansible...@googlegroups.com
if you know that then its pretty easy to leanr YML. Specially when the ansible documents have a lot of examples.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Jonathan lozada de la matta

AUTOMATION PRACTICE



 

Josh Smift

unread,
Feb 1, 2019, 9:20:14 AM2/1/19
to Ansible Project
YAML is great; I was confused at first because I thought it was a "markup language" like HTML, but it's just a way to represent data structures.

It's not a programming language, though. If you want to write your system configuration in a programming language (Python, in this case :^), you might want to check out OpsMop (https://opsmop.io/), the latest thing by the guy who originally wrote Ansible. My impression is that it's still pretty bleeding-edge, but looks like it has promise.

Joe Langdon

unread,
Feb 1, 2019, 9:26:21 AM2/1/19
to Ansible Project
I would take a look at Troposphere. It is a Python project that creates JSON / YAML for Cloudformation scripts. Very similar to what you want to do. I have not heard of the same project for Ansible 

Thomas Güttler

unread,
Feb 1, 2019, 10:48:06 AM2/1/19
to Ansible Project


Am Freitag, 1. Februar 2019 15:20:14 UTC+1 schrieb Josh Smift:
YAML is great; I was confused at first because I thought it was a "markup language" like HTML, but it's just a way to represent data structures.

It's not a programming language, though. If you want to write your system configuration in a programming language (Python, in this case :^), you might want to check out OpsMop (https://opsmop.io/), the latest thing by the guy who originally wrote Ansible. My impression is that it's still pretty bleeding-edge, but looks like it has promise.


Thomas Güttler

unread,
Feb 1, 2019, 10:54:37 AM2/1/19
to Ansible Project


Am Freitag, 1. Februar 2019 15:26:21 UTC+1 schrieb Joe Langdon:
I would take a look at Troposphere. It is a Python project that creates JSON / YAML for Cloudformation scripts. Very similar to what you want to do. I have not heard of the same project for Ansible 



Seems specific to AWS Cloudformation. But good news, I am not the only one who prefers python over yaml.

Stuart Longland

unread,
Feb 2, 2019, 6:49:23 PM2/2/19
to ansible...@googlegroups.com
On 1/2/19 11:07 pm, Thomas Güttler wrote:
> I know how to create dicts, lists, strings, multiline-strings with
> python. The syntax is easy and simple.
>
> I am lazy. I just don't know why I should learn a new language.

It's not a language, it's a serialisation format like JSON, it's a
superset of JSON in fact. Ansible uses its syntax to define a language
on top.

They could have equally used XML or JSON to do this. They chose YAML.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

Kai Stian Olstad

unread,
Feb 6, 2019, 3:59:10 PM2/6/19
to ansible...@googlegroups.com
It didn't last long, it's already discontinued ref.
https://github.com/opsmop/opsmop


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages