Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
b3ef0219
Commit
b3ef0219
authored
8 years ago
by
Jenkins
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Allow flexibility in mysql backend for ceilometer"
parents
1f01ef37
ce897888
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/ceilometer/defaults/main.yml
+3
-2
3 additions, 2 deletions
ansible/roles/ceilometer/defaults/main.yml
ansible/roles/ceilometer/tasks/bootstrap.yml
+21
-3
21 additions, 3 deletions
ansible/roles/ceilometer/tasks/bootstrap.yml
with
24 additions
and
5 deletions
ansible/roles/ceilometer/defaults/main.yml
+
3
−
2
View file @
b3ef0219
...
...
@@ -7,9 +7,10 @@ project_name: "ceilometer"
####################
ceilometer_database_name
:
"
ceilometer"
ceilometer_database_user
:
"
ceilometer"
ceilometer_database_port
:
"
{{
mondodb_port
if
ceilometer_database_type
==
'mongodb'
else
database_port
}}"
ceilometer_database_mongodb_address
:
"
{%
for
host
in
groups['mongodb']
%}{{
hostvars[host]['ansible_'
+
hostvars[host]['api_interface']]['ipv4']['address']
}}:{{
mongodb
_port
}}{%
if
not
loop.last
%},{%
endif
%}{%
endfor
%}"
ceilometer_database_mysql_address
:
"
{{
kolla_internal_fqdn
}}:{{
database_port
}}"
ceilometer_database_mongodb_address
:
"
{%
for
host
in
groups['mongodb']
%}{{
hostvars[host]['ansible_'
+
hostvars[host]['api_interface']]['ipv4']['address']
}}:{{
ceilometer_database
_port
}}{%
if
not
loop.last
%},{%
endif
%}{%
endfor
%}"
ceilometer_database_mysql_address
:
"
{{
kolla_internal_fqdn
}}:{{
ceilometer_
database_port
}}"
####################
...
...
This diff is collapsed.
Click to expand it.
ansible/roles/ceilometer/tasks/bootstrap.yml
+
21
−
3
View file @
b3ef0219
...
...
@@ -10,11 +10,26 @@
when
:
-
ceilometer_database_type == "mongodb"
-
name
:
Checking Ceilometer mysql database
command
:
docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ ceilometer_database_mysql_address }}'
login_port='{{ ceilometer_database_port }}'
login_user='{{ ceilometer_database_user }}'
login_password='{{ ceilometer_database_password }}'
name='{{ ceilometer_database_name }}'"
register
:
mysql_access
failed_when
:
False
changed_when
:
False
run_once
:
True
when
:
-
ceilometer_database_type == "mysql"
-
name
:
Creating Ceilometer mysql database
command
:
docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_db
-a "login_host='{{ ceilometer_database_mysql_address }}'
login_port='{{ database_port }}'
login_port='{{
ceilometer_
database_port }}'
login_user='{{ database_user }}'
login_password='{{ database_password }}'
name='{{ ceilometer_database_name }}'"
...
...
@@ -26,12 +41,13 @@
delegate_to
:
"
{{
groups['ceilometer-api'][0]
}}"
when
:
-
ceilometer_database_type == "mysql"
-
"
'FAILED'
in
mysql_access.stdout"
-
name
:
Creating Ceilometer database user and setting permissions
command
:
docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m mysql_user
-a "login_host='{{ ceilometer_database_mysql_address }}'
login_port='{{ database_port }}'
login_port='{{
ceilometer_
database_port }}'
login_user='{{ database_user }}'
login_password='{{ database_password }}'
name='{{ ceilometer_database_name }}'
...
...
@@ -47,9 +63,11 @@
delegate_to
:
"
{{
groups['ceilometer-api'][0]
}}"
when
:
-
ceilometer_database_type == "mysql"
-
"
'FAILED'
in
mysql_access.stdout"
# TODO(Jeffrey4l): fix idempotent when ceilomter_database_type == "gnocchi"
# NOTE(vbel): bootstrapping of mysql db for ceilometer is idempotent
-
include
:
bootstrap_service.yml
when
:
((ceilometer_database_type == "mongodb" and mongodb_ceilometer_database.changed)
or
(
ceilometer_database_type == "mysql"
and mysql_ceilometer_database.changed)
or ceilometer_database_type == "mysql"
or ceilometer_database_type == "gnocchi")
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment