Add example role to base other roles on
This commit is contained in:
2
roles/example/defaults/main.yaml
Normal file
2
roles/example/defaults/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
example_ping: false
|
||||||
13
roles/example/meta/argument_specs.yaml
Normal file
13
roles/example/meta/argument_specs.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
short_description: Example role.
|
||||||
|
description:
|
||||||
|
- This role is just an example.
|
||||||
|
- It pings the host, if example_ping is set to true.
|
||||||
|
options:
|
||||||
|
example_ping:
|
||||||
|
description: This role does nothing, unless this is set to true
|
||||||
|
type: bool
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
17
roles/example/tasks/main.yaml
Normal file
17
roles/example/tasks/main.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure host distribution is supported
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: compatcheck
|
||||||
|
vars:
|
||||||
|
compatcheck_supported_distributions:
|
||||||
|
- name: debian
|
||||||
|
version_min: 8
|
||||||
|
- name: archlinux
|
||||||
|
- name: ubuntu
|
||||||
|
version_min: 16
|
||||||
|
- name: fedora
|
||||||
|
version_min: 29
|
||||||
|
|
||||||
|
- name: Ping
|
||||||
|
ansible.builtin.ping:
|
||||||
|
when: example_ping
|
||||||
Reference in New Issue
Block a user