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>
group_vars/restapis
*.DS_Store
site.yml
+site-docker.yml
*.pyc
MEMORY = settings['memory']
STORAGECTL = settings['vagrant_storagectl']
ETH = settings['eth']
+DOCKER = settings['docker']
ansible_provision = proc do |ansible|
- ansible.playbook = 'site.yml'
+ 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
}
# In a production deployment, these should be secret
- ansible.extra_vars = {
- ceph_stable: 'true',
- journal_collocation: 'true',
- journal_size: 100,
- monitor_interface: ETH,
- cluster_network: "#{SUBNET}.0/24",
- public_network: "#{SUBNET}.0/24",
- devices: settings['disks'],
- os_tuning_params: settings['os_tuning_params']
- }
+ 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',
+ journal_size: 100,
+ monitor_interface: ETH,
+ cluster_network: "#{SUBNET}.0/24",
+ public_network: "#{SUBNET}.0/24",
+ devices: settings['disks'],
+ os_tuning_params: settings['os_tuning_params']
+ }
+ end
ansible.limit = 'all'
end
- /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
- /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
+- 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: python-pip
+ 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"
- /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
- /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
+- 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: python-pip
+ 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"
- /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
- /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
+- 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: python-pip
+ 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"
- /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
---
-- 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
+- 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: python-pip
+ 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"
- /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
- /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
+- 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: python-pip
+ 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"
--- /dev/null
+---
+# 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
become: True
roles:
- ceph-mon
- #serial: 1 # ENABLE THIS WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS
- hosts: osds
become: True
---
+# DEPLOY CONTAINERIZED DAEMONS
+docker: false
+
# DEFINE THE NUMBER OF VMS TO RUN
mon_vms: 3
osd_vms: 3