Tuesday December 12th, 2023 NCLUG Meeting

Sean Reifschneider jafo00 at gmail.com
Wed Dec 13 06:02:27 UTC 2023


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).

I came to realize that, despite working with YAML in Ansible for ~5-7 years
now, I really despise YAML for this.

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:

    from uplaybook import pyinfra, fs, core

    def restart_apache():
        pyinfra.systemd.service(service="apache2", restarted=True)

    pyinfra.apt.packages(packages=["apache2", "libapache2-mod-uwsgi"])
    for module_name in ["proxy", "uwsgi"]:
        fs.ln(src="/etc/apache2/mods-available/{{ module_name }}.load",
              path="/etc/apache2/mods-enabled",
              symbolic=True).notify(restart_apache)

fs.cp(path="/etc/apache2/sites-available/my-website.conf").notify(restart_apache)
    fs.ln(src="/etc/apache2/sites-available/my-website.conf",
          path="/etc/apache2/sites-enabled",
          symbolic=True).notify(restart_apache)

    pyinfra.systemd.service(service="apache2", running=True, enabled=True)

Which I think is fairly self-explanatory.

I'm just getting ready to open it up for more public comment, working on
polishing the documentation a bit at the moment.

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.

https://linsomniac.github.io/uplaybook/tutorial/
https://github.com/linsomniac/uplaybook

Sean

On Tue, Dec 12, 2023 at 7:46 PM Bob Proulx <bob at proulx.com> wrote:

> j dewitt wrote:
> > What: Tuesday December 12th, 2023 NCLUG Meeting
>
> Alex gave a shout out to the NOCO Hackers group which is running a
> Capture The Flag competition right now.  There are only a few people
> who are working the challenges and Alex is throwing down the gauntlet
> that he would like to battle it out!  Check it out!
>
>     https://nocohackers.github.io/
>
> Aaron talked about how he does infrastructure management using Salt
> and other tools.
>
>     https://saltproject.io/
>
> We had a small disagreement about whether YAML and JSON are either
> officially subsets of each other or equivalent or what.  YAML can
> parse JSON now?!  Who knew?  Salt configuration are YAML files.  YAML
> Ain't Markup Language.  It's declarative.  Say the state that you want
> systems to result in and then Salt makes it so.  The concept here is
> that you don't admin a 10,000 single machines instead you administer
> one collection of many machines.  It's the collection which is
> configured.  Then individual hosts are just grains of sand in the salt
> collective.  Salt Shaker?
>
> Aaron's discussion of infrastructure configuration with Salt was the
> main topic of the night.  After that we adjourned.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.nclug.org/pipermail/nclug/attachments/20231212/fed50152/attachment.htm>


More information about the NCLUG mailing list