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
f7066db4
Commit
f7066db4
authored
9 years ago
by
Jeffrey Zhang
Browse files
Options
Downloads
Patches
Plain Diff
Fix the Ceph reconfigure
Closes-Bug: #1563251 Change-Id: I0072c92d6c8160f868b4ab0ec08b11541d3f3401
parent
90321d04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ansible/roles/ceph/tasks/do_reconfigure.yml
+127
-58
127 additions, 58 deletions
ansible/roles/ceph/tasks/do_reconfigure.yml
with
127 additions
and
58 deletions
ansible/roles/ceph/tasks/do_reconfigure.yml
+
127
−
58
View file @
f7066db4
---
-
name
:
Ensuring the c
ontainers ceph_mon and ceph_rgw are
up
-
name
:
Ensuring the c
eph_mon container is
up
kolla_docker
:
name
:
"
{{
item.name
}}"
action
:
"
get_container_state"
register
:
container_state
register
:
ceph_mon_
container_state
failed_when
:
container_state.Running ==
false
when
:
inventory_hostname in groups[item.group]
with_items
:
-
{
name
:
ceph_mon
,
group
:
ceph-mon
}
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
-
name
:
Looking up OSDs for Ceph
command
:
docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m find_disks
-a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix'"
register
:
osd_lookup
changed_when
:
"
{{
osd_lookup.stdout.find('localhost
|
SUCCESS
=>
')
!=
-1
and
(osd_lookup.stdout.split('localhost
|
SUCCESS
=>
')[1]|from_json).changed
}}"
failed_when
:
osd_lookup.stdout.split()[2] != 'SUCCESS'
when
:
inventory_hostname in groups['ceph-osd']
-
name
:
Reading data from variable
set_fact
:
osds
:
"
{{
(osd_lookup.stdout.split('localhost
|
SUCCESS
=>
')[1]|from_json).disks|from_json
}}"
when
:
inventory_hostname in groups['ceph-osd']
-
name
:
Gathering OSD IDs
command
:
"
cat
/var/lib/ceph/osd/{{
item['fs_uuid']
}}/whoami"
with_items
:
osds
register
:
id
register
:
osd_
id
s
changed_when
:
False
failed_when
:
id.rc !=
0
failed_when
:
osd_ids.rc !=
0
when
:
inventory_hostname in groups['ceph-osd']
-
name
:
Ensuring the ceph_osd container is up
kolla_docker
:
name
:
"
ceph_osd_{{
item.0.stdout
}}"
name
:
"
ceph_osd_{{
item.stdout
}}"
action
:
"
get_container_state"
register
:
ceph_osd_container_state
failed_when
:
ceph_osd_container_state.Running ==
false
when
:
inventory_hostname in groups['ceph-osd']
with_items
:
osd_ids.results
-
name
:
Ensuring the ceph_rgw container is up
kolla_docker
:
name
:
"
{{
item.name
}}"
action
:
"
get_container_state"
register
:
container_state
register
:
ceph_rgw_
container_state
failed_when
:
container_state.Running ==
false
with_together
:
-
id.results
-
osds
when
:
osds
when
:
-
enable_ceph_rgw | bool
-
inventory_hostname in groups[item.group]
with_items
:
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
-
include
:
config.yml
-
name
:
Check the configs in ceph_mon
and ceph_rgw
container
s
-
name
:
Check the configs in ceph_mon container
command
:
docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check
changed_when
:
false
failed_when
:
false
register
:
check_results
register
:
ceph_mon_
check_results
when
:
inventory_hostname in groups[item.group]
with_items
:
-
{
name
:
ceph_mon
,
group
:
ceph-mon
}
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
-
name
:
Check the configs in the ceph_osd container
command
:
docker exec ceph_osd_{{ item.
0.
stdout }} /usr/local/bin/kolla_set_configs --check
command
:
docker exec ceph_osd_{{ item.stdout }} /usr/local/bin/kolla_set_configs --check
changed_when
:
false
failed_when
:
false
with_together
:
-
id.results
-
osds
when
:
osds
register
:
ceph_osd_check_results
with_items
:
osd_ids.results
when
:
inventory_hostname in groups['ceph-osd']
-
name
:
Check the configs in ceph_rgw container
command
:
docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check
changed_when
:
false
failed_when
:
false
register
:
ceph_rgw_check_results
when
:
-
inventory_hostname in groups[item.group]
-
enable_ceph_rgw | bool
with_items
:
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
# just remove the container and start again
-
name
:
Containers config strategy for ceph_mon and ceph_rgw containers
-
name
:
Containers config strategy for ceph_mon container
kolla_docker
:
name
:
"
{{
item.name
}}"
action
:
"
get_container_env"
register
:
container_envs
register
:
ceph_mon_
container_envs
when
:
inventory_hostname in groups[item.group]
with_items
:
-
{
name
:
ceph_mon
,
group
:
ceph-mon
}
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
-
name
:
Containers config strategy for the ceph_osd container
-
name
:
Containers config strategy for the ceph_osd container
s
kolla_docker
:
name
:
"
ceph_osd_{{
item.
0.
stdout
}}"
name
:
"
ceph_osd_{{
item.stdout
}}"
action
:
"
get_container_env"
with_together
:
-
id.results
register
:
ceph_osd_container_envs
with_items
:
osd_ids.results
when
:
-
inventory_hostname in groups['ceph-osd']
-
osds
when
:
osds
-
name
:
Remove the ceph_mon and ceph_rgw containers
-
name
:
Containers config strategy for ceph_rgw container
kolla_docker
:
name
:
"
{{
item.name
}}"
action
:
"
get_container_env"
register
:
ceph_rgw_container_envs
when
:
-
inventory_hostname in groups[item.group]
-
enable_ceph_rgw | bool
with_items
:
-
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}
-
name
:
Remove the ceph_mon container
kolla_docker
:
name
:
"
{{
item[0]['name']
}}"
action
:
"
remove_container"
register
:
remove_container
s
register
:
remove_
ceph_mon_
container
when
:
-
inventory_hostname in groups[item[0]['group']]
-
config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
-
item[2]['rc'] ==
1
-
inventory_hostname in groups[item[0]['group']]
with_together
:
-
[{
name
:
ceph_mon
,
group
:
ceph-mon
},
{
name
:
ceph_rgw
,
group
:
ceph-rgw
}]
-
container_envs.results
-
check_results.results
-
[{
name
:
ceph_mon
,
group
:
ceph-mon
}]
-
ceph_mon_container_envs.results
-
ceph_mon_check_results.results
-
name
:
Remove the ceph_osd container
-
name
:
Remove the ceph_osd container
s
kolla_docker
:
name
:
"
ceph_osd_{{
item.0.stdout
}}"
action
:
"
remove_container"
register
:
remove_ceph_osd_containers
when
:
-
config_strategy == "COPY_ONCE" or item[2]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
-
item[3]['rc'] ==
1
-
inventory_hostname in groups['ceph-osd']
-
config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
-
item[2]['rc'] ==
1
-
osds
with_together
:
-
id.results
-
osds
-
container_envs.results
-
check_results.results
-
osd_ids.results
-
ceph_osd_container_envs.results
-
ceph_osd_check_results.results
-
name
:
Remove the ceph_rgw container
kolla_docker
:
name
:
"
{{
item[0]['name']
}}"
action
:
"
remove_container"
register
:
remove_ceph_rgw_container
when
:
-
enable_ceph_rgw | bool
-
inventory_hostname in groups[item[0]['group']]
-
config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
-
item[2]['rc'] ==
1
with_together
:
-
[{
name
:
ceph_rgw
,
group
:
ceph-rgw
}]
-
ceph_rgw_container_envs.results
-
ceph_rgw_check_results.results
-
include
:
start_mons.yml
when
:
-
inventory_hostname in groups['ceph-mon']
-
remove_ceph_mon_container.changed
-
include
:
deploy.yml
when
:
remove_containers.changed
-
include
:
start_osds.yml
when
:
-
inventory_hostname in groups['ceph-osd']
-
remove_ceph_osd_containers.changed
-
include
:
start_rgws.yml
when
:
-
inventory_hostname in groups['ceph-rgw']
-
remove_ceph_rgw_container.changed
-
name
:
Restart the ceph_mon container
kolla_docker
:
name
:
"
ceph_mon"
action
:
"
restart_container"
when
:
-
inventory_hostname in groups['ceph-mon']
-
config_strategy == 'COPY_ALWAYS'
-
item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
-
item[1]['rc'] ==
1
-
inventory_hostname in groups['ceph-mon']
with_together
:
-
container_envs.results
-
check_results.results
-
ceph_mon_
container_envs.results
-
ceph_mon_
check_results.results
-
name
:
Restart the ceph_osd container
kolla_docker
:
name
:
"
ceph_osd_{{
item.0.stdout
}}"
action
:
"
restart_container"
when
:
-
inventory_hostname in groups['ceph-osd']
-
config_strategy == 'COPY_ALWAYS'
-
item[
2
]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
-
item[
3
]['rc'] ==
1
-
item[
1
]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
-
item[
2
]['rc'] ==
1
-
osds
with_together
:
-
id.results
-
osds
-
container_envs.results
-
check_results.results
-
osd_ids.results
-
ceph_osd_container_envs.results
-
ceph_osd_check_results.results
-
name
:
Restart the ceph_rgw container
kolla_docker
:
name
:
"
ceph_rgw"
action
:
"
restart_container"
when
:
-
enable_ceph_rgw | bool
-
inventory_hostname in groups['ceph-rgw']
-
config_strategy == 'COPY_ALWAYS'
-
item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
-
item[1]['rc'] ==
1
-
inventory_hostname in groups['ceph-rgw']
with_together
:
-
container_envs.results
-
check_results.results
-
ceph_rgw_
container_envs.results
-
ceph_rgw_
check_results.results
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