ceph-ansible: allow to run containerized daemons

run containerized daemons in virtual machines.
to enable it simply do:

`cp site-docker.yml.sample site-docker.yml`

and set `docker: true` in `vagrant_variables.yml`

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/521/head
Sébastien Han 2016-02-07 22:30:32 +01:00
parent 047e1afdc5
commit fa610cabf7
15 changed files with 214 additions and 57 deletions

1
.gitignore vendored
View File

@ -11,4 +11,5 @@ group_vars/rgws
group_vars/restapis
*.DS_Store
site.yml
site-docker.yml
*.pyc

21
Vagrantfile vendored
View File

@ -17,9 +17,15 @@ BOX = settings['vagrant_box']
MEMORY = settings['memory']
STORAGECTL = settings['vagrant_storagectl']
ETH = settings['eth']
DOCKER = settings['docker']
ansible_provision = proc do |ansible|
if DOCKER then
ansible.playbook = 'site-docker.yml'
else
ansible.playbook = 'site.yml'
end
# Note: Can't do ranges like mon[0-2] in groups because
# these aren't supported by Vagrant, see
# https://github.com/mitchellh/vagrant/issues/3539
@ -33,6 +39,20 @@ ansible_provision = proc do |ansible|
}
# In a production deployment, these should be secret
if DOCKER then
ansible.extra_vars = {
mon_containerized_deployment: 'true',
osd_containerized_deployment: 'true',
mds_containerized_deployment: 'true',
rgw_containerized_deployment: 'true',
restapi_containerized_deployment: 'true',
ceph_mon_docker_interface: ETH,
ceph_mon_docker_subnet: "#{SUBNET}.0/24",
ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK,OSD_JOURNAL_SIZE=100",
ceph_osd_docker_device: settings['disks'],
ceph_rgw_civetweb_port: 8080
}
else
ansible.extra_vars = {
ceph_stable: 'true',
journal_collocation: 'true',
@ -43,6 +63,7 @@ ansible_provision = proc do |ansible|
devices: settings['disks'],
os_tuning_params: settings['os_tuning_params']
}
end
ansible.limit = 'all'
end

View File

@ -9,7 +9,7 @@
- /var/lib/ceph/bootstrap-mds/ceph.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
with_items: ceph_config_keys
changed_when: false
become: false

View File

@ -7,24 +7,45 @@
- /etc/ceph/
- /var/lib/ceph/bootstrap-mds
- name: install pip on debian
- name: install pip and docker on ubuntu
apt:
name: python-pip
name: "{{ item }}"
state: present
when: ansible_os_family == 'Debian'
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
- name: install pip on redhat
yum:
name: python-pip
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
- name: install pip and docker on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum"
- name: install pip on redhat
- name: install pip and docker on redhat
dnf:
name: python-pip
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf"

View File

@ -11,7 +11,7 @@
- /var/lib/ceph/bootstrap-mds/ceph.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
with_items: ceph_config_keys
changed_when: false
become: false

View File

@ -9,24 +9,45 @@
- /var/lib/ceph/bootstrap-mds
- /var/lib/ceph/bootstrap-rgw
- name: install pip on debian
- name: install pip and docker on ubuntu
apt:
name: python-pip
name: "{{ item }}"
state: present
when: ansible_os_family == 'Debian'
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
- name: install pip on redhat
yum:
name: python-pip
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
- name: install pip and docker on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum"
- name: install pip on redhat
- name: install pip and docker on redhat
dnf:
name: python-pip
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf"

View File

@ -6,7 +6,7 @@
- /var/lib/ceph/bootstrap-osd/ceph.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
with_items: ceph_config_keys
changed_when: false
become: false

View File

@ -7,24 +7,45 @@
- /etc/ceph/
- /var/lib/ceph/bootstrap-osd
- name: install pip on debian
- name: install pip and docker on ubuntu
apt:
name: python-pip
name: "{{ item }}"
state: present
when: ansible_os_family == 'Debian'
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
- name: install pip on redhat
yum:
name: python-pip
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
- name: install pip and docker on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum"
- name: install pip on redhat
- name: install pip and docker on redhat
dnf:
name: python-pip
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf"

View File

@ -6,7 +6,7 @@
- /etc/ceph/ceph.client.admin.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
with_items: ceph_config_keys
changed_when: false
become: false

View File

@ -1,22 +1,43 @@
---
- name: install pip on debian
- name: install pip and docker on ubuntu
apt:
name: python-pip
name: "{{ item }}"
state: present
when: ansible_os_family == 'Debian'
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
- name: install pip on redhat
yum:
name: python-pip
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
- name: install pip and docker on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum"
- name: install pip on redhat
- name: install pip and docker on redhat
dnf:
name: python-pip
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf"

View File

@ -6,7 +6,7 @@
- /var/lib/ceph/bootstrap-rgw/ceph.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
with_items: ceph_config_keys
changed_when: false
become: false

View File

@ -7,24 +7,45 @@
- /etc/ceph/
- /var/lib/ceph/bootstrap-rgw
- name: install pip on debian
name: install pip and docker on ubuntu
apt:
name: python-pip
name: "{{ item }}"
state: present
when: ansible_os_family == 'Debian'
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
- name: install pip on redhat
yum:
name: python-pip
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
- name: install pip and docker on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "yum"
- name: install pip on redhat
- name: install pip and docker on redhat
dnf:
name: python-pip
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
when:
ansible_os_family == 'RedHat' and
ansible_pkg_mgr == "dnf"

View File

@ -0,0 +1,28 @@
---
# Defines deployment design and assigns role to server groups
- hosts: mons
become: True
roles:
- ceph-mon
serial: 1 # MUST be '1' WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS
- hosts: osds
become: True
roles:
- ceph-osd
- hosts: mdss
become: True
roles:
- ceph-mds
- hosts: rgws
become: True
roles:
- ceph-rgw
- hosts: restapis
become: True
roles:
- ceph-restapi

View File

@ -5,7 +5,6 @@
become: True
roles:
- ceph-mon
#serial: 1 # ENABLE THIS WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS
- hosts: osds
become: True

View File

@ -1,5 +1,8 @@
---
# DEPLOY CONTAINERIZED DAEMONS
docker: false
# DEFINE THE NUMBER OF VMS TO RUN
mon_vms: 3
osd_vms: 3