4 ms·
I love the idea to use Python directly over something like YAML. YAML almost always ends up diverging into some strange, Turing-complete DSL. Carrying over th
by curryst 5y ago
I love the idea to use Python directly over something like YAML. YAML almost always ends up diverging into some strange, Turing-complete DSL.
Carrying over the Ansible concept of roles a little strange. Python already has several means of packaging code for re-use (functions, functions as values, packages, modules), and executing packaged code is obvious. Ansible has to do something like that because of YAML, but Python's solution seems strictly superior here.
I've always wanted an Ansible-like tool that used and embraced Python directly. Effectively a series of interfaces designed to work with each other, with various backends fulfilling them.
I want to be able to do something like
app_hosts = inventory.find(runs_application='app', env='production')
app_hosts.map(lambda host: host.services.stop('app'))
for h in app_hosts:
myApp.upgrade(h, '1.3.4')
app_hosts.map(lambda host: host.services.start('app'))
And then have it spit out a report on what was set up/changed/done. Similar to what Pulumi seems to do, but in a different niche.
- mattbillenstein 5y agoThanks, yeah, I think in ansible and this thing, a role is how we apply some subset of the configs to a given host. I use salt states as roles more or less as well. So a given host in the metadata will say that it has roles X, Y, Z - and there is a separate runable thing for each of those to configure each host that wants them. I sorta want the config language to be python while still looking like a very simple playbook - so there shouldn't be like classes, functions, etc. Just a script you run top to bottom like salt states or ansible playbooks. From your example, this is a bit closer to what I think Fabric is: http://www.fabfile.org/ http://www.fabfile.org/