aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/ceph/tasks/bootstrap_mons.yml18
-rw-r--r--ansible/roles/ceph/tasks/bootstrap_osds.yml84
-rw-r--r--ansible/roles/ceph/tasks/generate_cluster.yml28
-rw-r--r--ansible/roles/ceph/tasks/start_mons.yml21
-rw-r--r--ansible/roles/ceph/tasks/start_osds.yml32
-rw-r--r--ansible/roles/ceph/tasks/start_rgws.yml18
6 files changed, 57 insertions, 144 deletions
diff --git a/ansible/roles/ceph/tasks/bootstrap_mons.yml b/ansible/roles/ceph/tasks/bootstrap_mons.yml
index 5e0ff61fe..b702ae945 100644
--- a/ansible/roles/ceph/tasks/bootstrap_mons.yml
+++ b/ansible/roles/ceph/tasks/bootstrap_mons.yml
@@ -35,20 +35,12 @@
always_run: True
run_once: True
-- name: Starting Ceph Monitor data container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: ceph_mon_data
+- name: Starting ceph-mon-data container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ ceph_data_image_full }}"
+ name: "ceph_mon_data"
volumes:
- "/etc/ceph/"
- "/var/lib/ceph/"
diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml
index 8a0158d7d..20b5bdaac 100644
--- a/ansible/roles/ceph/tasks/bootstrap_osds.yml
+++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml
@@ -24,82 +24,40 @@
osds_cache_bootstrap: "{{ (osd_cache_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
- name: Bootstrapping Ceph OSDs
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "no"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- privileged: True
- name: "bootstrap_osd_{{ item.0 }}"
- image: "{{ ceph_osd_image_full }}"
- volumes:
- - "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
- - "/dev/:/dev/"
- env:
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ detach: False
+ environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
- with_indexed_items: osds_bootstrap|default([])
-
-# https://github.com/ansible/ansible-modules-core/pull/1031
-- name: Waiting for bootstrap containers to exit
- command: docker wait "bootstrap_osd_{{ item.0 }}"
- register: bootstrap_result
- run_once: True
- failed_when: bootstrap_result.stdout != "0"
- with_indexed_items: osds_bootstrap|default([])
-
-- name: Cleaning up bootstrap containers
- docker:
- tty: True
- name: "bootstrap_osd_{{ item.0 }}"
image: "{{ ceph_osd_image_full }}"
- state: absent
- with_indexed_items: osds_bootstrap|default([])
-
-- name: Bootstrapping Ceph Cache OSDs
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "no"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
+ name: "bootstrap_osd_{{ item.0 }}"
privileged: True
- name: "bootstrap_osd_cache_{{ item.0 }}"
- image: "{{ ceph_osd_image_full }}"
+ restart_policy: "never"
volumes:
- "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
- "/dev/:/dev/"
- env:
+ with_indexed_items: osds_bootstrap|default([])
+
+- name: Bootstrapping Ceph Cache OSDs
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ detach: False
+ environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
CEPH_CACHE:
OSD_DEV: "{{ item.1.device }}"
OSD_INITIAL_WEIGHT: "{{ osd_initial_weight }}"
- with_indexed_items: osds_cache_bootstrap|default([])
-
-# https://github.com/ansible/ansible-modules-core/pull/1031
-- name: Waiting for bootstrap containers to exit
- command: docker wait "bootstrap_osd_cache_{{ item.0 }}"
- register: bootstrap_result
- run_once: True
- failed_when: bootstrap_result.stdout != "0"
- with_indexed_items: osds_cache_bootstrap|default([])
-
-- name: Cleaning up bootstrap containers
- docker:
- tty: True
- name: "bootstrap_osd_cache_{{ item.0 }}"
image: "{{ ceph_osd_image_full }}"
- state: absent
+ name: "bootstrap_osd_cache_{{ item.0 }}"
+ privileged: True
+ restart_policy: "never"
+ volumes:
+ - "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
+ - "/dev/:/dev/"
with_indexed_items: osds_cache_bootstrap|default([])
diff --git a/ansible/roles/ceph/tasks/generate_cluster.yml b/ansible/roles/ceph/tasks/generate_cluster.yml
index 778893541..f53a70973 100644
--- a/ansible/roles/ceph/tasks/generate_cluster.yml
+++ b/ansible/roles/ceph/tasks/generate_cluster.yml
@@ -1,25 +1,17 @@
---
-- name: Generating Initial Ceph keyrings and monmap
- docker:
- tty: True
- detach: False
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "no"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: ceph_mon
- image: "{{ ceph_mon_image_full }}"
- volumes: "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
- volumes_from:
- - "ceph_mon_data"
- env:
+- name: Generating initial Ceph keyrings and monmap
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ environment:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
MON_IP: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
+ image: "{{ ceph_mon_image_full }}"
+ name: "ceph_mon"
+ restart_policy: "never"
+ volumes: "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
+ volumes_from: "ceph_mon_data"
- name: Waiting for a few settings for cluster to generate keys
command: sleep 3
diff --git a/ansible/roles/ceph/tasks/start_mons.yml b/ansible/roles/ceph/tasks/start_mons.yml
index a9288ca87..9016e2ce6 100644
--- a/ansible/roles/ceph/tasks/start_mons.yml
+++ b/ansible/roles/ceph/tasks/start_mons.yml
@@ -1,21 +1,10 @@
---
- name: Starting ceph-mon container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: ceph_mon
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ ceph_mon_image_full }}"
+ name: "ceph_mon"
volumes: "{{ node_config_directory }}/ceph-mon/:{{ container_config_directory }}/:ro"
- volumes_from:
- - "ceph_mon_data"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ volumes_from: "ceph_mon_data"
when: inventory_hostname in groups['ceph-mon']
diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml
index ab7bd35dd..e91e90ea1 100644
--- a/ansible/roles/ceph/tasks/start_osds.yml
+++ b/ansible/roles/ceph/tasks/start_osds.yml
@@ -26,30 +26,22 @@
changed_when: False
failed_when: id.rc != 0
-- name: Starting ceph-osds container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- pid: host
- privileged: True
- name: "ceph_osd_{{ item.0.stdout }}"
+- name: Starting ceph-osd container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ environment:
+ KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
+ OSD_ID: "{{ item.0.stdout }}"
+ OSD_DEV: "{{ item.1['device'] }}"
image: "{{ ceph_osd_image_full }}"
+ name: "ceph_osd_{{ item.0.stdout }}"
+ pid: "host"
+ privileged: True
volumes:
- - "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"
- "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
- "/dev/:/dev/"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- OSD_ID: "{{ item.0.stdout }}"
- OSD_DEV: "{{ item.1['device'] }}"
+ - "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"
with_together:
- id.results
- osds
diff --git a/ansible/roles/ceph/tasks/start_rgws.yml b/ansible/roles/ceph/tasks/start_rgws.yml
index 68d5516ba..4de1e8afd 100644
--- a/ansible/roles/ceph/tasks/start_rgws.yml
+++ b/ansible/roles/ceph/tasks/start_rgws.yml
@@ -1,19 +1,9 @@
---
- name: Starting ceph-rgw container
- docker:
- tty: True
- net: host
- pull: "{{ docker_pull_policy }}"
- restart_policy: "{{ docker_restart_policy }}"
- restart_policy_retry: "{{ docker_restart_policy_retry }}"
- state: reloaded
- registry: "{{ docker_registry }}"
- username: "{{ docker_registry_username }}"
- password: "{{ docker_registry_password }}"
- insecure_registry: "{{ docker_insecure_registry }}"
- name: ceph_rgw
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
image: "{{ ceph_rgw_image_full }}"
+ name: "ceph_rgw"
volumes: "{{ node_config_directory }}/ceph-rgw/:{{ container_config_directory }}/:ro"
- env:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['ceph-rgw']