<div dir="ltr">So on the topic of Salt and YAML... Months ago I showed off a "mini Ansible", which had some of the Ansible ideas for declarative system configuration, similar to what Salt does, though focused on a single computer or smaller (where Ansible and the like are focused on working with a fleet of machines).<div><br></div><div>I came to realize that, despite working with YAML in Ansible for ~5-7 years now, I really despise YAML for this.</div><div><br></div><div>Back at the beginning of October I started an experiment: What would it be like if Ansible had a Python syntax? I've come up with something I'm fairly happy with that achieves this, though again at a much smaller scale. One of the examples from the tutorial is:</div><div><br></div><div> from uplaybook import pyinfra, fs, core<br><br> def restart_apache():<br> pyinfra.systemd.service(service="apache2", restarted=True)<br><br> pyinfra.apt.packages(packages=["apache2", "libapache2-mod-uwsgi"])<br> for module_name in ["proxy", "uwsgi"]:<br> fs.ln(src="/etc/apache2/mods-available/{{ module_name }}.load",<br> path="/etc/apache2/mods-enabled",<br> symbolic=True).notify(restart_apache)<br> fs.cp(path="/etc/apache2/sites-available/my-website.conf").notify(restart_apache)<br> fs.ln(src="/etc/apache2/sites-available/my-website.conf",<br> path="/etc/apache2/sites-enabled",<br> symbolic=True).notify(restart_apache)<br><br> pyinfra.systemd.service(service="apache2", running=True, enabled=True)<br></div><div><br></div><div>Which I think is fairly self-explanatory.</div><div><br></div><div>I'm just getting ready to open it up for more public comment, working on polishing the documentation a bit at the moment.</div><div><br></div><div>I'd be interested in your thoughts on it, since it was a topic of discussion tonight it might be that the pump has been primed.</div><div><br></div><div><a href="https://linsomniac.github.io/uplaybook/tutorial/">https://linsomniac.github.io/uplaybook/tutorial/</a><br></div><div><a href="https://github.com/linsomniac/uplaybook">https://github.com/linsomniac/uplaybook</a><br></div><div><br></div><div>Sean</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 12, 2023 at 7:46 PM Bob Proulx <<a href="mailto:bob@proulx.com">bob@proulx.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">j dewitt wrote:<br>
> What: Tuesday December 12th, 2023 NCLUG Meeting<br>
<br>
Alex gave a shout out to the NOCO Hackers group which is running a<br>
Capture The Flag competition right now. There are only a few people<br>
who are working the challenges and Alex is throwing down the gauntlet<br>
that he would like to battle it out! Check it out!<br>
<br>
<a href="https://nocohackers.github.io/" rel="noreferrer" target="_blank">https://nocohackers.github.io/</a><br>
<br>
Aaron talked about how he does infrastructure management using Salt<br>
and other tools.<br>
<br>
<a href="https://saltproject.io/" rel="noreferrer" target="_blank">https://saltproject.io/</a><br>
<br>
We had a small disagreement about whether YAML and JSON are either<br>
officially subsets of each other or equivalent or what. YAML can<br>
parse JSON now?! Who knew? Salt configuration are YAML files. YAML<br>
Ain't Markup Language. It's declarative. Say the state that you want<br>
systems to result in and then Salt makes it so. The concept here is<br>
that you don't admin a 10,000 single machines instead you administer<br>
one collection of many machines. It's the collection which is<br>
configured. Then individual hosts are just grains of sand in the salt<br>
collective. Salt Shaker?<br>
<br>
Aaron's discussion of infrastructure configuration with Salt was the<br>
main topic of the night. After that we adjourned.<br>
</blockquote></div>