diff --git a/README.md b/README.md index fda403e0..07f4454a 100644 --- a/README.md +++ b/README.md @@ -30,60 +30,20 @@ on the *control node* before using the role. ## Role Variables -Validation is enforced by `meta/argument_specs.yml`. - A description of all input variables (i.e. variables that are defined in `defaults/main.yml`) for the role should go here as these form an API of the role. Each variable should have its own section e.g. ### template_foo -A string variable for the foo setting. -The default value is `"foo"`. +This variable is required. It is a string that lists the foo of the role. +There is no default value. ### template_bar -A boolean variable that enables or disables the bar feature. +This variable is optional. It is a boolean that tells the role to disable bar. The default value is `true`. -### template_baz - -An integer variable for a numeric setting. -The default value is `0`. - -### template_config_path - -Filesystem path to the configuration file. -The default value is `"/etc/template.conf"`. - -### template_state - -Desired state of the template subsystem. Must be one of `enabled` -or `disabled`. The default value is `"enabled"`. - -### template_packages - -A list of package names (strings). -The default value is `[]`. - -### template_raw_value - -A variable that accepts values of different types (e.g. a string or a list). -The default value is `""`. - -### template_services - -A list of service configurations. Each entry is a dictionary with the -following keys: - -| Key | Type | Required | Description | -|-----|------|----------|-------------| -| `name` | str | yes | Name of the service. | -| `type` | str | no | Type of the service. One of `simple`, `forking`, `oneshot`. | -| `enabled` | bool | no | Whether the service should be enabled at boot. | - -The default value is `[]`. - Variables that are not intended as input, like variables defined in `vars/main.yml`, variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) can be also mentioned here but keep in @@ -95,21 +55,6 @@ Example of setting the variables: ```yaml template_foo: "oof" template_bar: false -template_baz: 42 -template_config_path: /etc/myapp/config.yml -template_state: disabled -template_packages: - - vim - - tmux -template_raw_value: - - first - - second -template_services: - - name: httpd - type: forking - enabled: true - - name: my-worker - type: simple ``` ## Variables Exported by the Role @@ -139,12 +84,6 @@ passed in as parameters) is always nice for users too: vars: template_foo: "foo foo!" template_bar: false - template_baz: 42 - template_state: disabled - template_services: - - name: httpd - type: forking - enabled: true roles: - linux-system-roles.template ``` diff --git a/defaults/main.yml b/defaults/main.yml index a01f9995..6944529b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,9 +6,3 @@ # Examples of role input variables: template_foo: foo template_bar: true -template_baz: 0 -template_config_path: /etc/template.conf -template_state: enabled -template_packages: [] -template_raw_value: "" -template_services: [] diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml deleted file mode 100644 index 097ac113..00000000 --- a/meta/argument_specs.yml +++ /dev/null @@ -1,76 +0,0 @@ -# SPDX-License-Identifier: MIT ---- -argument_specs: - main: - short_description: Basic template for Linux system roles - options: - template_foo: - type: str - description: >- - A string variable for the foo setting. - - template_bar: - type: bool - description: >- - A boolean variable that enables or disables the bar feature. - - template_baz: - type: int - description: >- - An integer variable for a numeric setting. - - template_config_path: - type: path - description: >- - Filesystem path to the configuration file. - - template_state: - type: str - choices: - - enabled - - disabled - description: >- - Desired state of the template subsystem. Use choices to - restrict a string variable to a fixed set of allowed values. - - template_packages: - type: list - elements: str - description: >- - A list of package names. Use elements to declare the type - of each item in the list. - - template_raw_value: - type: raw - description: >- - A variable that accepts values of different types. Use raw - when the variable can be either a string or a list, for - example. - - template_services: - type: list - elements: dict - description: >- - A list of service configurations. Each entry is a dictionary - with its own set of options. Use this pattern when the role - takes a list of structured items. - options: - name: - type: str - required: true - description: >- - Name of the service. Mark a sub-option as required when - it must always be provided. - type: - type: str - choices: - - simple - - forking - - oneshot - description: >- - Type of the service. Choices work inside nested options - the same way as at the top level. - enabled: - type: bool - description: >- - Whether the service should be enabled at boot.