OpsMop – Config management and app deployment from the creator of Ansible
github.com
github.com
a) many mature configuration management systems like puppet, chef, ansible, and salt
b) lots of architectures that no longer require traditional configuration management (e.g. "serverless", immutable deployments of VM images, docker images on hosted kubernetes)
is there a need for a new CM tool? What is OpsMop doing different or better that gives it a hope of gaining traction?
I think OpsMop allows you to create Python scripts that include deployment tasks along with "standard" code.
An interesting approach in my opinion.
The common pattern of the day was to use Puppet to do OS config management and then Fabric to push out the apps.
Fabric lacked declarative resources to describe the desired state of the end system, which is where Ansible came in.
Ansible differed because it still allowed direct control over multi-machine orderings, which is (IMHO) easiest in push modes, so it was kind of (IMHO) the best of both worlds access models.
OpsMop has the same kind of push model, still keeping the declarative resources, it's just all Python.
However, on the remote end, it uses mitogen, so very efficient RPC ops (1 per role + files) - https://sweetness.hmmz.org/2018-12-18-mitogen-opsmop.html - versus the multiple of SSH operations ansible did per task.
https://www.ansible.com/integrations/containers/ansible-cont...
OpsMop: Building the Next Generation of Configuration Management Tooling ==> https://medium.com/@michaeldehaan/opsmop-building-the-next-g...
"Efficiency in both operation (speed) and development of plugins is a big one."
Or - better yet: the blue collar guys do that.
I write too much YAML, I do not know why everyone all at once decided they were done building abstractions and instead wanted to write a ton of boilerplate.
I use ansible currently for our SMALL business. I have thousands of lines of ansible to do relatively simple tasks. YAML is not a programming language, you have to repeat your self over and over again. If you get tired of doing that, you are out of luck. You are not writing in a programming language so you cannot develop an abstraction.
That being said, the main advantage of Ansible is that someone has already gone in and written all of the boilerplate code for provisioning various resources in my cloud provider. Unless OpsMop has this, I don't see the value-add.
And since it's agentless you can automate almost anything... As mentioned above - the playbooks created by the community avoids you from reinventing the wheel. Companies like Cisco are writing playbook to automate their switches
It's kind of sad because I feel I've invested 5 years into Ansible but now Michael releases something equally impressive seemingly based on experiences and lessons learned while building ansible.
So it's very hard not to just abandon Ansible and go with this new shiny tool.
A fine, admirable and accurate (IMO) mindset. Things get weird when recruiters find out about these new tools and suddenly we're having that time honored discussion about how 'tech hiring is broken' because the people screening resumes don't realize OpsMop hasn't been out for 4 years and no one has 4 years experience with OpsMop.
Everyone scrambles to learn OpsMops-so they can get a job where OpsMop ends up being abandoned and the DevOps team goes back to ansible, other teams start adding it to their tool chains because someone got hired who fiddled with it once and becomes an OpsMop house, a few engineers get very good at it, realize they can probably write a better version, three years later someone's posted "Show HN: OpsBroom" to the front page.
Repeat.
We still do have a lot of modules to write yet, so if you are interested in that, stop by talk.msphere.io - I'm open to a lot of enhancements there, but also want to keep it somewhat controlled.
A lot of the early adoption is no doubt going to be folks doing CM-based builds for images (EC2, docker, whatever), where everything remains pretty disconnected.
A mid-way adoption stage might be using opsmop to run existing ansible content, though ... that's really pointing towards wanting to add something like rsync, which is easy, but... I need to think about that a little bit.
Huh? No it's not, not yet. It's clearly marked as alpha software.
And I'm finding the Python DSL very attractive in theory. At least I'm assuming I'll be able to use it just like I use Python. So I'm not restricted by opsmop if I want to lookup secrets in secrets management API of my choice for example.
Or connect the inventory methods to whatever asset mgmt API I might be using. Possible with Ansible too of course but using Python as DSL gets rid of the entire necessity of ansiblelib and following along with its API.
Ansible YAML is definitely more tidy and concise despite Python's awesome readability. And even though you get all the benefits of the full Python language is a definite advantage (try turning a list ["www1", "www2", "www3"] into the string "www1:443,www2:443,www3:443" without plugins or some serious ugliness) I wonder if having Ansible/Jinja2 preclude most of those abilities is a feature and not a disadvantage.
Either way as someone who has just found himself in an environment that uses Chef/Ruby for Ops stuff and Python for everything else I'll be watching this closely.
We're programmers, and sometimes we're going to need to program to solve this problem. Taking away that option is always a pain. Even if what you wanted was possible with Jinja2, it wasn't necessarily very readable anyway.
Proponents of it will point at that this is the sort of thing that Lisp is good (and they'd be right), but there are other functional languages that are good at it too - the simpler syntax is a bit of a headstart. Elixir's macros system enables a number of lovely little DSLs (e.g. Phoenix router or Ecto DB schemas).
{{ list | map('regex_replace', '(.*)', '\\1:443') | join(',') }}
{{ list | zip_longest([], fillvalue='443') | map('join', ':') | join(',') }}
{% for item in list %}{{item}}:443{%- if not loop.last %},{%- endif %}{%- endfor %}
I wish the following would be possible: {{ list | map('format', '%s:443') | join(',') }}Over the years I haven't been around to keep saying that, but I'd be inclined to have to find ways to open up the programming model while still keeping the mostly organized guide-rails in place.
And despite them calling the language a DSL, it really is a subset of a general purpose programming language, so there's if readability is a goal, well there's going to be an unavoidable amount of line noise.
As a matter of personal taste, I find this to be less readable than Ansible's YAML. Though it's not the most elegant way to express things, it's still a lot cleaner and predictable than code.
In all fairness, the author addresses this in his documentation:
> You might like the language of one thing more than the other. Pick that thing.
Thank you Michael for creating these projects and releasing them as Open Source! I am a big user of Ansible, and have often wished there was a good way to write plays in Python. I will be keeping a close on on both of these projects!
Feedback would be welcome, stop by the forum sometime!
I guess Mr DeHaan decided that this was a mistake and returned to the beaten path of full-featured programming. In which, of course, you can't spill config data into your files as freely as you would with YAML, since it has to be distinguished from language constructs and thus encrusted in syntactical markings.
Now, it seems to me that Lisp better marries data structures to occasional programming functionality, especially for Ansible where every part of a config is a declarative value first, and an instruction secondly. More so compared to Python, which uses statements instead of expressions in plenty of notorious cases.
Of course, you'd still have to mark values with more syntax than in YAML's free-flow, and I guess Lisp isn't good at embedding expressions in strings. In this regard, I'm very curious to see one day a lightweight version of Lisp syntax reminiscent of YAML. Notably, Ansible's configs essentially use the syntax of "function: argument -keyword: value -keyword: value..."
I'm not sure if I've seen a Lisp-based Ansible clone. There's Vektra's Tachyon in Go, but apparently it only uses Lisp for embedded condition snippets: https://github.com/vektra/tachyon
Nope, and I've written on this a bit -- I think Python is a better fit for those that want to program in Python.
For those that want to build their own CMS in something else, go for it!
What I really want is a real document standard that describes common configuration management functions, and then implement a parser in every CM tool, so all of them can do the same basic functions with one standard file. Like a k8s file that can describe Terraform-like modules/providers/resources, and each CM can have it's own implementation to build, test, and apply them.
As an aside, we really aren't using YAML to its full potential. We could benefit from an implementation of YPath so we can work with YAML files the way we use XPath with XML, and tags are greatly underutilized.
I have worked with nightmarishly complicated Ansible playbooks and roles designed to provide declarative infrastructure when it didn't exist in a module. If all you had to change was a group_vars setting, you could be confident in your change. But if you had to edit a role, playbook or task, nobody was sure if it would break something in the future or not. It was much less robust than a real module because it was just the DSL.
With a Python DSL you could write code that was declarative, but because the language is complex, lexing is more difficult, and simple changes to configuration become more error-prone.
By moving to images and containers, the majority of configuration management is now largely unnecessary. We will always need a CM tool, but they should give users less rope to hang themselves with, not more.
So as immutable systems grow - that's a damn good thing. I personally think the docker ecosystem is a trainwreck currently, but that's only my opinion, and doesn't really affect anyone else. But the same concepts have been around for ages in EC2 in immutable systems.
What typically happens is people use the CM tool to provide a higher level abstraction than Bash for describing the image build, so they get features that should have always been in docker files but never were (templates are the biggest one for me).
Further, there is always a need to deploy the "undercloud". Even in heavily containerized microservices setups, there's a need to handle all the magic upgrade fun of upgrading a Mongo cluster, a Cassandra cluster, or a Kafka setup.
Whether we call it configuration management, app deployment, or just a structured way to push scripts around and see what failed, we're going to need those tools.
I believe immutable systems is a fantastic philosophy where it works. It doesn't work everywhere. And CM tools still have a niche for those that want to use them in the build process.
If folks want straight docker files instead, I'm also cool with that.
It at least was parseable.
The trick was, it was always supposed to be at the level of complexity of "grocery lists, but..." ... but frequently I think people tried to program in it a little hard.
OpsMop is based on the idea of a cyborg system - writeable for humans, but easy to interface with machines.
I take some alternate views, and believe YAML is best kept streamlined, which is why I also did not use YAML anchors in ansible.
Ansible is push mode (ssh connection) while Puppet and Chef have an agent that pulls and enforces configuration.
Ansible is great for quick hacky or one time solutions like building a server. It's very newb friendly and easy to use out of the box. Puppet is great for enforcing a configuration every 30 minutes and scales across Data Centers. In my opinion Chef is more robust and is easier to use and share cookbooks on Supermarket.
Ansible Galaxy isn't as great for sharing work, but I find Ansible is so easy to use I don't need anyone else's work.
Once this has a pull mode (agent) it seems it will be like a very lightweight Puppet like declarative tool. Both Puppet and Chef have very mature products for serving and managing infrastructure. They can scale.
This tool might be awesome years from now, but I have to use Ansible everyday at work. From 2.0 to 2.8 it has become a solid and fairly mature product. I also use Puppet and have for 10 years. It feels old and is a pain to use across 1000s of machines in an Enterprise. There is a learning curve and training to be done at all times. At my last job I used Chef and I really love it for being powerful, easy to use, and just having a great design.
We currently install Puppet with Ansible once initial config is done to enforce policies. I could see this potentially replacing the Puppet side of that equation some day.
I'll for sure watch this tool and experiment with it in my lab as it grows. I do love Python and Puppet is far to long an overhaul. It will be interesting to see what directions are taken as this new product matures.
I do not think this is about using python instead of yaml. It is super easy to write Python modules for Ansible and use them. We have to use them for the things that aren't included in the base such as managing Infoblox etc.
The trick is there are some norms you want to express in the language, things like handlers and such, and if you write directly at low level python every time that can be sometimes difficult to maintain a level of consistency (IMHO).
Here's where it's NOT just a collection of python classes - https://sweetness.hmmz.org/2018-12-18-mitogen-opsmop.html
Chef is a closer thing to compare it to.
I guess it's time to learn ...
I suspect the first release will be in about Feburary, but the time to collaborate on working on it is now.
It is designed to be fairly testable, but if you've ever written a similar system, you know that distributed testing of modules on a matrix of 12 platforms IS a trainwreck.
Any units would mostly be proving out the language.
The best way to do that is with a specialized callback, that shares the event stack, and we can then introspect that the events happened in the correct order.
As the callbacks have been changing too much now, writing a boatloat of tests would have been a mistake.
At this point, I'm most interested in feedback on language features, and these will come.
It was an absolute mistake that ansible itself was not more testable at a mock level, a problem made a lot better now by everything being done in one process.
Ansible had the ability to write modules in any language, but this was never really used in practice.
> The purpose of the Opsmop community is to come together to build the ultimate configuration tool we all want to use.
Kinda reminds me of XCKD: https://xkcd.com/927/
Actually this was meant to describe what we do when we work on OpsMop. It's like "hey, let's all figure out what we want in an ideal universe and build it together". Versus like "hey, you're all my user peeps"