From 679968d01b3f635991d4947eaa5205b31e54b89f Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 8 Oct 2023 12:41:32 -0500 Subject: [PATCH] Update README with variables information --- README.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c7725cf..a9aba9f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ More info: ## Using this collection -### Installing the Collection from Ansible Galaxy +### Install collection Install it with the Ansible Galaxy CLI: @@ -45,7 +45,16 @@ collections: - name: vladgh.samba ``` -Using the GitHub repository and specific branch or release: +Optionally, You can specify a version number: + +```yaml +--- +collections: + - name: vladgh.samba + version: ">=3.1.1" +``` + +You can also refer to a branch or to a git commit-ish object (commit, tag, branch or release) ```yaml collections: @@ -54,11 +63,19 @@ collections: type: git ``` -### Import Roles +For more information, see [Ansible using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) + +### Load role + +After the collection is installed you can include the `server` role. +You can define variables in a variety of places, such as in inventory, in playbooks, in reusable files, in roles, and at the command line. Ansible loads every possible variable it finds, then chooses the variable to apply based on [variable precedence rules](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#ansible-variable-precedence). +A complete overview of server role variables follows below. + +For more information, see [Using variables](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#where-to-set-variables). ```yaml --- -- name: Common +- name: Samba Server hosts: all become: true tasks: @@ -67,7 +84,9 @@ collections: name: vladgh.samba.server ``` -### Import Playbooks +### Import playbook + +Alternatively, you can directly import the existing playbook: ```yaml --- @@ -75,8 +94,6 @@ collections: ansible.builtin.import_playbook: vladgh.samba.server ``` -See [Ansible using collections](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html) for more details. - ## Server Role Variables | Variable | Default | Comments |