Skip to content

Commit

Permalink
Add sample custom play (#232)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt committed Dec 13, 2023
1 parent 0f92ce1 commit 2db166e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/guides/operations-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,28 @@ osism noset bootstrap NODE

* Ansible fact: `ansible_local.osism.bootstrap`
* State file: `/etc/osism/bootstrap`

## Custom plays

Custom Plays can be used in all environments in the configuration repository.

For example, this is a play to prepare all devices to be used for Ceph on a Ceph
resource node. It is saved in the configuration repository in the file
`environments/ceph/playbook-wipe-partitions.yml`. It is run with
`osism apply -e ceph wipe-parititons`.

```yaml title="environments/ceph/playbook-wipe-partitions.yml
---
- name: Wipe partitions
hosts: ceph-resource
gather_facts: false

tasks:
- name: Wipe partitions
become: true
ansible.builtin.shell: |
wipefs --all "{{ item }}"
dd if=/dev/zero of="{{ item }}" bs=1 count=4096
changed_when: false
with_items: "{{ devices }}"
```

0 comments on commit 2db166e

Please sign in to comment.