Merge pull request #878 from font/imagetag

Support for docker image tags
pull/882/head
Leseb 2016-07-13 09:58:40 +02:00 committed by GitHub
commit 87c4ebd8cd
37 changed files with 68 additions and 45 deletions

View File

@ -18,6 +18,7 @@ dummy:
#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_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables
@ -31,6 +32,7 @@ dummy:
#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: "CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE" # comma separated variables
#ceph_osd_docker_prepare_env: "OSD_FORCE_ZAP=1" # comma separated variables
#ceph_osd_docker_devices:
@ -46,6 +48,7 @@ dummy:
#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: "MDS_NAME={{ ansible_hostname }}" # comma separated variables
#######
@ -57,6 +60,7 @@ dummy:
#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: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
@ -68,4 +72,5 @@ dummy:
#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

View File

@ -34,6 +34,7 @@ dummy:
#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: "MDS_NAME={{ ansible_hostname }}" # comma separated variables
#ceph_docker_on_openstack: false

View File

@ -77,6 +77,7 @@ dummy:
#ceph_mon_docker_subnet: # subnet of the ceph_mon_docker_interface
#ceph_mon_docker_username: ceph
#ceph_mon_docker_imagename: daemon
#ceph_mon_docker_image_tag: latest
#ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables
#ceph_docker_on_openstack: false
#mon_docker_privileged: false

View File

@ -64,5 +64,7 @@ dummy:
#kv_endpoint: 127.0.0.1
#ceph_nfs_docker_username: ceph
#ceph_nfs_docker_imagename: ganesha
#ceph_nfs_docker_image_tag: latest
#ceph_nfs_docker_extra_env: "GANESHA_EPOCH={{ ganesha_epoch }}" # comma separated variables
#ceph_docker_on_openstack: false

View File

@ -134,6 +134,7 @@ dummy:
#ceph_osd_docker_prepare_env: "OSD_FORCE_ZAP=1"
#ceph_osd_docker_username: ceph
#ceph_osd_docker_imagename: daemon
#ceph_osd_docker_image_tag: latest
#ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
#ceph_osd_docker_devices:
# - /dev/sdb

View File

@ -23,6 +23,7 @@ dummy:
#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
#ceph_docker_on_openstack: false

View File

@ -41,6 +41,7 @@ dummy:
#ceph_rgw_civetweb_port: 80
#ceph_rgw_docker_username: ceph
#ceph_rgw_docker_imagename: daemon
#ceph_rgw_docker_image_tag: latest
#ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
#ceph_docker_on_openstack: false

View File

@ -1,26 +1,26 @@
---
# Normal case - pull image from registry
- name: pull ceph daemon image
command: "docker pull {{ ceph_docker_username }}/{{ ceph_docker_imagename }}"
command: "docker pull {{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
changed_when: false
when: ceph_docker_dev_image is undefined or not ceph_docker_dev_image
# Dev case - export local dev image and send it across
- name: export local ceph dev image
local_action: command docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}"
local_action: command docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
when: ceph_docker_dev_image is defined and ceph_docker_dev_image
run_once: true
- name: copy ceph dev image file
copy:
src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}.tar"
dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}.tar"
src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
when: ceph_docker_dev_image is defined and ceph_docker_dev_image
- name: load ceph dev image
command: "docker load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}.tar"
command: "docker load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
when: ceph_docker_dev_image is defined and ceph_docker_dev_image
- name: remove tmp ceph dev image file
command: "rm /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}.tar"
command: "rm /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
when: ceph_docker_dev_image is defined and ceph_docker_dev_image

View File

@ -26,5 +26,6 @@ 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: "MDS_NAME={{ ansible_hostname }}" # comma separated variables
ceph_docker_on_openstack: false

View File

@ -2,7 +2,7 @@
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
# https://github.com/ansible/ansible/issues/10156
- name: inspect ceph version
shell: docker inspect docker.io/"{{ ceph_mds_docker_username }}"/"{{ ceph_mds_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "docker.io/{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -19,8 +19,9 @@
- include: pre_requisite.yml
- 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_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

View File

@ -39,7 +39,7 @@
- name: run the ceph metadata docker image
docker:
image: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}"
image: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}"
name: ceph-{{ ansible_hostname }}-mds
net: host
state: running

View File

@ -19,7 +19,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-e CEPHFS_CREATE=1 \
-e {{ ceph_mds_docker_extra_env }} \
--name={{ ansible_hostname }} \
{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}
{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}:{{ ceph_mds_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop {{ ansible_hostname }}
Restart=always
RestartSec=10s

View File

@ -69,7 +69,7 @@ ceph_mon_docker_interface: eth0
#ceph_mon_docker_subnet: # subnet of the ceph_mon_docker_interface
ceph_mon_docker_username: ceph
ceph_mon_docker_imagename: daemon
ceph_mon_docker_tag: latest
ceph_mon_docker_image_tag: latest
ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables
ceph_docker_on_openstack: false
mon_docker_privileged: false

View File

@ -2,7 +2,7 @@
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
# https://github.com/ansible/ansible/issues/10156
- name: inspect ceph version
shell: docker inspect docker.io/"{{ ceph_mon_docker_username }}"/"{{ ceph_mon_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "docker.io/{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -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}}'"
shell: "docker ps | grep -sq '{{ceph_mon_docker_username}}/{{ceph_mon_docker_imagename}}:{{ceph_mon_docker_image_tag}}'"
register: ceph_health
changed_when: false
failed_when: false
@ -22,8 +22,9 @@
- 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_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

View File

@ -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_tag }}"
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_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_tag }}"
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_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_tag }}"
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}"
when: mon_containerized_deployment_with_kv
# Use systemd to manage container on Atomic host and CoreOS
@ -79,7 +79,7 @@
- name: run the ceph monitor docker image
docker:
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}"
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}"
name: "{{ ansible_hostname }}"
net: "host"
state: "running"
@ -93,7 +93,7 @@
- name: run the ceph monitor docker image with kv
docker:
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}"
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}"
name: "{{ ansible_hostname }}"
net: "host"
state: "running"

View File

@ -25,7 +25,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 }} \
-e MON_NAME={{ ansible_hostname }} \
{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}
{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop %i
Restart=always
RestartSec=10s

View File

@ -56,5 +56,6 @@ 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_nfs_docker_extra_env: "GANESHA_EPOCH={{ ganesha_epoch }}" # comma separated variables
ceph_docker_on_openstack: false

View File

@ -2,7 +2,7 @@
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
# https://github.com/ansible/ansible/issues/10156
- name: inspect ceph version
shell: docker inspect "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -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}}'"
shell: "docker ps | grep -sq '{{ceph_nfs_docker_username}}/{{ceph_nfs_docker_imagename}}:{{ceph_nfs_docker_image_tag}}'"
register: ceph_health
changed_when: false
failed_when: false
@ -22,8 +22,9 @@
- 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_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

View File

@ -54,7 +54,7 @@
- name: run the ceph NFS docker image
docker:
image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}"
image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}"
name: "{{ ansible_hostname }}"
net: "host"
state: "running"
@ -69,7 +69,7 @@
- name: run the ceph NFS docker image with kv
docker:
image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}"
image: "{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}"
name: "{{ ansible_hostname }}"
net: "host"
state: "running"

View File

@ -19,7 +19,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \
-e CEPH_DAEMON=NFS \
-e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \
--name={{ ansible_hostname }} \
{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}
{{ ceph_nfs_docker_username }}/{{ ceph_nfs_docker_imagename }}:{{ ceph_nfs_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop %i
Restart=always
RestartSec=10s

View File

@ -126,6 +126,7 @@ kv_endpoint: 127.0.0.1
ceph_osd_docker_prepare_env: "OSD_FORCE_ZAP=1"
ceph_osd_docker_username: ceph
ceph_osd_docker_imagename: daemon
ceph_osd_docker_image_tag: latest
ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
#ceph_osd_docker_devices:
# - /dev/sdb

View File

@ -2,7 +2,7 @@
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
# https://github.com/ansible/ansible/issues/10156
- name: inspect ceph version
shell: docker inspect docker.io/"{{ ceph_osd_docker_username }}"/"{{ ceph_osd_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "docker.io/{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -22,8 +22,9 @@
- 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_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.

View File

@ -30,7 +30,7 @@
-v /dev:/dev \
-e "OSD_DEVICE={{ item.0 }}" \
-e "{{ ceph_osd_docker_prepare_env }}" \
"{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}" \
"{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" \
OSD_CEPH_DISK_PREPARE
with_together:
- ceph_osd_docker_devices
@ -42,7 +42,7 @@
- name: prepare ceph osd disk with kv_store
docker:
image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
image: "{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}"
name: "{{ ansible_hostname }}-osd-prepare-{{ item.0 | regex_replace('/', '') }}"
net: host
pid: host

View File

@ -19,7 +19,7 @@ ExecStart=/usr/bin/docker run --rm --net=host --pid=host\
-e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE \
-e OSD_DEVICE=/dev/%i \
--name={{ ansible_hostname }}-osd-dev%i \
{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}
{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}
ExecStop=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i
Restart=always
RestartSec=10s
@ -27,4 +27,4 @@ TimeoutStartSec=120
TimeoutStopSec=15
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -15,5 +15,6 @@ 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
ceph_docker_on_openstack: false

View File

@ -1,6 +1,6 @@
---
- name: inspect ceph version
shell: docker inspect docker.io/"{{ ceph_restapi_docker_username }}"/"{{ ceph_restapi_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "docker.io/{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -2,8 +2,9 @@
- include: pre_requisite.yml
- 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_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

View File

@ -1,7 +1,7 @@
---
- name: run the ceph rest api docker image
docker:
image: "{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}"
image: "{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}"
name: "{{ ansible_hostname }}-ceph-restapi"
net: host
expose: "{{ ceph_restapi_port }}"

View File

@ -33,5 +33,6 @@ kv_endpoint: 127.0.0.1
ceph_rgw_civetweb_port: 80
ceph_rgw_docker_username: ceph
ceph_rgw_docker_imagename: daemon
ceph_rgw_docker_image_tag: latest
ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
ceph_docker_on_openstack: false

View File

@ -2,7 +2,7 @@
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
# https://github.com/ansible/ansible/issues/10156
- name: inspect ceph version
shell: docker inspect docker.io/"{{ ceph_rgw_docker_username }}"/"{{ ceph_rgw_docker_imagename }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
shell: docker inspect "docker.io/{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
changed_when: false
failed_when: false
run_once: true

View File

@ -19,8 +19,9 @@
- include: pre_requisite.yml
- 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_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.

View File

@ -39,7 +39,7 @@
- name: run the rados gateway docker image
docker:
image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}"
image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}"
name: ceph-{{ ansible_hostname }}-rgw
expose: "{{ ceph_rgw_civetweb_port }}"
ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"

View File

@ -17,7 +17,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
--privileged \
-e CEPH_DAEMON=RGW \
--name={{ ansible_hostname }} \
{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}
{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop {{ ansible_hostname }}
Restart=always
RestartSec=10s