diff --git a/README.md b/README.md index 1c367d5e0a25f61d04939ebba40d08fa1dfe6eab..70a0824e7e63d9066c8fd6ab59bd5a494fd2a597 100644 --- a/README.md +++ b/README.md @@ -345,17 +345,17 @@ using plain `http`): `http://<VM-DNS-name-or-IP-address>`. You should see the homepage showing "nginx, configured by Ansible". -### Task #5: Test Desired State Configuration principles ### +### Task #5: Test the desired state principle ### -**Goal:** test and verify that Ansible implements the principles of Desired -State Configuration. +**Goal:** test and verify that Ansible implements the principles of desired +state and idempotence. -According to this principle, before doing anything, Ansible should establish -the current state of the managed server, compare it to the desired state -expressed in the playbook, and then only perform the actions necessary to -bring the current state to the desired state. In other words, if the managed -system is already in its desired state, nothing will be done (apart from some -notable exception -- see below): that's called "idempotence". +According to the *desired state* principle, before doing anything, Ansible +should establish the current state of the managed server, compare it to the +goals expressed in the playbook, and then only perform the actions necessary +to bring the current state to the desired state. In other words, if the +managed system is already in its desired state, nothing will be done (apart +from some notable exception -- see below): that's called "[idempotence](https://en.wikipedia.org/wiki/Idempotence)". In its ouput, Ansible marks tasks where it had to perform some action as *changed* whereas tasks where the actual state already corresponded to the @@ -387,7 +387,6 @@ desired state as *ok*. on. - ### Task #6: Adding a handler for nginx restart ### **Goal:** improve the playbook by restarting nginx only when needed. diff --git a/ansible/playbooks/kind-metallb.yml b/ansible/playbooks/kind-metallb.yml index 951e35e8733897d393bd00908ed1300b4497e0a8..da54c4b6679db396c70207109139596d972854fe 100644 --- a/ansible/playbooks/kind-metallb.yml +++ b/ansible/playbooks/kind-metallb.yml @@ -31,9 +31,16 @@ # "metallb-native.yml"), using a block here is recommended! # - Configuration tasks shall trigger their respective deployments. + # Optional *bonus* auxiliary task for the "rebuild all" + # Checks the existence of a KinD cluster + # - Capture output with "register" and use it as condition with + # "changed_when" + # - Should trigger the creation of the KinD cluster if no cluster is running (even + # if its config hasn't changed) # Optional *bonus* on-demand tasks: + # [** Mandatory for the groups of 3 **] # - Rebuild all: manually reprovision the cluster and redeploy the # application (tip: notify via a signal). This might require an extra # task that checks the existence of a KinD cluster.