Skip to content

Commit

Permalink
docker: simplify variable declaration
Browse files Browse the repository at this point in the history
Less configuration for the user, the container inherit from the global
variables. No more container specific variables.

Signed-off-by: Sébastien Han <[email protected]>
  • Loading branch information
leseb committed Sep 8, 2017
1 parent 4767eaa commit 2ea7f28
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 33 deletions.
7 changes: 4 additions & 3 deletions group_vars/mdss.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ dummy:
# GENERAL #
###########

#fetch_directory: fetch/

# Even though MDS nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on MDS nodes. Setting 'copy_admin_key' to 'true'
Expand All @@ -32,7 +30,10 @@ dummy:
#ceph_mds_docker_memory_limit: 1g
#ceph_mds_docker_cpu_limit: 1

#ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
# fix here: https://github.com/ceph/ceph-docker/pull/770
# this will go away soon.
#ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_hostname }}
#ceph_config_keys: [] # DON'T TOUCH ME


Expand Down
2 changes: 1 addition & 1 deletion group_vars/mgrs.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dummy:
#ceph_mgr_docker_memory_limit: 1g
#ceph_mgr_docker_cpu_limit: 1

#ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
#ceph_mgr_docker_extra_env:
#ceph_config_keys: [] # DON'T TOUCH ME


Expand Down
7 changes: 2 additions & 5 deletions group_vars/mons.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ dummy:
##########
# DOCKER #
##########
#ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface

# Resource limitation
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
Expand All @@ -122,12 +121,10 @@ dummy:
#ceph_mon_docker_memory_limit: 1g
#ceph_mon_docker_cpu_limit: 1

# ceph_mon_docker_extra_env:
#
# Use this variable to add extra env configuration to run your mon container.
# If you want to set a custom admin keyring you can set this variable like following:
# ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }} -e ADMIN_SECRET={{ admin_secret }}
#ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
# ceph_mon_docker_extra_env: -e ADMIN_SECRET={{ admin_secret }}
#ceph_mon_docker_extra_env:
#mon_docker_privileged: false
#mon_docker_net_host: true
#ceph_config_keys: [] # DON'T TOUCH ME
Expand Down
2 changes: 0 additions & 2 deletions group_vars/nfss.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ dummy:
# GENERAL #
###########

#fetch_directory: fetch/

# Even though NFS nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
Expand Down
2 changes: 0 additions & 2 deletions group_vars/restapis.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ dummy:
# GENERAL #
###########

#fetch_directory: fetch/

##########
# DOCKER #
##########
Expand Down
2 changes: 0 additions & 2 deletions group_vars/rgws.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ dummy:
# GENERAL #
###########

#fetch_directory: fetch/

# Even though RGW nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
Expand Down
7 changes: 4 additions & 3 deletions roles/ceph-mds/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# GENERAL #
###########

fetch_directory: fetch/

# Even though MDS nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on MDS nodes. Setting 'copy_admin_key' to 'true'
Expand All @@ -24,7 +22,10 @@ copy_admin_key: false
ceph_mds_docker_memory_limit: 1g
ceph_mds_docker_cpu_limit: 1

ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
# we currently for MDS_NAME to hostname because of a bug in ceph-docker
# fix here: https://github.com/ceph/ceph-docker/pull/770
# this will go away soon.
ceph_mds_docker_extra_env: -e MDS_NAME={{ ansible_hostname }}
ceph_config_keys: [] # DON'T TOUCH ME


Expand Down
3 changes: 2 additions & 1 deletion roles/ceph-mds/templates/ceph-mds.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-e KV_PORT={{kv_port}} \
{% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CEPH_DAEMON=MDS \
-e CLUSTER={{ cluster }} \
-e CEPHFS_CREATE=1 \
-e CEPH_DAEMON=MDS \
{{ ceph_mds_docker_extra_env }} \
--name=ceph-mds-{{ ansible_hostname }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-mgr/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
ceph_mgr_docker_memory_limit: 1g
ceph_mgr_docker_cpu_limit: 1

ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
ceph_mgr_docker_extra_env:
ceph_config_keys: [] # DON'T TOUCH ME


Expand Down
1 change: 1 addition & 0 deletions roles/ceph-mgr/templates/ceph-mgr.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-e KV_PORT={{kv_port}} \
{% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=MGR \
{{ ceph_mgr_docker_extra_env }} \
--name=ceph-mgr-{{ ansible_hostname }} \
Expand Down
7 changes: 2 additions & 5 deletions roles/ceph-mon/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ openstack_keys:
##########
# DOCKER #
##########
ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface

# Resource limitation
# For the whole list of limits you can apply see: docs.docker.com/engine/admin/resource_constraints
Expand All @@ -114,12 +113,10 @@ ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface
ceph_mon_docker_memory_limit: 1g
ceph_mon_docker_cpu_limit: 1

# ceph_mon_docker_extra_env:
#
# Use this variable to add extra env configuration to run your mon container.
# If you want to set a custom admin keyring you can set this variable like following:
# ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }} -e ADMIN_SECRET={{ admin_secret }}
ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
# ceph_mon_docker_extra_env: -e ADMIN_SECRET={{ admin_secret }}
ceph_mon_docker_extra_env:
mon_docker_privileged: false
mon_docker_net_host: true
ceph_config_keys: [] # DON'T TOUCH ME
Expand Down
6 changes: 4 additions & 2 deletions roles/ceph-mon/templates/ceph-mon.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
{% if mon_docker_net_host -%}
--net=host \
{% endif -%}
-e CEPH_DAEMON=MON \
-e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \
-e IP_VERSION={{ ip_version[-1:] }} \
{% if monitor_address is defined and monitor_address != '0.0.0.0' %}
{% if ip_version == 'ipv4' -%}
Expand All @@ -42,6 +40,10 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
{% elif ip_version =='ipv6' -%}
-e MON_IP=[{{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version][0]['address'] }}] \
{% endif -%}
-e CLUSTER={{ cluster }} \
-e FSID={{ fsid }} \
-e CEPH_PUBLIC_NETWORK={{ public_network }} \
-e CEPH_DAEMON=MON \
{{ ceph_mon_docker_extra_env }} \
{{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-mon-%i
Expand Down
2 changes: 0 additions & 2 deletions roles/ceph-nfs/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# GENERAL #
###########

fetch_directory: fetch/

# Even though NFS nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
Expand Down
2 changes: 2 additions & 0 deletions roles/ceph-rbd-mirror/templates/ceph-rbd-mirror.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ ExecStart=/usr/bin/docker run --rm --net=host \
--cpu-quota={{ ceph_rbd_mirror_docker_cpu_limit * 100000 }} \
{% endif -%}
{% if not containerized_deployment_with_kv -%}
-v /var/lib/ceph:/var/lib/ceph \
-v /etc/ceph:/etc/ceph \
{% else -%}
-e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}} \
-e KV_PORT={{kv_port}} \
{% endif -%}
-v /etc/localtime:/etc/localtime:ro \
-e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=RBD_MIRROR \
--name=ceph-rbd-mirror-{{ ansible_hostname }} \
{{ ceph_rbd_mirror_docker_extra_env }} \
Expand Down
2 changes: 0 additions & 2 deletions roles/ceph-restapi/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# GENERAL #
###########

fetch_directory: fetch/

##########
# DOCKER #
##########
Expand Down
2 changes: 0 additions & 2 deletions roles/ceph-rgw/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# GENERAL #
###########

fetch_directory: fetch/

# Even though RGW nodes should not have the admin key
# at their disposal, some people might want to have it
# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
Expand Down

0 comments on commit 2ea7f28

Please sign in to comment.