From c2f1dca8236e758d0f28967d444bc7818eecbc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 9 Feb 2017 15:16:39 +0100 Subject: [PATCH] docker: use a better method to pull images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We changed the way we declare image. Prior to this patch we must have a "user/image:tag" format, which is incompatible with non docker-hub registry where you usually don't have a "user". On the docker hub a "user" is also identified as a namespace, so for Ceph the user was "ceph". Variables have been simplified with only: * ceph_docker_image * ceph_docker_image_tag 1. For docker hub images: ceph_docker_name: "ceph/daemon" will give you the 'daemon' image of the 'ceph' user. 2. For non docker hub images: ceph_docker_name: "daemon" will simply give you the "daemon" image. Infrastructure playbooks have been modified as well. The file group_vars/all.docker.yml.sample has been removed as well. It is hard to maintain since we have to generate it manually. If you want to configure specific variables for a specific daemon simply edit group_vars/$DAEMON.yml Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1420207 Signed-off-by: Sébastien Han --- group_vars/all.docker.yml.sample | 108 ------------------ group_vars/all.yml.sample | 2 + group_vars/mdss.yml.sample | 5 +- group_vars/mons.yml.sample | 5 +- group_vars/nfss.yml.sample | 5 +- group_vars/osds.yml.sample | 5 +- group_vars/rbd-mirrors.yml.sample | 5 +- group_vars/restapis.yml.sample | 5 +- group_vars/rgws.yml.sample | 5 +- .../purge-docker-cluster.yml | 48 ++++---- ...inerized-to-containerized-ceph-daemons.yml | 60 +++++----- roles/ceph-common/defaults/main.yml | 2 + .../ceph-common/tasks/docker/fetch_image.yml | 4 +- roles/ceph-mds/defaults/main.yml | 5 +- roles/ceph-mds/tasks/docker/main.yml | 6 +- roles/ceph-mds/templates/ceph-mds.service.j2 | 2 +- roles/ceph-mon/defaults/main.yml | 5 +- roles/ceph-mon/tasks/docker/main.yml | 6 +- roles/ceph-mon/tasks/docker/pre_requisite.yml | 2 +- .../tasks/docker/start_docker_monitor.yml | 6 +- roles/ceph-mon/templates/ceph-mon.service.j2 | 2 +- roles/ceph-nfs/defaults/main.yml | 5 +- .../ceph-nfs/tasks/docker/create_configs.yml | 2 +- roles/ceph-nfs/tasks/docker/main.yml | 6 +- roles/ceph-nfs/templates/ceph-nfs.service.j2 | 2 +- roles/ceph-osd/defaults/main.yml | 5 +- roles/ceph-osd/tasks/docker/main.yml | 6 +- roles/ceph-osd/tasks/docker/pre_requisite.yml | 2 +- .../tasks/docker/start_docker_osd.yml | 4 +- roles/ceph-osd/templates/ceph-osd.service.j2 | 2 +- roles/ceph-rbd-mirror/defaults/main.yml | 5 +- roles/ceph-rbd-mirror/tasks/docker/main.yml | 6 +- .../templates/ceph-rbd-mirror.service.j2 | 2 +- roles/ceph-restapi/defaults/main.yml | 5 +- roles/ceph-restapi/tasks/docker/main.yml | 4 - .../tasks/docker/start_docker_restapi.yml | 2 +- roles/ceph-rgw/defaults/main.yml | 5 +- roles/ceph-rgw/tasks/docker/main.yml | 6 +- roles/ceph-rgw/templates/ceph-rgw.service.j2 | 2 +- 39 files changed, 109 insertions(+), 255 deletions(-) delete mode 100644 group_vars/all.docker.yml.sample diff --git a/group_vars/all.docker.yml.sample b/group_vars/all.docker.yml.sample deleted file mode 100644 index 9752f04ef..000000000 --- a/group_vars/all.docker.yml.sample +++ /dev/null @@ -1,108 +0,0 @@ ---- -dummy: - -########## -# GLOBAL # -########## -#docker: true -#ceph_docker_dev_image: false -#ceph_docker_registry: docker.io - -####### -# MON # -####### -#mon_containerized_deployment: true -#mon_containerized_deployment_with_kv: false -#mon_containerized_default_ceph_conf_with_kv: true -#kv_type: etcd -#kv_endpoint: 127.0.0.1 -#kv_port: 4001 -#mon_docker_privileged: true -#ceph_mon_docker_username: ceph -#ceph_mon_docker_imagename: daemon -#ceph_mon_docker_image_tag: latest -#ceph_mon_docker_interface: "{{ monitor_interface }}" -#ceph_mon_docker_subnet: "{{ public_network }}" # subnet of the ceph_mon_docker_interface -#ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ ansible_hostname }} - -####### -# OSD # -####### -#osd_containerized_deployment: true -#osd_containerized_deployment_with_kv: false -#kv_type: etcd -#kv_endpoint: 127.0.0.1 -#ceph_osd_docker_username: ceph -#ceph_osd_docker_imagename: daemon -#ceph_osd_docker_image_tag: latest -#ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE -e OSD_JOURNAL_SIZE={{ journal_size }} -#ceph_osd_docker_prepare_env: "OSD_FORCE_ZAP=1" # comma separated variables -#ceph_osd_docker_devices: -# - /dev/sdb -# - /dev/sdc -#journal_size: 5120 # OSD journal size in MB -#public_network: 0.0.0.0/0 -#cluster_network: "{{ public_network }}" - -####### -# MDS # -####### -#mds_containerized_deployment: true -#mds_containerized_deployment_with_kv: false -#kv_type: etcd -#kv_endpoint: 127.0.0.1 -#ceph_mds_docker_username: ceph -#ceph_mds_docker_imagename: daemon -#ceph_mds_docker_image_tag: latest -#ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }} - -####### -# RGW # -####### -#rgw_containerized_deployment: true -#rgw_containerized_deployment_with_kv: false -#kv_type: etcd -#kv_endpoint: 127.0.0.1 -#ceph_rgw_docker_username: ceph -#ceph_rgw_docker_imagename: daemon -#ceph_rgw_docker_image_tag: latest -#ceph_rgw_civetweb_port: 80 -#ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }} - -########### -# RESTAPI # -########### -#restapi_containerized_deployment: true -#ceph_restapi_docker_interface: eth0 -#ceph_restapi_port: 5000 -#ceph_restapi_docker_username: ceph -#ceph_restapi_docker_imagename: daemon -#ceph_restapi_docker_image_tag: latest -#ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables - - -############## -# RBD MIRROR # -############## -#rbd_mirror_containerized_deployment: true -#rbd_mirror_containerized_deployment_with_kv: false -#kv_type: etcd -#kv_endpoint: 127.0.0.1 -#ceph_rbd_mirror_docker_username: ceph -#ceph_rbd_mirror_docker_imagename: daemon -#ceph_rbd_mirror_docker_image_tag: latest -#ceph_docker_on_openstack: false - -####### -# NFS # -####### -#nfs_containerized_deployment: true -#nfs_containerized_deployment_with_kv: false -#ceph_nfs_docker_username: ceph -#ceph_nfs_docker_imagename: daemon -#ceph_nfs_docker_image_tag: latest -#ceph_nfs_docker_extra_env: -e GANESHA_EPOCH={{ ganesha_epoch }} -#nfs_file_gw: false -#nfs_obj_gw: false -#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY" -#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C" diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 375583adb..2cf51f8bb 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -393,6 +393,8 @@ dummy: ########## #docker: false +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest # Do not comment the following variables mon_containerized_deployment_* here. These variables are being used # by ceph.conf.j2 template. so it should always be defined diff --git a/group_vars/mdss.yml.sample b/group_vars/mdss.yml.sample index 6bf33c682..d49dfd256 100644 --- a/group_vars/mdss.yml.sample +++ b/group_vars/mdss.yml.sample @@ -32,9 +32,8 @@ dummy: #mds_containerized_deployment_with_kv: false #kv_type: etcd #kv_endpoint: 127.0.0.1 -#ceph_mds_docker_username: ceph -#ceph_mds_docker_imagename: daemon -#ceph_mds_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }} #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/mons.yml.sample b/group_vars/mons.yml.sample index 6470030f5..16bd40746 100644 --- a/group_vars/mons.yml.sample +++ b/group_vars/mons.yml.sample @@ -81,9 +81,8 @@ dummy: #mon_containerized_default_ceph_conf_with_kv: false #ceph_mon_docker_interface: "{{ monitor_interface }}" #ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface -#ceph_mon_docker_username: ceph -#ceph_mon_docker_imagename: daemon -#ceph_mon_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ ansible_hostname }} #ceph_docker_on_openstack: false #mon_docker_privileged: false diff --git a/group_vars/nfss.yml.sample b/group_vars/nfss.yml.sample index f1ef364d8..4433f6f9f 100644 --- a/group_vars/nfss.yml.sample +++ b/group_vars/nfss.yml.sample @@ -85,9 +85,8 @@ dummy: #nfs_containerized_deployment_with_kv: false #kv_type: etcd #kv_endpoint: 127.0.0.1 -#ceph_nfs_docker_username: ceph -#ceph_nfs_docker_imagename: ganesha -#ceph_nfs_docker_image_tag: latest +#ceph_docker_image: "ceph/ganesha" +#ceph_docker_image_tag: latest #ceph_nfs_docker_extra_env: -e GANESHA_EPOCH={{ ganesha_epoch }} #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/osds.yml.sample b/group_vars/osds.yml.sample index de472aa72..7ee4363f9 100644 --- a/group_vars/osds.yml.sample +++ b/group_vars/osds.yml.sample @@ -177,9 +177,8 @@ dummy: #kv_endpoint: 127.0.0.1 #kv_port: 4001 #ceph_osd_docker_prepare_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1 -#ceph_osd_docker_username: ceph -#ceph_osd_docker_imagename: daemon -#ceph_osd_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE -e OSD_JOURNAL_SIZE={{ journal_size }} #ceph_osd_docker_devices: "{{ devices }}" #ceph_docker_on_openstack: false diff --git a/group_vars/rbd-mirrors.yml.sample b/group_vars/rbd-mirrors.yml.sample index 15ab9cd02..22d1933d7 100644 --- a/group_vars/rbd-mirrors.yml.sample +++ b/group_vars/rbd-mirrors.yml.sample @@ -46,9 +46,8 @@ dummy: #rbd_mirror_containerized_deployment_with_kv: false #kv_type: etcd #kv_endpoint: 127.0.0.1 -#ceph_rbd_mirror_docker_username: ceph -#ceph_rbd_mirror_docker_imagename: daemon -#ceph_rbd_mirror_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/restapis.yml.sample b/group_vars/restapis.yml.sample index a4e01e753..425e56a1f 100644 --- a/group_vars/restapis.yml.sample +++ b/group_vars/restapis.yml.sample @@ -21,9 +21,8 @@ dummy: #restapi_containerized_deployment: false #ceph_restapi_docker_interface: eth0 #ceph_restapi_port: 5000 -#ceph_restapi_docker_username: ceph -#ceph_restapi_docker_imagename: daemon -#ceph_restapi_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME diff --git a/group_vars/rgws.yml.sample b/group_vars/rgws.yml.sample index d5b7acfcd..61152debc 100644 --- a/group_vars/rgws.yml.sample +++ b/group_vars/rgws.yml.sample @@ -43,9 +43,8 @@ dummy: #kv_type: etcd #kv_endpoint: 127.0.0.1 #ceph_rgw_civetweb_port: "{{ radosgw_civetweb_port }}" -#ceph_rgw_docker_username: ceph -#ceph_rgw_docker_imagename: daemon -#ceph_rgw_docker_image_tag: latest +#ceph_docker_image: "ceph/daemon" +#ceph_docker_image_tag: latest #ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }} #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME diff --git a/infrastructure-playbooks/purge-docker-cluster.yml b/infrastructure-playbooks/purge-docker-cluster.yml index 5c7dd4fca..ec53beeff 100644 --- a/infrastructure-playbooks/purge-docker-cluster.yml +++ b/infrastructure-playbooks/purge-docker-cluster.yml @@ -71,7 +71,7 @@ - name: remove ceph mds container docker: - image: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" state: absent ignore_errors: true @@ -84,8 +84,8 @@ - name: remove ceph mds image docker_image: state: absent - name: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}" - tag: "{{ ceph_mds_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img @@ -118,7 +118,7 @@ - name: remove ceph rgw container docker: - image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" state: absent ignore_errors: true @@ -131,8 +131,8 @@ - name: remove ceph rgw image docker_image: state: absent - name: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}" - tag: "{{ ceph_rgw_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img @@ -165,7 +165,7 @@ - name: remove ceph rbd-mirror container docker: - image: "{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}:{{ ceph_rbd_mirror_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" state: absent ignore_errors: true @@ -178,8 +178,8 @@ - name: remove ceph rbd-mirror image docker_image: state: absent - name: "{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}" - tag: "{{ ceph_rbd_mirror_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img @@ -212,7 +212,7 @@ - name: remove ceph nfs container docker: - image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" state: absent ignore_errors: true @@ -234,8 +234,8 @@ - name: remove ceph nfs image docker_image: state: absent - name: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}" - tag: "{{ ceph_nfs_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img @@ -269,7 +269,7 @@ - name: remove ceph osd prepare container docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-prepare-{{ item | regex_replace('/', '') }}" state: absent with_items: "{{ ceph_osd_docker_devices }}" @@ -277,7 +277,7 @@ - name: remove ceph osd container docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-{{ item | regex_replace('/', '') }}" state: absent with_items: "{{ ceph_osd_docker_devices }}" @@ -285,7 +285,7 @@ - name: zap ceph osd disk docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}" net: host pid: host @@ -297,7 +297,7 @@ - name: remove ceph osd zap disk container docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}" state: absent with_items: "{{ ceph_osd_docker_devices }}" @@ -305,7 +305,7 @@ # zap twice - name: zap ceph osd disk docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}" net: host pid: host @@ -317,7 +317,7 @@ - name: remove ceph osd zap disk container docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-zap-{{ item | regex_replace('/', '') }}" state: absent with_items: "{{ ceph_osd_docker_devices }}" @@ -330,8 +330,8 @@ - name: remove ceph osd image docker_image: state: absent - name: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}" - tag: "{{ ceph_osd_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img @@ -368,14 +368,14 @@ - name: remove ceph mon container docker: - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" state: absent ignore_errors: true - name: remove restapi container docker: - image: "{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-ceph-restapi" state: absent ignore_errors: true @@ -388,8 +388,8 @@ - name: remove ceph mon image docker_image: state: absent - name: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}" - tag: "{{ ceph_mon_docker_image_tag }}" + name: "{{ ceph_docker_image }}" + tag: "{{ ceph_docker_image_tag }}" force: yes tags: remove_img diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index b09ddba6c..26edb8866 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -137,19 +137,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_mon_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_mon_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_mon_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_mon_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -162,7 +162,7 @@ - name: start ceph mon container image docker: - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" net: "host" state: "running" @@ -221,19 +221,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_osd_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_osd_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_osd_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_osd_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -265,7 +265,7 @@ - name: start ceph osd container image(s) docker: - image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-osd-{{ item | regex_replace('/', '') }}" net: host pid: host @@ -313,19 +313,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_mds_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_mds_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_mds_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_mds_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -338,7 +338,7 @@ - name: start ceph metadata container image docker: - image: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: ceph-{{ ansible_hostname }}-mds net: host state: running @@ -373,19 +373,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_rgw_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_rgw_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_rgw_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_rgw_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -398,7 +398,7 @@ - name: start ceph rados gateway container image docker: - image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: ceph-{{ ansible_hostname }}-rgw expose: "{{ ceph_rgw_civetweb_port }}" ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}" @@ -434,19 +434,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_rbd_mirror_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_rbd_mirror_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_rbd_mirror_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_rbd_mirror_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -459,7 +459,7 @@ - name: start ceph rbd mirror container image docker: - image: "{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}:{{ ceph_rbd_mirror_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" net: host state: running @@ -493,19 +493,19 @@ - set_fact: ceph_uid: 64045 - when: ceph_nfs_docker_image_tag | match("latest") + when: ceph_docker_image_tag | match("latest") - set_fact: ceph_uid: 64045 - when: ceph_nfs_docker_image_tag | search("ubuntu") + when: ceph_docker_image_tag | search("ubuntu") - set_fact: ceph_uid: 167 - when: ceph_nfs_docker_image_tag | search("centos") + when: ceph_docker_image_tag | search("centos") - set_fact: ceph_uid: 167 - when: ceph_nfs_docker_image_tag | search("fedora") + when: ceph_docker_image_tag | search("fedora") - name: set proper ownership on ceph directories file: @@ -518,7 +518,7 @@ - name: start ceph nfs container image docker: - image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}" net: "host" state: "running" diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index e6dddb528..c5a564326 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -385,6 +385,8 @@ os_tuning_params: ########## docker: false +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest # Do not comment the following variables mon_containerized_deployment_* here. These variables are being used # by ceph.conf.j2 template. so it should always be defined diff --git a/roles/ceph-common/tasks/docker/fetch_image.yml b/roles/ceph-common/tasks/docker/fetch_image.yml index 26e8b2b01..57c76ed85 100644 --- a/roles/ceph-common/tasks/docker/fetch_image.yml +++ b/roles/ceph-common/tasks/docker/fetch_image.yml @@ -1,7 +1,7 @@ --- # Normal case - pull image from registry -- name: pull ceph daemon image - command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}" +- name: "pull {{ ceph_docker_image }} image" + command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" changed_when: false when: ceph_docker_dev_image is undefined or not ceph_docker_dev_image diff --git a/roles/ceph-mds/defaults/main.yml b/roles/ceph-mds/defaults/main.yml index d54171c87..71574897e 100644 --- a/roles/ceph-mds/defaults/main.yml +++ b/roles/ceph-mds/defaults/main.yml @@ -24,9 +24,8 @@ mds_containerized_deployment: false mds_containerized_deployment_with_kv: false kv_type: etcd kv_endpoint: 127.0.0.1 -ceph_mds_docker_username: ceph -ceph_mds_docker_imagename: daemon -ceph_mds_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }} ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-mds/tasks/docker/main.yml b/roles/ceph-mds/tasks/docker/main.yml index 05995b7a6..507aadfa8 100644 --- a/roles/ceph-mds/tasks/docker/main.yml +++ b/roles/ceph-mds/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_mds_docker_username}}/{{ceph_mds_docker_imagename}}:{{ceph_mds_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -41,10 +41,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_mds_docker_username }}" - ceph_docker_imagename: "{{ ceph_mds_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_mds_docker_image_tag }}" - include: dirs_permissions.yml - include: fetch_configs.yml diff --git a/roles/ceph-mds/templates/ceph-mds.service.j2 b/roles/ceph-mds/templates/ceph-mds.service.j2 index 8c89c6a16..15a35aad4 100644 --- a/roles/ceph-mds/templates/ceph-mds.service.j2 +++ b/roles/ceph-mds/templates/ceph-mds.service.j2 @@ -20,7 +20,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \ -e CEPHFS_CREATE=1 \ {{ ceph_mds_docker_extra_env }} \ --name={{ ansible_hostname }} \ - {{ ceph_docker_registry }}/{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }} + {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStopPost=-/usr/bin/docker stop {{ ansible_hostname }} Restart=always RestartSec=10s diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index cbe61432b..a9a837ec0 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -73,9 +73,8 @@ mon_containerized_deployment_with_kv: false #mon_containerized_default_ceph_conf_with_kv: false ceph_mon_docker_interface: "{{ monitor_interface }}" ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface -ceph_mon_docker_username: ceph -ceph_mon_docker_imagename: daemon -ceph_mon_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ ansible_hostname }} ceph_docker_on_openstack: false mon_docker_privileged: false diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 15499e6e2..f1bc6dc11 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_mon_docker_username}}/{{ceph_mon_docker_imagename}}:{{ceph_mon_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -42,10 +42,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_mon_docker_username }}" - ceph_docker_imagename: "{{ ceph_mon_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_mon_docker_image_tag }}" - include: dirs_permissions.yml diff --git a/roles/ceph-mon/tasks/docker/pre_requisite.yml b/roles/ceph-mon/tasks/docker/pre_requisite.yml index d41fe7892..5a8135ed5 100644 --- a/roles/ceph-mon/tasks/docker/pre_requisite.yml +++ b/roles/ceph-mon/tasks/docker/pre_requisite.yml @@ -129,7 +129,7 @@ tags: with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '<') - + - name: install docker-py pip: name: docker-py diff --git a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml index 50dc8f37d..6339a1b6a 100644 --- a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml +++ b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml @@ -2,7 +2,7 @@ - name: populate kv_store with default ceph.conf docker: name: populate-kv-store - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" command: populate_kvstore net: host env: @@ -18,7 +18,7 @@ - name: populate kv_store with custom ceph.conf docker: name: populate-kv-store - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" command: populate_kvstore net: host env: @@ -37,7 +37,7 @@ docker: name: populate-kv-store state: absent - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" when: mon_containerized_deployment_with_kv - name: generate systemd unit file diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 1815015c5..373d46e76 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -26,7 +26,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \ -e MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }} \ -e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \ {{ ceph_mon_docker_extra_env }} \ - {{ceph_docker_registry }}/{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }} + {{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStopPost=-/usr/bin/docker stop %i Restart=always RestartSec=10s diff --git a/roles/ceph-nfs/defaults/main.yml b/roles/ceph-nfs/defaults/main.yml index 23b694170..509d38bc1 100644 --- a/roles/ceph-nfs/defaults/main.yml +++ b/roles/ceph-nfs/defaults/main.yml @@ -77,9 +77,8 @@ nfs_containerized_deployment: false nfs_containerized_deployment_with_kv: false kv_type: etcd kv_endpoint: 127.0.0.1 -ceph_nfs_docker_username: ceph -ceph_nfs_docker_imagename: ganesha -ceph_nfs_docker_image_tag: latest +ceph_docker_image: "ceph/ganesha" +ceph_docker_image_tag: latest #ceph_nfs_docker_extra_env: -e GANESHA_EPOCH={{ ganesha_epoch }} ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-nfs/tasks/docker/create_configs.yml b/roles/ceph-nfs/tasks/docker/create_configs.yml index edb3dcdbb..28962251b 100644 --- a/roles/ceph-nfs/tasks/docker/create_configs.yml +++ b/roles/ceph-nfs/tasks/docker/create_configs.yml @@ -9,7 +9,7 @@ - name: create the nfs rgw user docker: - image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}" + image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: ceph-{{ ansible_hostname }}-rgw-user hostname: "{{ ansible_hostname }}" expose: "{{ ceph_rgw_civetweb_port }}" diff --git a/roles/ceph-nfs/tasks/docker/main.yml b/roles/ceph-nfs/tasks/docker/main.yml index a54fb12b1..d80a4c975 100644 --- a/roles/ceph-nfs/tasks/docker/main.yml +++ b/roles/ceph-nfs/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_nfs_docker_username}}/{{ceph_nfs_docker_imagename}}:{{ceph_nfs_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -41,10 +41,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_nfs_docker_username }}" - ceph_docker_imagename: "{{ ceph_nfs_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_nfs_docker_image_tag }}" - include: dirs_permissions.yml diff --git a/roles/ceph-nfs/templates/ceph-nfs.service.j2 b/roles/ceph-nfs/templates/ceph-nfs.service.j2 index 5a12c4316..43cf0a5dd 100644 --- a/roles/ceph-nfs/templates/ceph-nfs.service.j2 +++ b/roles/ceph-nfs/templates/ceph-nfs.service.j2 @@ -20,7 +20,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \ -e CEPH_DAEMON=NFS \ {{ ceph_nfs_docker_extra_env }} \ --name=nfs-{{ ansible_hostname }} \ - {{ ceph_docker_registry }}/{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }} + {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStopPost=-/usr/bin/docker stop %i Restart=always RestartSec=10s diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index fded10d75..b0e00ce0f 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -169,9 +169,8 @@ kv_type: etcd kv_endpoint: 127.0.0.1 kv_port: 4001 ceph_osd_docker_prepare_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1 -ceph_osd_docker_username: ceph -ceph_osd_docker_imagename: daemon -ceph_osd_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE -e OSD_JOURNAL_SIZE={{ journal_size }} ceph_osd_docker_devices: "{{ devices }}" ceph_docker_on_openstack: false diff --git a/roles/ceph-osd/tasks/docker/main.yml b/roles/ceph-osd/tasks/docker/main.yml index 3d778eb2d..9771bcd14 100644 --- a/roles/ceph-osd/tasks/docker/main.yml +++ b/roles/ceph-osd/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_osd_docker_username}}/{{ceph_osd_docker_imagename}}:{{ceph_osd_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -42,10 +42,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: '{{ ceph_osd_docker_username }}' - ceph_docker_imagename: '{{ ceph_osd_docker_imagename }}' - ceph_docker_image_tag: '{{ ceph_osd_docker_image_tag }}' # NOTE (jimcurtis): dirs_permissions.yml must precede fetch_configs.yml # because it creates the directories needed by the latter. diff --git a/roles/ceph-osd/tasks/docker/pre_requisite.yml b/roles/ceph-osd/tasks/docker/pre_requisite.yml index 83dc90b88..85a1047f0 100644 --- a/roles/ceph-osd/tasks/docker/pre_requisite.yml +++ b/roles/ceph-osd/tasks/docker/pre_requisite.yml @@ -117,7 +117,7 @@ tags: with_pkg when: ansible_version['full'] | version_compare('2.1.0.0', '<') - + - name: install docker-py pip: name: docker-py diff --git a/roles/ceph-osd/tasks/docker/start_docker_osd.yml b/roles/ceph-osd/tasks/docker/start_docker_osd.yml index 196725b31..e1ea76a84 100644 --- a/roles/ceph-osd/tasks/docker/start_docker_osd.yml +++ b/roles/ceph-osd/tasks/docker/start_docker_osd.yml @@ -33,7 +33,7 @@ -e "OSD_DEVICE={{ item.0 }}" \ -e CEPH_DAEMON=OSD_CEPH_DISK_PREPARE \ {{ ceph_osd_docker_prepare_env }} \ - "{{ ceph_docker_registry }}/{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" + "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" with_together: - "{{ ceph_osd_docker_devices }}" - "{{ osd_prepared.results }}" @@ -58,7 +58,7 @@ -e KV_IP={{kv_endpoint}} \ -e KV_PORT={{kv_port}} \ {{ ceph_osd_docker_prepare_env }} \ - "{{ ceph_docker_registry }}/{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" \ + "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" \ with_together: - "{{ ceph_osd_docker_devices }}" - "{{ osd_prepared.results }}" diff --git a/roles/ceph-osd/templates/ceph-osd.service.j2 b/roles/ceph-osd/templates/ceph-osd.service.j2 index 870e64888..46bee9ff6 100644 --- a/roles/ceph-osd/templates/ceph-osd.service.j2 +++ b/roles/ceph-osd/templates/ceph-osd.service.j2 @@ -22,7 +22,7 @@ ExecStart=/usr/bin/docker run --rm --net=host --pid=host\ -e OSD_DEVICE=/dev/%i \ {{ ceph_osd_docker_extra_env }} \ --name={{ ansible_hostname }}-osd-dev%i \ - {{ ceph_docker_registry }}/{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }} + {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStop=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i Restart=always RestartSec=10s diff --git a/roles/ceph-rbd-mirror/defaults/main.yml b/roles/ceph-rbd-mirror/defaults/main.yml index 6ecf8acde..4395c6e03 100644 --- a/roles/ceph-rbd-mirror/defaults/main.yml +++ b/roles/ceph-rbd-mirror/defaults/main.yml @@ -38,8 +38,7 @@ rbd_mirror_containerized_deployment: false rbd_mirror_containerized_deployment_with_kv: false kv_type: etcd kv_endpoint: 127.0.0.1 -ceph_rbd_mirror_docker_username: ceph -ceph_rbd_mirror_docker_imagename: daemon -ceph_rbd_mirror_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-rbd-mirror/tasks/docker/main.yml b/roles/ceph-rbd-mirror/tasks/docker/main.yml index ea7073118..20da41b5c 100644 --- a/roles/ceph-rbd-mirror/tasks/docker/main.yml +++ b/roles/ceph-rbd-mirror/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_rbd_mirror_docker_username}}/{{ceph_rbd_mirror_docker_imagename}}:{{ceph_rbd_mirror_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -39,10 +39,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_rbd_mirror_docker_username }}" - ceph_docker_imagename: "{{ ceph_rbd_mirror_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_rbd_mirror_docker_image_tag }}" - include: dirs_permissions.yml - include: fetch_configs.yml diff --git a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 index 5c2809f77..d0cb40871 100644 --- a/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 +++ b/roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2 @@ -17,7 +17,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \ --privileged \ -e CEPH_DAEMON=RBD_MIRROR \ --name={{ ansible_hostname }} \ - {{ ceph_docker_registry }}/{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}:{{ ceph_rbd_mirror_docker_image_tag }} + {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStopPost=-/usr/bin/docker stop {{ ansible_hostname }} Restart=always RestartSec=10s diff --git a/roles/ceph-restapi/defaults/main.yml b/roles/ceph-restapi/defaults/main.yml index b93605b15..8df594070 100644 --- a/roles/ceph-restapi/defaults/main.yml +++ b/roles/ceph-restapi/defaults/main.yml @@ -13,9 +13,8 @@ fetch_directory: fetch/ restapi_containerized_deployment: false ceph_restapi_docker_interface: eth0 ceph_restapi_port: 5000 -ceph_restapi_docker_username: ceph -ceph_restapi_docker_imagename: daemon -ceph_restapi_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-restapi/tasks/docker/main.yml b/roles/ceph-restapi/tasks/docker/main.yml index e028a5d60..22e7a5f63 100644 --- a/roles/ceph-restapi/tasks/docker/main.yml +++ b/roles/ceph-restapi/tasks/docker/main.yml @@ -29,10 +29,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_restapi_docker_username }}" - ceph_docker_imagename: "{{ ceph_restapi_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_restapi_docker_image_tag }}" - include: dirs_permissions.yml - include: fetch_configs.yml - include: start_docker_restapi.yml diff --git a/roles/ceph-restapi/tasks/docker/start_docker_restapi.yml b/roles/ceph-restapi/tasks/docker/start_docker_restapi.yml index 9678142bc..d3205ef22 100644 --- a/roles/ceph-restapi/tasks/docker/start_docker_restapi.yml +++ b/roles/ceph-restapi/tasks/docker/start_docker_restapi.yml @@ -1,7 +1,7 @@ --- - name: run the ceph rest api docker image docker: - image: "{{ ceph_docker_registry }}/{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" + image: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" name: "{{ ansible_hostname }}-ceph-restapi" net: host expose: "{{ ceph_restapi_port }}" diff --git a/roles/ceph-rgw/defaults/main.yml b/roles/ceph-rgw/defaults/main.yml index 9ae24da3f..fb07dd456 100644 --- a/roles/ceph-rgw/defaults/main.yml +++ b/roles/ceph-rgw/defaults/main.yml @@ -35,9 +35,8 @@ rgw_containerized_deployment_with_kv: false kv_type: etcd kv_endpoint: 127.0.0.1 ceph_rgw_civetweb_port: "{{ radosgw_civetweb_port }}" -ceph_rgw_docker_username: ceph -ceph_rgw_docker_imagename: daemon -ceph_rgw_docker_image_tag: latest +ceph_docker_image: "ceph/daemon" +ceph_docker_image_tag: latest ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }} ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME diff --git a/roles/ceph-rgw/tasks/docker/main.yml b/roles/ceph-rgw/tasks/docker/main.yml index 6fcb14abb..f3b9b4ebe 100644 --- a/roles/ceph-rgw/tasks/docker/main.yml +++ b/roles/ceph-rgw/tasks/docker/main.yml @@ -1,6 +1,6 @@ --- - name: check if a cluster is already running - shell: "docker ps | grep -sq '{{ceph_rgw_docker_username}}/{{ceph_rgw_docker_imagename}}:{{ceph_rgw_docker_image_tag}}'" + command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'" register: ceph_health changed_when: false failed_when: false @@ -41,10 +41,6 @@ - ntp_service_enabled - include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml" - vars: - ceph_docker_username: "{{ ceph_rgw_docker_username }}" - ceph_docker_imagename: "{{ ceph_rgw_docker_imagename }}" - ceph_docker_image_tag: "{{ ceph_rgw_docker_image_tag }}" - include: dirs_permissions.yml # NOTE (jimcurtis): dirs_permissions.yml must precede fetch_configs.yml # because it creates the directories needed by the latter. diff --git a/roles/ceph-rgw/templates/ceph-rgw.service.j2 b/roles/ceph-rgw/templates/ceph-rgw.service.j2 index 1cb477986..621f65a17 100644 --- a/roles/ceph-rgw/templates/ceph-rgw.service.j2 +++ b/roles/ceph-rgw/templates/ceph-rgw.service.j2 @@ -19,7 +19,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \ -e CEPH_DAEMON=RGW \ {{ ceph_rgw_docker_extra_env }} \ --name={{ ansible_hostname }} \ - {{ ceph_docker_registry }}/{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }} + {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} ExecStopPost=-/usr/bin/docker stop {{ ansible_hostname }} Restart=always RestartSec=10s