Girder Ansible Client
=====================
Use ansible to configure a running girder instance. Currently this supports configuring users and assetstores. Additionally the module supports non-idempotent ```get```, ```put```, ```post```, and ```delete``` API requests. You can install this module by copying ```girder.py``` out of the girder source tree and placing it in a ```library/``` folder alongside your top level playbooks. You may also modify the ```ANSIBLE_LIBRARY``` environment variable, or pass a custom ```--module-path``` to ansible-playbook to provide access to the library. For more information see [Developing Modules](http://docs.ansible.com/ansible/developing_modules.html) in the ansible documentation.
### Important Note:
The girder ansible module relies on the girder-client to do most of the heavy lifting. You must ensure that girder-client is installed in your environment before attempting to use the girder module. For most use cases this means simply installing the girder-client utility before using the girder module.
```yaml
- name: install girder-client pip package
pip: name=girder-client version=1.1.3
become: yes
# Code that uses girder module
```
### Example using 'user'
```yaml
# Ensure "admin" user exists
- name: Create 'admin' User
girder:
user:
firstName: "John"
lastName: "Doe"
login: "admin"
password: "letmein"
email: "john.doe@test.com"
admin: yes
state: present
```
#### Ensure a 'foobar' user exists
```yaml
- name: Create 'foobar' User
girder:
username: "admin"
password: "letmein"
user:
firstName: "Foo"
lastName: "Bar"
login: "foobar"
password: "foobarbaz"
email: "foo.bar@test.com"
admin: yes
state: present
```
#### Remove the 'foobar' user
```yaml
- name: Remove 'foobar' User
username: "admin"
password: "letmein"
girder:
user:
login: "foobar"
password: "foobarbaz"
state: absent
```
### Filesystem Assetstore Tests
```yaml
- name: Create filesystem assetstore
girder:
username: "admin"
password: "letmein"
assetstore:
name: "Temp Filesystem Assetstore"
type: "filesystem"
root: "/data/"
current: true
state: present
- name: Delete filesystem assetstore
girder:
username: "admin"
password: "letmein"
assetstore:
name: "Temp Filesystem Assetstore"
type: "filesystem"
root: "/tmp/"
state: absent
```
**Note:** Currently only filesystem assetstore types are supported.
### Examples using get
```yaml
# Get my info
- name: Get users from http://localhost:80/api/v1/users
girder:
username: 'admin'
password: 'letmein'
get:
path: "users"
register: ret_val
```
Prints debugging messages with the emails of the users from the last task by accessing ```gc_return``` of the registered variable ```ret_val```
```yaml
- name: print emails of users
debug: msg="{{ item['email'] }}"
with_items: "{{ ret_val['gc_return'] }}"
```
### Advanced usage
Supports get, post, put, delete methods, but does not guarantee idempotence on these methods!
```yaml
- name: Run a system check
girder:
username: "admin"
password: "letmein"
put:
path: "system/check"
```
An example of posting an item to Girder Note that this is NOT idempotent. Running multiple times will create "An Item", "An Item (1)", "An Item (2)", etc..
#### Show use of 'token' for making subsequent authentication requests
```yaml
- name: Get Me
girder:
username: "admin"
password: "letmein"
get:
path: "user/me"
register: ret
- name: Get my public folder
girder:
token: "{{ ret['token'] }}"
get:
path: "folder"
parameters:
parentType: "user"
parentId: "{{ ret['gc_return']['_id'] }}"
text: "Public"
register: ret
- name: Post an item to my public folder
girder:
host: "data.kitware.com"
scheme: 'https'
token: "{{ ret['token'] }}"
post:
path: "item"
parameters:
folderId: "{{ ret['gc_return'][0]['_id'] }}"
name: "An Item"
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
PyPI 官网下载 | girder-3.0.0a7.dev81.tar.gz (759个子文件)
girder.dist.cfg 3KB
setup.cfg 977B
girder.cfg 101B
ansible.cfg 32B
logging.config 798B
packages.config 323B
wsgi.config 89B
jasmine.css 6KB
testFileBad.csv 4KB
testFile.csv 97B
sample_dicom.dcm 35KB
Dockerfile 1KB
Dockerfile 627B
Dockerfile 615B
.dockerignore 16B
.ebignore 390B
.editorconfig 450B
.gitignore 253B
.gitignore 242B
.gitignore 46B
.gitignore 37B
.gitignore 32B
.gitignore 24B
.gitignore 7B
.gitignore 5B
favicon.ico 15KB
MANIFEST.in 289B
MANIFEST.in 43B
tox.ini 2KB
Dockerfile.j2 961B
girder.service.j2 217B
fake.jpg 28B
jasmine.js 69KB
testUtils.js 45KB
HierarchyWidget.js 36KB
jobsSpec.js 21KB
MetadataWidget.js 17KB
userQuotaSpec.js 16KB
itemLicensesSpec.js 15KB
AccessWidget.js 15KB
termsSpec.js 14KB
UploadWidget.js 13KB
DicomView.js 13KB
SearchFieldWidget.js 13KB
timingHistoryChartConfig.js 12KB
JobListWidget.js 12KB
App.js 12KB
GroupView.js 12KB
build.js 12KB
FileModel.js 11KB
BrowserWidget.js 10KB
S3UploadHandler.js 9KB
Collection.js 9KB
specRunner.js 9KB
timeChartConfig.js 9KB
JobGraphWidget.js 8KB
AssetstoresView.js 8KB
rest.js 8KB
SystemConfigurationView.js 7KB
MarkdownWidget.js 7KB
webpack.config.js 7KB
routes.js 7KB
ConfigView.js 7KB
QuotaPoliciesWidget.js 7KB
CollectionView.js 7KB
TimelineWidget.js 7KB
misc.js 7KB
GroupModel.js 6KB
UserAccountView.js 6KB
ConfigView.js 6KB
EditAssetstoreWidget.js 6KB
homepageSpec.js 6KB
ItemView.js 6KB
GroupMembersWidget.js 6KB
DateTimeRangeWidget.js 6KB
Model.js 6KB
SearchResultsView.js 5KB
EventStream.js 5KB
UserModel.js 5KB
RootSelectorWidget.js 5KB
UserView.js 5KB
FileListWidget.js 5KB
JobDetailsWidget.js 5KB
ItemListWidget.js 5KB
dialog.js 5KB
ApiKeyListWidget.js 5KB
SearchPaginateWidget.js 4KB
EditGroupWidget.js 4KB
ConfigView.js 4KB
CollectionsView.js 4KB
EditApiKeyWidget.js 4KB
UsersView.js 4KB
EditFolderWidget.js 4KB
ConsoleReporter.js 4KB
auth.js 4KB
CreateThumbnailView.js 4KB
extendModel.js 4KB
ConfigView.js 4KB
EditItemWidget.js 4KB
RegisterView.js 4KB
共 759 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功