Adam Litke - alitke@redhat.com
Senior Software Engineer - Red Hat
August Penguin - 7.9.2017
My create volume
target: my-ceph-storage
operation: create_volume
params:
id: 80a690f4-9fb7-4615-bc83-709cfabb42a4
size: 1
Your create volume
target: your-netapp-storage
operation: create_volume
params:
id: 80a690f4-9fb7-4615-bc83-709cfabb42a4
size: 1
cinder | |
- | deployment complexity |
- | vertical integration |
+ | active community |
= | profit! |
ansible-galaxy install aglitke.quarry
A common API to perform a storage task
Storage type with a unique way of performing operations
A backend instance defined by configuration parameters
---
target_host: localhost
target_user:
backend: ceph
backend_config:
osd: 192.168.2.18
id: admin
key: AQDfdKxYTCs0LSBAt08Qk23Z+ecgAAb2Je2YuA==
pool: volumes
---
- hosts: localhost
roles:
- aglitke.quarry
vars:
generate_only: false
generated_playbook: "/tmp/playbook.yml"
target: myceph
operation: create_volume
params:
id: 80a690f4-9fb7-4615-bc83-709cfabb42a4
size: 1
---
- include: check_vars.yml
- include: make_playbook.yml
when: generated_playbook is defined
- name: Run playbook
shell: ansible-playbook {{ generated_playbook }}
when:
- generated_playbook is defined
- not generate_only
- name: Checking that required playbook variables are set
fail: msg="Variable {{ item }} is not defined in the playbook"
with_items:
- target
- operation
- params
when: vars[item] is undefined
- name: Load target definition
include_vars:
file: "{{ target_definitions_dir }}/{{ target }}.yml"
- name: Checking that required target variables are set
fail: msg="Variable {{ item }} missing from the target definition {{ target }}"
with_items:
- target_host
- target_user
- backend
- backend_config
when: vars[item] is undefined
---
- name: Generate playbook
template:
src: "{{ playbook_templates_dir }}/\
{{ backend }}/{{ operation }}.yml.j2"
dest: "{{ generated_playbook }}"
- hosts: {{ target_host }}
remote_user: {{ target_user }}
tasks:
- name: Setup auth
copy:
content: "{{ backend_config.key }}"
dest: /tmp/quarry_ceph_key
- name: Create a volume
shell: >
rbd -m {{ backend_config.osd }}
--id {{ backend_config.id }}
--keyfile /tmp/quarry_ceph_key
-p {{ backend_config.pool }}
create {{ params.id }} --size {{ params.size }}
Just a playbook!
---
- hosts: localhost
roles:
- aglitke.quarry
vars:
generate_only: false
generated_playbook: "/tmp/playbook.yml"
target: myxtremio <== (change me) ==<
operation: create_volume
params:
id: 80a690f4-9fb7-4615-bc83-709cfabb42a4
size: 1
Title - August Penguin Date