Skip to content

Instantly share code, notes, and snippets.

Ansible

Overview

It is used for automation of configuration processes. You inform Ansible what is the DESIRED state and Ansible will try to achieve it, no matter what the CURRENT state is. Example: you want to have a file in a spcified location with a specified content. There ar ea few possible starting points:

  • the file does not exist - Ansible will create it
  • the file exist, but has a different content - Ansible will update the file
  • the file exists and has the right contnet - Ansible will do nothing

Comparisons in .NET

Comparisons work out-of-box only for primitive types. For others they need to be defined.

Comparisons do not work well with inheritance. It's not recommneded to implement comparisons on unsealed classes.

IComparable<T>

This interface defines CompareTo method that returns int:

  • -1 (less then)