Skip to content

Commit

Permalink
Switch default storage backend to file
Browse files Browse the repository at this point in the history
Revert a change to allow the gnocchi_pip_requirements to be
tailored to the storage driver chosen. There is another bug
file to make that work.
  • Loading branch information
stevelle committed Mar 15, 2016
1 parent 3b0ae09 commit 94adfd7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ gnocchi_galera_address: "{{ galera_address }}"
gnocchi_db_sync_options: ""

#: Storage info
gnocchi_storage_driver: swift
gnocchi_storage_driver: file
gnocchi_coordination_url: "mysql://{{ gnocchi_galera_user }}:{{ gnocchi_galera_password }}@{{ gnocchi_galera_address }}/{{ gnocchi_galera_database }}?charset=utf8&timeout=5"

#: Default Archive Policies
Expand Down Expand Up @@ -159,7 +159,8 @@ gnocchi_requires_pip_packages:

#: Common pip packages
gnocchi_pip_packages:
- "gnocchi[mysql,{{ gnocchi_storage_driver }}]"
# FUTURE optimize after https://bugs.launchpad.net/openstack-ansible/+bug/1557682
- "gnocchi[mysql,file,swift,ceph]"
- keystonemiddleware
- gnocchiclient
- python-memcached
Expand Down
2 changes: 1 addition & 1 deletion ext/playbooks/os-gnocchi-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- "lxc.mount.entry=/openstack/{{ container_name }} var/lib/gnocchi none bind 0 0"
delegate_to: "{{ physical_host }}"
when: >
(not is_metal | bool) and gnocchi_storage_driver is defined and
(not is_metal | bool) and gnocchi_storage_driver is not defined or
(gnocchi_storage_driver == "file")
register: container_extra_config
tags:
Expand Down
62 changes: 38 additions & 24 deletions templates/gnocchi.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,44 @@ check_revocations_for_cached = False
[storage]
driver = {{ gnocchi_storage_driver }}
coordination_url = {{ gnocchi_coordination_url }}
{% if gnocchi_storage_driver == 'file' %}
############
## File Storage
############
file_basepath = /var/lib/gnocchi
file_basepath_tmp = ${file_basepath}/tmp
{% endif %}
{% if gnocchi_storage_driver == 'swift' %}
############
## Swift Storage
############
swift_auth_version: 3
swift_authurl: "{{ keystone_service_internalurl }}"
swift_endpoint_type: internalURL
swift_user: "{{ gnocchi_service_user_name }}"
swift_key: "{{ gnocchi_service_password }}"
swift_region_name: "{{ gnocchi_service_region }}"
swift_project_domain_id: "{{ gnocchi_service_project_domain_id }}"
swift_user_domain_id: "{{ gnocchi_service_user_domain_id }}"
swift_tenant_name: "{{ gnocchi_service_project_name }}"
swift_container_prefix: gnocchi
{% endif %}
{% if gnocchi_storage_driver == 'ceph' %}
############
## Ceph Storage
############
# Ceph pool name to use. (string value)
#ceph_pool = gnocchi

# Ceph username (ie: client.admin). (string value)
#ceph_username = <None>

# Ceph keyring path. (string value)
#ceph_keyring = <None>

# Ceph configuration file. (string value)
#ceph_conffile = /etc/ceph/ceph.conf
{% endif %}

[metricd]
# Number of workers for Gnocchi metric daemons. By default the available number
Expand Down Expand Up @@ -69,30 +107,6 @@ coordination_url = {{ gnocchi_coordination_url }}
# Delay between flushes (floating point value)
#flush_delay = <None>

{% if gnocchi_storage_driver == 'file' %}
############
## File Storage
############
file_basepath = /var/lib/gnocchi
file_basepath_tmp = ${file_basepath}/tmp
{% endif %}
{% if gnocchi_storage_driver == 'ceph' %}
############
## Ceph Storage
############
# Ceph pool name to use. (string value)
#ceph_pool = gnocchi

# Ceph username (ie: client.admin). (string value)
#ceph_username = <None>

# Ceph keyring path. (string value)
#ceph_keyring = <None>

# Ceph configuration file. (string value)
#ceph_conffile = /etc/ceph/ceph.conf
{% endif %}

############
## InfluxDB Storage
############
Expand Down

0 comments on commit 94adfd7

Please sign in to comment.