At the end, this political system is about supporting current power who settled by force (and to whom you have to pay a tax to not be sent into physical jail, and all your belongings taken).
Remember that at the beginning, these nice people are actually people who killed to be in place, and collected a lot of power and money, and that are now defending their position.
Kingdoms, then Dictatorship were too unstable, and this gave birth to Democracy, still with the same elites.
In some way, it is a softer continuation of conquest-coercion dressed as consent.
The newest generations use propaganda to settle; the approach changes, but the goal is ultimately the same.
Dead Comment
There are real diminishing returns in terms of follow-up traffic and follow-up effects. As to be expected, but it's worth keeping in mind that this is something that generally happens over time as the novelty of whatever you're writing about wears off. The good part is that as part of this you'll gradually get more regular readers, so there's less pronounced feast-or-famine cycles.
(Here I don't measure visits as there's so much bot traffic noise especially on anything that hits HN, but mostly focus on whether I get actual engagement, if people reach out to me, send me emails and so on)
I think ultimately a blog post isn't interesting because it's on HN, it's on HN because it's interesting.
Tryharding with regards to the HN frontpage is more likely to come at a cost of writing quality, and thus reducing the likelihood of making the front page.
This needs to be in a directory in your FPATH.
At the core, it uses _arguments to dissect the command line. This both suggests that "-t" exists, is called "tags" and later on sets a state variable to "tags" or "limits" if we're completing these arguments.
#compdef corp-ansible-wrapper
_arguments '-t[tags]:tags:->tags' '-l[limit]:limit:->limits' '-D[diffmode]' '-C[checkmode]' '::optional arg:_files'
detect_playbook
case "$state" in
tags)
...
;;
limits)
...
;;
Given this, the limits autocompletion goes one step further. `detect_playbook` mainly goes through $words and looks for a singular argument looking like "*.yml" and sets that as $PLAYBOOK. Then, based on "$PLAYBOOK", it selects a filter-expression for the groups. This ensures that a `./wrapper mariadb.yml -l<TAB>` only sees mariadb-groups, and not postgres-groups.All of that is shoved into `_values`, and then the usual zsh completion works, so with something like `./wrapper mariadb.yml -l prj4<TAB>`, zsh tries to filter the values based on the word, so this finds stuff like `prj4`, `prj49`, `dc2_prj45`, and so on, but not `prj5`.
detect_playbook
# should be an array.
case $PLAYBOOK in
postgres.yml)
FILTER="pg_\|postgres_\|pgbackrest_"
;;
mariadb.yml)
FILTER="db_\|mariadb_"
;;
# quite a few more
*)
FILTER=""
;;
esac
# probably overly complex
ANSIBLE_GROUPS_RAW=$( cat $ANSIBLE_INVENTORY/groups | grep -E "$FILTER" | sort | uniq | tr '\n' ',')
IFS=',' read -r -A ANSIBLE_GROUPS <<< "$ANSIBLE_GROUPS_RAW"
_values -s: 'groups' "${ANSIBLE_GROUPS[@]}"
For the tags I'm working on a similar thing, but this contains enough ugly shell-script already. However, the key parts there are:- You can run `ansible-playbook "$WORD" --list-tags` to get all tags a playbook references in the current inventory.
- One can give `_values` descriptions. If `_values` sees 'foo[bar]' as an option, it will show the user something like: "foo: bar" and only auto-completes to foo.
- This means, we can give standard or well-established tags short descriptions in a directory or an array or whatever, and instead of offering just "postgres_client_tls_certs" as possible auto-completions for `-t`, we can give the user a prompt like "postgres_client_tls_certs: Ensures the postgres cluster has valid and up-to-date TLS certificates for mutual TLS with applications".
It took a bit of time to understand all of this. But now documenting a tag in a place that people actually look at is very easy and straightforward.
Still cool though, thanks for sharing!
But at work, I've been slowly adding auto completion to our ansible wrapper scripts, like explanations which playbooks to use when, smart `-l` completion based off a possibly selected playbook (so, if the playbook is postgres.yml, it doesn't suggest mariadb groups), tag autocompletion (with a few, admittedly, hardcoded explanations how these tags should be used) and such.
It's somewhat of a friday-afternoon struggle project, but it's making the big ansible project pretty approachable to use.
However, you have mistakenly marked some answers as correct ones in the octopus prompt: only 1 generated image has octopus have sock puppets on all of its tentacles. And you marked that one image as an incorrect one due to sock looking more like gloves.