scy,
@scy@chaos.social avatar

Are there people among you who have used both(!) and personally?

I’m currently using Salt for some of my personal & freelance infrastructure, but it feels like it’s losing the popularity battle, and I think about switching to Ansible.

I usually run Salt agent-less, local-only (config repo cloned to the machine). I assume that’s possible with Ansible, too?

How declarative is Ansible these days? I want to define target states, the system should figure out how to get there.

svbito,
@svbito@chaos.social avatar

@scy After 10 years with ansible and 2 with salt: I wouldn’t start anything new with ansible. Though it’s a lot easier at first and the simple (and rigid) structure helps a lot with learning, anything slightly more complex than the examples can lead to ugly workarounds. It’s absolutely great for simple and local stuff, but for anything distributed or complex, I‘d prefer the flexibility of salt. If you are already familiar with salt, I think there is little to be gained by switching to ansible.

scy,
@scy@chaos.social avatar

@svbito Thanks a lot for that detailed answer!

klausi,
@klausi@mastodon.social avatar

@scy I'm using for local computer config, it works well enough https://github.com/klausi/dotfiles

scy,
@scy@chaos.social avatar

@klausi Ah, a practical example, that’s cool. Thanks!

manawyrm,
@manawyrm@chaos.social avatar

@scy

Hab das selbst noch nicht genutzt, aber die coolen Kids machen heutzutage ja Nix stattdessen :P

Spass bei Seite:
Ansible kann nur agent-less laufen und verbindet sich zwangsweise per SSH.
Laedt dann da so nen Stub hoch und fummelt dann mitdessen Hilfe an der Konfig rum.

Deklarativ/Target-State:
Hm, naja. Also du gibst an, dass du z.B. eine Datei dort mit folgenden Parametern/Inhalt haben willst und das wird dann ensured.

scy,
@scy@chaos.social avatar

@manawyrm Ja, ich glaube, ich muss einfach mal schauen, wie ein paar meiner Use-Cases gelöst würden.

Ich mach in Salt z.B. auch so Dinge wie „sorg dafür, dass folgender Textblock in der Config steht, aber nimm ansonsten die Default-Config der Distro“. Im Prinzip patcht es also die Configs für mich.

Oder auch „hier sind ein paar Keys und Values, die sollen in die Config, aber lass den Rest in Ruhe“.

Ist das zerbrechlich? Lässt sich drüber diskutieren.

manawyrm,
@manawyrm@chaos.social avatar

@scy "aber lass den Rest in Ruhe", joa, sowas ist eher grenzwertig (aber meist auch generell eine wackelige Idee).

Bei Ansible wird man Fan von den .d/ Ordnern mit Konfigurationsdateien drin und dann include config.d/*.conf in der Hauptdatei, dann wird das alles ein wenig weniger nervig :)

iameru,
@iameru@leipzig.town avatar

@scy mal ein beispiel aus einem ansible task, dann kannst du das vergleichen. wie wäre das in salt?

  • name: ensure conf is included
    become: yes
    lineinfile:
    path: /etc/rsyslog.conf
    line: $IncludeConfig /etc/rsyslog.d/custom.conf
    state: present
scy,
@scy@chaos.social avatar

@iameru Sehr ähnlich:

ensure conf is included:
file.append:

  • name: /etc/rsyslog.conf
  • text: $includeConfig /etc/rsyslog.d/custom.conf

file.append hängt die Zeile nur an, wenn sie nicht schon anhängt. Und become ist hier nicht nötig, weil Salt sowieso standardmäßig als root läuft.

NexCarter,
@NexCarter@chaos.social avatar

@scy pinging @Honigeintopf for more elaborate info :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Ansible
  • slotface
  • kavyap
  • thenastyranch
  • everett
  • osvaldo12
  • rosin
  • mdbf
  • DreamBathrooms
  • khanakhh
  • magazineikmin
  • InstantRegret
  • Youngstown
  • Durango
  • Leos
  • normalnudes
  • ngwrru68w68
  • modclub
  • anitta
  • tacticalgear
  • ethstaker
  • GTA5RPClips
  • cubers
  • megavids
  • provamag3
  • cisconetworking
  • tester
  • JUstTest
  • lostlight
  • All magazines