Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lab-Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSDS
Teaching
Bachelor
Cloud-and-Deployment
Lab-Ansible
Commits
3e13ceec
Unverified
Commit
3e13ceec
authored
9 months ago
by
Marco Emilio "sphakka" Poleggi
Browse files
Options
Downloads
Patches
Plain Diff
More info for the KinD boilerplate
Signed-off-by:
Marco Emilio "sphakka" Poleggi
<
marcoep@ieee.org
>
parent
e5b76d02
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+9
-10
9 additions, 10 deletions
README.md
ansible/playbooks/kind-metallb.yml
+7
-0
7 additions, 0 deletions
ansible/playbooks/kind-metallb.yml
with
16 additions
and
10 deletions
README.md
+
9
−
10
View file @
3e13ceec
...
...
@@ -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
D
esired
S
tate
Configuration
principle
s
###
### Task #5: Test
the d
esired
s
tate principle ###
**Goal:** test and verify that Ansible implements the principles of
D
esired
S
tate
Configuration
.
**Goal:** test and verify that Ansible implements the principles of
d
esired
s
tate
and idempotence
.
According to th
is
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 th
e *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.
...
...
This diff is collapsed.
Click to expand it.
ansible/playbooks/kind-metallb.yml
+
7
−
0
View file @
3e13ceec
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment