Fuel CCP - Glance deployment
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
3.6KB

  1. dsl_version: 0.4.0
  2. service:
  3. name: glance-api
  4. ports:
  5. - {{ glance.api_port }}
  6. annotations:
  7. service:
  8. prometheus.io/probe: "true"
  9. prometheus.io/probe_path: "/healthcheck"
  10. containers:
  11. - name: glance-api
  12. image: glance-api
  13. pre:
  14. - name: glance-db-create
  15. dependencies:
  16. - {{ service.database }}
  17. type: single
  18. command:
  19. mysql -u root -p{{ db.root_password }} -h {{ address(service.database) }} -e "create database {{ glance.db.name }};
  20. create user '{{ glance.db.username }}'@'%' identified by '{{ glance.db.password }}'
  21. {% if percona.tls.enabled %} require ssl {% endif %};
  22. grant all privileges on {{ glance.db.name }}.* to '{{ glance.db.username }}'@'%' identified by '{{ glance.db.password }}'
  23. {% if percona.tls.enabled %} require ssl {% endif %};"
  24. - name: glance-db-sync
  25. files:
  26. - glance-api
  27. dependencies:
  28. - glance-db-create
  29. type: single
  30. command: glance-manage db_sync
  31. - name: glance-user-create
  32. dependencies:
  33. - keystone-create-domain
  34. type: single
  35. command: openstack user create --domain {{ service_account.domain }} --password {{ glance.password }} {{ glance.user }}
  36. - name: glance-role-add
  37. dependencies:
  38. - glance-user-create
  39. type: single
  40. command: openstack role add --project {{ service_account.project }} --user {{ glance.user }} admin
  41. - name: glance-service-create
  42. dependencies:
  43. - keystone
  44. type: single
  45. command: openstack service create --name glance --description "OpenStack Image service" image
  46. - name: glance-public-endpoint-create
  47. dependencies:
  48. - glance-service-create
  49. type: single
  50. command: openstack endpoint create --region RegionOne image public {{ address('glance-api', glance.api_port, external=True, with_scheme=True) }}
  51. - name: glance-internal-endpoint-create
  52. dependencies:
  53. - glance-service-create
  54. type: single
  55. command: openstack endpoint create --region RegionOne image internal {{ address('glance-api', glance.api_port, with_scheme=True) }}
  56. - name: glance-admin-endpoint-create
  57. dependencies:
  58. - glance-service-create
  59. type: single
  60. command: openstack endpoint create --region RegionOne image admin {{ address('glance-api', glance.api_port, with_scheme=True) }}
  61. daemon:
  62. files:
  63. - glance-api
  64. # {% if glance.ceph.enable %}
  65. - ceph-conf
  66. - glance-ceph-key
  67. # {% endif %}
  68. # {% if glance.swift.enable %}
  69. - glance-swift-conf
  70. # {% endif %}
  71. command: glance-api
  72. # {% if glance.bootstrap.enable %}
  73. post:
  74. - name: glance-cirros-image-upload
  75. type: single
  76. command: /opt/ccp/bin/glance-cirros-image-upload.sh
  77. files:
  78. - glance-cirros-image-upload.sh
  79. # {% endif %}
  80. files:
  81. glance-api:
  82. path: /etc/glance/glance-api.conf
  83. content: glance-api.conf.j2
  84. ceph-conf:
  85. path: /etc/ceph/ceph.conf
  86. content: ceph.conf.j2
  87. glance-ceph-key:
  88. path: /etc/ceph/ceph.client.{{ glance.ceph.username }}.keyring
  89. content: ceph.client.glance.keyring.j2
  90. glance-swift-conf:
  91. path: /etc/glance/glance-swift-store.conf
  92. content: glance-swift-store.conf.j2
  93. glance-cirros-image-upload.sh:
  94. path: /opt/ccp/bin/glance-cirros-image-upload.sh
  95. content: glance-cirros-image-upload.sh.j2
  96. perm: "500"