Skip to content

Commit

Permalink
Fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikayla Billings-Alston committed Oct 16, 2023
1 parent 8e8cb9f commit 1a5881f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/7-infrastructure-configuration-management/7.2-ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,19 @@ For this exercise you will use Ansible as a provisioner in Vagrant to setup a ne
4. Run a GitHub workflow using the newly provisioned GitHub self-hosted runner.

## 2. Exercise - Ansible and Idempotency
Depending on your implementation of the previous exercise, your playbook may or may not be considered **idempotent**.

Idempotency is a concept in both mathematics and computer science that indicates a given mathematical operation or function can be applied multiple times and yield the same result. An example of this in mathematics could be `x + 0`. No matter how many times you add `0` to `x`, the result will always be `x`.
Depending on your implementation of the previous exercise, your playbook may or may not be considered **idempotent**.

Idempotency is a concept in both mathematics and computer science that indicates a given mathematical operation or function can be applied multiple times and yield the same result. An example of this in mathematics could be `x + 0`. No matter how many times you add `0` to `x`, the result will always be `x`.

More relevantly, in order for an Ansible playbook to be idempotent, it must be able to be run repeatedly and yield the same result each time. Generally, most Ansible modules are idempotent, only making changes when a system is not in line with the specified desired state, but there are some that aren't, notably the command and shell modules.

1. Recreate exercise 1 with idempotency in mind.
>Some potentially helpful resources for making your playbook idempotent:
>Some potentially helpful resources for making your playbook idempotent:
>
>[Ansible handlers](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html#handlers)
>[Ansible handlers](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html#handlers)
>
>[Self-Hosted runners as a service](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html#handlers)
>[Self-Hosted runners as a service](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html#handlers)

2. Ensure you can successfully rerun your playbook using `vagrant provision`, and that doing so results in the same configuration as running it only once.

Expand Down

0 comments on commit 1a5881f

Please sign in to comment.