Retire stackforge/glance-salt-formula
This commit is contained in:
parent
39c58e2d88
commit
f5660e5ec2
@ -1,4 +0,0 @@
|
||||
[gerrit]
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=stackforge/glance-salt-formula.git
|
43
README.rst
43
README.rst
@ -1,40 +1,7 @@
|
||||
==============
|
||||
Glance Formula
|
||||
==============
|
||||
This project is no longer maintained.
|
||||
|
||||
Install and configure the OpenStack Glance service.
|
||||
The contents of this repository are still available in the Git source code
|
||||
management system. To see the contents of this repository before it reached
|
||||
its end of life, please check out the previous commit with
|
||||
"git checkout HEAD^1".
|
||||
|
||||
.. note::
|
||||
See the full `Salt Formulas installation and usage instructions
|
||||
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
|
||||
|
||||
Available states
|
||||
================
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
``glance``
|
||||
----------
|
||||
|
||||
Install the Glance and enable the service.
|
||||
|
||||
``glance.db``
|
||||
-------------
|
||||
|
||||
Create the db for Glance service.
|
||||
|
||||
``glance.keystone``
|
||||
-------------------
|
||||
|
||||
Init the glance user, service and endpoint.
|
||||
|
||||
``glance.server``
|
||||
-----------------
|
||||
|
||||
Install the Glance and enable the service.
|
||||
|
||||
``glance.client``
|
||||
-----------------
|
||||
|
||||
Install the python-glanceclient package.
|
||||
|
@ -1,6 +0,0 @@
|
||||
{%- from "glance/map.jinja" import glance with context %}
|
||||
|
||||
glance-client:
|
||||
pkg.installed:
|
||||
- refresh: False
|
||||
- name: {{ glance.client_pkg }}
|
@ -1,16 +0,0 @@
|
||||
{%- set name="glance" %}
|
||||
|
||||
{{ name }}-db:
|
||||
mysql_database.present:
|
||||
- name: {{ name }}
|
||||
- character_set: 'utf8'
|
||||
- collate: 'utf8_general_ci'
|
||||
mysql_user.present:
|
||||
- name: {{ name }}
|
||||
- host: "{{ salt["pillar.get"](name + ":mysql:host","%") }}"
|
||||
- password: {{ salt["pillar.get"](name + ":mysql:password") }}
|
||||
mysql_grants.present:
|
||||
- host: "{{ salt["pillar.get"](name + ":mysql:host","%") }}"
|
||||
- grant: all privileges
|
||||
- database: "{{ name }}.*"
|
||||
- user: {{ name }}
|
@ -1,8 +0,0 @@
|
||||
{% from "glance/map.jinja" import glance_api_config with context -%}
|
||||
# This file is managed by salt
|
||||
{% for section, section_values in glance_api_config | dictsort(true) %}
|
||||
[{{ section }}]
|
||||
{%- for key, value in section_values|dictsort(true)%}
|
||||
{{ key }} = {{ value }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
@ -1,8 +0,0 @@
|
||||
{% from "glance/map.jinja" import glance_cache_config with context -%}
|
||||
# This file is managed by salt
|
||||
{% for section, section_values in glance_cache_config | dictsort(true) %}
|
||||
[{{ section }}]
|
||||
{%- for key, value in section_values|dictsort(true)%}
|
||||
{{ key }} = {{ value }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
@ -1,8 +0,0 @@
|
||||
{% from "glance/map.jinja" import glance_reg_config with context -%}
|
||||
# This file is managed by salt
|
||||
{% for section, section_values in glance_reg_config | dictsort(true) %}
|
||||
[{{ section }}]
|
||||
{%- for key, value in section_values|dictsort(true)%}
|
||||
{{ key }} = {{ value }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
@ -1,8 +0,0 @@
|
||||
{% from "glance/map.jinja" import glance_scb_config with context -%}
|
||||
# This file is managed by salt
|
||||
{% for section, section_values in glance_scb_config | dictsort(true) %}
|
||||
[{{ section }}]
|
||||
{%- for key, value in section_values|dictsort(true)%}
|
||||
{{ key }} = {{ value }}
|
||||
{%- endfor %}
|
||||
{% endfor %}
|
@ -1,5 +0,0 @@
|
||||
include:
|
||||
- .db
|
||||
- .keystone
|
||||
- .server
|
||||
- .client
|
@ -1,23 +0,0 @@
|
||||
keystone_glance_user:
|
||||
keystone.user_present:
|
||||
- name: glance
|
||||
- password: {{ salt['pillar.get']('glance:keystone:password') }}
|
||||
- email: {{ salt['pillar.get']('glance:keystone:email') }}
|
||||
- tenant: service
|
||||
- enable: True
|
||||
- roles:
|
||||
- service:
|
||||
- admin
|
||||
|
||||
keystone_glance_service:
|
||||
keystone.service_present:
|
||||
- name: glance
|
||||
- service_type: image
|
||||
- description: Openstack Image Service
|
||||
|
||||
keystone_glance_endpoint:
|
||||
keystone.endpoint_present:
|
||||
- name: glance
|
||||
- publicurl: http://{{ salt["pillar.get"]("glance:public_ip") }}:9292
|
||||
- internalurl: http://{{ salt["pillar.get"]("glance:internal_ip") }}:9292
|
||||
- adminurl: http://{{ salt["pillar.get"]("glance:admin_ip") }}:9292
|
146
glance/map.jinja
146
glance/map.jinja
@ -1,146 +0,0 @@
|
||||
{% set glance=salt["grains.filter_by"]({
|
||||
"Debian":{
|
||||
"name": "glance",
|
||||
"pkg": ['glance', 'glance-api', 'glance-registry', 'glance-common'],
|
||||
"service": ['glance-api', 'glance-registry'],
|
||||
"client_pkg": "python-glanceclient",
|
||||
},
|
||||
"RedHat":{
|
||||
"name": "glance",
|
||||
"pkg": ["openstack-glance"],
|
||||
"service": ['openstack-glance-api', 'openstack-glance-registry'],
|
||||
"client_pkg": "python-glanceclient",
|
||||
},
|
||||
"default":{
|
||||
"name": "glance",
|
||||
"pkg": ['glance', 'glance-api', 'glance-registry', 'glance-common'],
|
||||
"service": ['glance-api', 'glance-registry'],
|
||||
"client_pkg": "python-glanceclient",
|
||||
}
|
||||
},merge=salt["pillar.get"]("glance:lookup")) %}
|
||||
|
||||
# Set the glance-api default config
|
||||
{%- set glance_api_config = {
|
||||
"DEFAULT": {
|
||||
"debug": "false",
|
||||
"verbose": "false",
|
||||
"default_store": "file",
|
||||
"known_stores": "glance.store.filesystem.Store",
|
||||
"log_file": "/var/log/glance/api.log",
|
||||
"bind_host": "0.0.0.0",
|
||||
"bind_port": "9292",
|
||||
"registry_host": "0.0.0.0",
|
||||
"registry_port": "9191",
|
||||
"filesystem_store_datadir": "/var/lib/glance/images/",
|
||||
"image_cache_dir": "/var/lib/glance/image-cache/",
|
||||
|
||||
"rpc_backend": "rabbit",
|
||||
"notification_driver": "noop",
|
||||
},
|
||||
"database": {
|
||||
"connection": "mysql://glance:" + salt["pillar.get"]("glance:mysql:password") + "@" + salt["pillar.get"]("glance:mysql:ip","localhost") + "/glance?charset=utf8",
|
||||
},
|
||||
"keystone_authtoken": {
|
||||
"auth_host": salt["pillar.get"]("glance:keystone:host", "localhost"),
|
||||
"auth_port": "35357",
|
||||
"auth_protocol": "http",
|
||||
"admin_tenant_name": "service",
|
||||
"admin_user": "glance",
|
||||
"admin_password": salt["pillar.get"]("glance:keystone:password"),
|
||||
},
|
||||
"paste_deploy": {
|
||||
"flavor": "keystone+cachemanagement",
|
||||
}
|
||||
} %}
|
||||
|
||||
# Set the glance-registry default config
|
||||
{%- set glance_reg_config = {
|
||||
"DEFAULT": {
|
||||
"debug": "false",
|
||||
"verbose": "false",
|
||||
"bind_host": "0.0.0.0",
|
||||
"bind_port": "9191",
|
||||
"log_file": "/var/log/glance/registry.log",
|
||||
},
|
||||
"database": {
|
||||
"connection": "mysql://glance:" + salt["pillar.get"]("glance:mysql:password") + "@" + salt["pillar.get"]("glance:mysql:ip","localhost") + "/glance?charset=utf8",
|
||||
},
|
||||
"keystone_authtoken": {
|
||||
"auth_host": salt["pillar.get"]("glance:keystone:host", "localhost"),
|
||||
"auth_port": "35357",
|
||||
"auth_protocol": "http",
|
||||
"admin_tenant_name": "service",
|
||||
"admin_user": "glance",
|
||||
"admin_password": salt["pillar.get"]("glance:keystone:password"),
|
||||
},
|
||||
"paste_deploy": {
|
||||
"flavor": "keystone",
|
||||
}
|
||||
} %}
|
||||
|
||||
# Set the glance-cache default config
|
||||
{%- set glance_cache_config = {
|
||||
"DEFAULT": {
|
||||
"log_file": "/var/log/glance/image-cache.log",
|
||||
"image_cache_dir": "/var/lib/glance/image-cache/",
|
||||
"image_cache_stall_time": "86400",
|
||||
"image_cache_invalid_entry_grace_period": "3600",
|
||||
"image_cache_max_size": "10737418240",
|
||||
"registry_host": "0.0.0.0",
|
||||
"registry_port": "9191",
|
||||
"filesystem_store_datadir": "/var/lib/glance/images/",
|
||||
}
|
||||
} %}
|
||||
|
||||
# Set the glance-scrubber default config
|
||||
{%- set glance_scb_config = {
|
||||
"DEFAULT": {
|
||||
"log_file": "/var/log/glance/scrubber.log",
|
||||
"daemon": "False",
|
||||
"wakeup_time": "300",
|
||||
"scrubber_datadir": "/var/lib/glance/scrubber",
|
||||
"cleanup_scrubber": "False",
|
||||
"cleanup_scrubber_time": "86400",
|
||||
"registry_host": "0.0.0.0",
|
||||
"registry_port": "9191",
|
||||
}
|
||||
} %}
|
||||
|
||||
{% if salt["pillar.get"]("glance:api-config") %}
|
||||
{% for section, value in salt["pillar.get"]("glance:api-config").iteritems() %}
|
||||
{% if not glance_api_config.has_key(section) %}
|
||||
{% do glance_api_config.update({ section:{} }) %}
|
||||
{% endif %}
|
||||
{% do glance_api_config[section].update(value) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if salt["pillar.get"]("glance:reg-config") %}
|
||||
{% for section, value in salt["pillar.get"]("glance:reg-config").iteritems() %}
|
||||
{% if not glance_reg_config.has_key(section) %}
|
||||
{% do glance_reg_config.update({ section:{} }) %}
|
||||
{% endif %}
|
||||
{% do glance_reg_config[section].update(value) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if salt["pillar.get"]("glance:cache-config") %}
|
||||
{% for section, value in salt["pillar.get"]("glance:cache-config").iteritems() %}
|
||||
{% if not glance_cache_config.has_key(section) %}
|
||||
{% do glance_cache_config.update({ section:{} }) %}
|
||||
{% endif %}
|
||||
{% do glance_cache_config[section].update(value) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if salt["pillar.get"]("glance:scb-config") %}
|
||||
{% for section, value in salt["pillar.get"]("glance:scb-config").iteritems() %}
|
||||
{% if not glance_scb_config.has_key(section) %}
|
||||
{% do glance_scb_config.update({ section:{} }) %}
|
||||
{% endif %}
|
||||
{% do glance_scb_config[section].update(value) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{#- vim:ft=sls
|
||||
-#}
|
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source /root/openrc
|
||||
|
||||
IMAGE_ID=$(glance image-list 2>/dev/null | awk '/cirros/{print $2}')
|
||||
IMAGE_NAME="cirros"
|
||||
if [ "x$IMAGE_ID" != "x" ]; then
|
||||
echo
|
||||
echo "changed=no comment='Image cirros in already exist'"
|
||||
else
|
||||
wget -c -q http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img -O /tmp/cirros-0.3.1-x86_64-disk.img
|
||||
glance image-create --name $IMAGE_NAME --file /tmp/cirros-0.3.1-x86_64-disk.img \
|
||||
--disk-format qcow2 --container-format bare --checksum d972013792949d0d3ba628fbe8685bce \
|
||||
--is-public True
|
||||
echo
|
||||
echo "changed=yes comment='Image cirros has been created'"
|
||||
fi
|
@ -1,45 +0,0 @@
|
||||
{%- from "glance/map.jinja" import glance with context %}
|
||||
include:
|
||||
- .db
|
||||
- .keystone
|
||||
|
||||
{{ glance.name }}:
|
||||
pkg.installed:
|
||||
- refresh: False
|
||||
- pkgs: {{ glance.pkg }}
|
||||
service.running:
|
||||
- names: {{ glance.service }}
|
||||
- enable: True
|
||||
- require:
|
||||
- pkg: {{ glance.name }}
|
||||
|
||||
{% for filename in ["glance-api.conf",
|
||||
"glance-cache.conf",
|
||||
"glance-registry.conf",
|
||||
"glance-scrubber.conf"] %}
|
||||
/etc/glance/{{ filename }}:
|
||||
file.managed:
|
||||
- source: salt://glance/files/{{ filename }}
|
||||
- template: jinja
|
||||
- require_in:
|
||||
- service: {{ glance.name }}
|
||||
- cmd: {{ glance.name }}_sync_db
|
||||
- cmd: glance-init-images
|
||||
- watch_in:
|
||||
- service: {{ glance.name }}
|
||||
{% endfor %}
|
||||
|
||||
{{ glance.name }}_sync_db:
|
||||
cmd.run:
|
||||
- name: glance-manage db_sync
|
||||
- require:
|
||||
- mysql_database: {{ glance.name }}-db
|
||||
- mysql_user: {{ glance.name }}-db
|
||||
- mysql_grants: {{ glance.name }}-db
|
||||
|
||||
glance-init-images:
|
||||
cmd.script:
|
||||
- name: salt://glance/scripts/glance-init.sh
|
||||
- stateful: True
|
||||
- require:
|
||||
- service: {{ glance.name }}
|
@ -1,22 +0,0 @@
|
||||
glance:
|
||||
public_ip: 10.0.0.12
|
||||
internal_ip: 10.0.0.12
|
||||
admin_ip: 10.0.0.12
|
||||
mysql:
|
||||
ip: 10.0.0.12
|
||||
password: 'pass'
|
||||
keystone:
|
||||
host: 10.0.0.12
|
||||
password: 'pass'
|
||||
email: '123@123.com'
|
||||
api-config:
|
||||
DEFAULT:
|
||||
debug: False
|
||||
verbose: False
|
||||
reg-config:
|
||||
DEFAULT:
|
||||
debug: False
|
||||
verbose: False
|
||||
|
||||
{#- vim:ft=sls
|
||||
-#}
|
Loading…
x
Reference in New Issue
Block a user