yadro.tatlin_uni.tatlin_sp_resource_file module – Create or modify a file resource
Note
This module is part of the yadro.tatlin_uni collection (version 1.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install yadro.tatlin_uni
.
To use it in a playbook, specify: yadro.tatlin_uni.tatlin_sp_resource_file
.
New in version 1.0.0: of yadro.tatlin_uni
Synopsis
This module is intended to create new file resource/resources and change existing resource/resources
Multiple resources can be created at once with name_template (For Tatlin>=2.7 only)
Supports check mode
Parameters
Parameter |
Comments |
---|---|
connection describes Tatlin Storage Processor (SP) connection configuration. Only session connection supported. Authorization is executed automatically with corresponding endpoint. ‘auth/login’ by default. Client receives x-auth-token and uses it for following requests. |
|
Tatlin REST API entrypoint. |
|
Tatlin user password. |
|
Tatlin REST API request timeout. Default: 60 |
|
Tatlin username to login. |
|
Responsible for SSL certificates validation. If set to False certificates won’t validated. Choices:
|
|
Name of the resource |
|
Template for bulk mode creation. Possible formats - ‘1-3’, ‘1-3,4,7-10’, ‘0-99’ Example - with name_template=’1-3’ and name=’res_’ 3 resources with names ‘res_1’, ‘res_2’, ‘res_3’ will be created Not supported in Tatlin<=2.7 |
|
Name of the pool that includes the resource |
|
List of names of the ports for export resources |
|
Cache reading Required for creating a new resource Choices:
|
|
Resource volume Required if new resource is creating Not allowed for changing Can be presented as a string number with postfix For example ‘100 MiB’. Following postfixes are allowed - [B, KB, MB, GB, TB, PB, EB, ZB, YB, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB] If no postfix is passed, ‘B’ (bytes) will be used |
|
List of names of the subnets for export resources |
|
Type of the file resource Choices:
|
|
List of names of the user groups for export resources with corresponding permissions |
|
Name of the user group |
|
User group`s permissions Choices:
|
|
List of names of the users for export resources with corresponding permissions |
|
Name of the user |
|
User`s permissions Choices:
|
|
Wait until resource or resources will be created or changed If Irrelevant for bulk resources changing Choices:
|
|
Number of seconds to wait when wait=true Default: 300 |
|
Cache writing Required for creating a new resource Choices:
|
Examples
---
- name: Set single resource
yadro.tatlin_uni.tatlin_sp_resource_file:
connection: "{{ connection }}"
name: example_resource
pool: example_pool
type: nfs
size: 100 MiB
read_cache: true
write_cache: true
ports:
- p00
- p01
subnets:
- example_subnet1
- example_subnet2
users:
- name: example_user1
permissions: rw
- name: example_user2
permissions: r
user_groups:
- name: example_user_group1
permissions: r
- name: example_user_group2
permissions: rw
- name: Set multiple resources
yadro.tatlin_uni.tatlin_sp_resource_file:
connection: "{{ connection }}"
name: example_resource
name_template: 1-3,5,7-8
pool: example_pool
type: nfs
size: 100 MiB
read_cache: true
write_cache: true
ports:
- p00
- p01
subnets:
- example_subnet1
- example_subnet2
users:
- name: example_user1
permissions: rw
- name: example_user2
permissions: r
user_groups:
- name: example_user_group1
permissions: r
- name: example_user_group2
permissions: rw
- name: Change single resource
yadro.tatlin_uni.tatlin_sp_resource_file:
connection: "{{ connection }}"
name: example_resource
pool: example_pool
type: nfs
read_cache: false
write_cache: false
ports:
- p10
subnets:
- example_subnet2
- example_subnet3
users:
- name: example_user2
permissions: rw
- name: example_user3
permissions: r
user_groups:
- name: example_user_group2
permissions: r
- name: example_user_group3
permissions: rw
- name: Change multiple resources
yadro.tatlin_uni.tatlin_sp_resource_file:
connection: "{{ connection }}"
name: example_resource
name_template: 1-100
pool: example_pool
type: nfs
read_cache: false
write_cache: false
ports:
- p10
subnets:
- example_subnet2
- example_subnet3
users:
- name: example_user2
permissions: rw
- name: example_user3
permissions: r
user_groups:
- name: example_user_group2
permissions: r
- name: example_user_group3
permissions: rw
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Names of the changed resources Returned: on success |
|
Names of the created resources Returned: on success |
|
Error details if raised Returned: on error |
|
Operation status message Returned: always |