##########
#docker: false
+
---
# Variables here are applicable to all host groups NOT roles
-# This sample file generated by generate-group-vars.sh
+# This sample file generated by generate_group_vars_sample.sh
# Dummy variable to avoid error because ansible does not recognize the
# file as a good configuration file when no variable in it.
#pypy_binary_directory: /opt/bin
#pip_url: https://bootstrap.pypa.io/get-pip.py
#local_temp_directory: /tmp
+
#ceph_mds_docker_username: ceph
#ceph_mds_docker_imagename: daemon
#ceph_mds_docker_extra_env: "MDS_NAME={{ ansible_hostname }}" # comma separated variables
+#ceph_docker_on_openstack: false
#ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
#ceph_osd_docker_devices:
# - /dev/sdb
+#ceph_docker_on_openstack: false
#ceph_restapi_docker_username: ceph
#ceph_restapi_docker_imagename: daemon
#ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables
+#ceph_docker_on_openstack: false
#ceph_rgw_docker_username: ceph
#ceph_rgw_docker_imagename: daemon
#ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
+#ceph_docker_on_openstack: false
```
- hosts: servers
remote_user: core
- sudo: True
+ become: True
gather_facts: false
roles:
- { role: ceph-common-coreos }
- name: create local temp directory
local_action: raw mkdir -p {{local_temp_directory}}
- sudo: no
+ become: no
- name: prepare install_pip.sh
local_action: template src=install_pip.sh.j2 dest={{local_temp_directory}}/install_pip.sh
- sudo: no
+ become: no
- name: run pip.sh
script: "{{local_temp_directory}}/install_pip.sh"
- name: remove pip.sh
local_action: file path="{{local_temp_directory}}/pip.sh" state=absent
- sudo: no
+ become: no
- name: create local temp directory
local_action: raw mkdir -p {{local_temp_directory}}
- sudo: no
+ become: no
- name: prepare python executable
local_action: template src=install_python.sh.j2 dest={{local_temp_directory}}/install_python.sh
- sudo: no
+ become: no
- name: fix library
raw: ln -s /lib64/libncurses.so.5.9 {{pypy_directory}}/lib_pypy/libtinfo.so.5
- name: remove install_python.sh
local_action: file path="{{local_temp_directory}}/install_python.sh" state=absent
- sudo: no
+ become: no
- epel-release
- ntp
- python-setuptools
+ - libselinux-python
redhat_package_dependencies:
- python-pycurl
## Monitor options
#
+# You must define either monitor_interface or monitor_address. Preference
+# will go to monitor_interface if both are defined.
monitor_interface: interface
+monitor_address: 0.0.0.0
mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
mon_osd_down_out_interval: 600
mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
## REST API options
#
restapi_interface: "{{ monitor_interface }}"
+restapi_address: "{{ monitor_address }}"
restapi_port: 5000
restapi_base_url: /api/v0.1
restapi_log_level: warning # available level are: critical, error, warning, info, debug
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
mon_group_name in group_names and
- ansible_pkg_mgr == "yum"
+ ansible_pkg_mgr == "yum" and
+ ceph_stable and
+ ceph_stable_release not in ceph_stable_releases
- name: install distro or red hat storage ceph mon
dnf:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
mon_group_name in group_names and
- ansible_pkg_mgr == "dnf"
+ ansible_pkg_mgr == "dnf" and
+ ceph_stable and
+ ceph_stable_release not in ceph_stable_releases
- name: install distro or red hat storage ceph osd
yum:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
osd_group_name in group_names and
- ansible_pkg_mgr == "yum"
+ ansible_pkg_mgr == "yum" and
+ ceph_stable and
+ ceph_stable_release not in ceph_stable_releases
- name: install distro or red hat storage ceph osd
dnf:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
osd_group_name in group_names and
- ansible_pkg_mgr == "dnf"
+ ansible_pkg_mgr == "dnf" and
+ ceph_stable and
+ ceph_stable_release not in ceph_stable_releases
- name: install ceph-test
yum:
ceph_mds_docker_username: ceph
ceph_mds_docker_imagename: daemon
ceph_mds_docker_extra_env: "MDS_NAME={{ ansible_hostname }}" # comma separated variables
+ceph_docker_on_openstack: false
changed_when: false
when:
cephx and
- not mon_containerized_deployment and
groups[restapi_group_name] is defined
-- name: create ceph rest api keyring when mon is containerized
- command: docker exec {{ ansible_hostname }} ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
- args:
- creates: /etc/ceph/ceph.client.restapi.keyring
- changed_when: false
- when:
- cephx and
- mon_containerized_deployment and
- groups[restapi_group_name] is defined and
- inventory_hostname == groups.mons|last
-
-
- include: openstack_config.yml
when: openstack_config
--- /dev/null
+---
+- name: push ceph files to the ansible server
+ fetch:
+ src: "{{ item.0 }}"
+ dest: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+ flat: yes
+ with_together:
+ - ceph_config_keys
+ - statconfig.results
+ when: item.1.stat.exists == false
- name: set fact for using Atomic host
set_fact:
is_atomic='{{ stat_ostree.stat.exists }}'
-
+
- include: checks.yml
when: ceph_health.rc != 0 and not mon_containerized_deployment_with_kv
# let the first mon create configs and keyrings
- include: create_configs.yml
- when: inventory_hostname == groups.mons[0] and not mon_containerized_default_ceph_conf_with_kv
+ when: inventory_hostname == groups.mons[0] and mon_containerized_default_ceph_conf_with_kv
- include: fetch_configs.yml
when: not mon_containerized_deployment_with_kv
- include: start_docker_monitor.yml
-- include: ../ceph_keys.yml
- when: not mon_containerized_deployment_with_kv
\ No newline at end of file
+- include: copy_configs.yml
+ when: not mon_containerized_deployment_with_kv
+
+- name: create ceph rest api keyring when mon is containerized
+ command: docker exec {{ ansible_hostname }} ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
+ args:
+ creates: /etc/ceph/ceph.client.restapi.keyring
+ changed_when: false
+ when:
+ cephx and
+ mon_containerized_deployment and
+ groups[restapi_group_name] is defined and
+ inventory_hostname == groups.mons|last and
+ not mon_containerized_deployment_with_kv
---
-- name: set config and keys paths
- set_fact:
- ceph_bootstrap_config_keys:
- - /etc/ceph/ceph.conf
- - /var/lib/ceph/bootstrap-osd/ceph.keyring
- - /var/lib/ceph/bootstrap-rgw/ceph.keyring
- - /var/lib/ceph/bootstrap-mds/ceph.keyring
- when: not mon_containerized_deployment_with_kv
-
- name: pull ceph daemon image
shell: "docker pull {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
KV_IP: "{{kv_endpoint}}"
KV_PORT: "{{kv_port}}"
run_once: true
- when: inventory_hostname == groups.mons[0] and mon_containerized_deployment_with_kv
- and mon_containerized_default_ceph_conf_with_kv
+ when:
+ inventory_hostname == groups.mons[0] and
+ mon_containerized_deployment_with_kv and
+ mon_containerized_default_ceph_conf_with_kv
- name: populate kv_store with custom ceph.conf
docker:
volumes:
- /etc/ceph/ceph.conf:/etc/ceph/ceph.defaults
run_once: true
- when: inventory_hostname == groups.mons[0] and mon_containerized_deployment_with_kv
- and not mon_containerized_default_ceph_conf_with_kv
+ when:
+ inventory_hostname == groups.mons[0] and
+ mon_containerized_deployment_with_kv and
+ not mon_containerized_default_ceph_conf_with_kv
- name: delete populate-kv-store docker
docker:
# Use systemd to manage container on Atomic host and CoreOS
- name: generate systemd unit file
- sudo: true
+ become: true
template:
src: ceph-mon.service.j2
dest: /var/lib/ceph/ceph-mon@.service
src: /var/lib/ceph/ceph-mon@.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service
state: link
- when: is_atomic or ansible_os_family == 'CoreOS'
+ when:
+ is_atomic or
+ ansible_os_family == 'CoreOS'
- name: enable systemd unit file for mon instance
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service
failed_when: false
changed_when: false
- when: is_atomic or ansible_os_family == 'CoreOS'
+ when:
+ is_atomic or
+ ansible_os_family == 'CoreOS'
- name: reload systemd unit files
shell: systemctl daemon-reload
- when: is_atomic or ansible_os_family == 'CoreOS'
+ when:
+ is_atomic or
+ ansible_os_family == 'CoreOS'
- name: systemd start mon container
service:
state: started
enabled: yes
changed_when: false
- when: is_atomic or ansible_os_family == 'CoreOS'
+ when:
+ is_atomic or
+ ansible_os_family == 'CoreOS'
- name: wait for ceph.conf exists
wait_for:
path: /etc/ceph/ceph.conf
when: is_atomic
-- name: run the ceph Monitor docker image
+- name: run the ceph monitor docker image
docker:
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
name: "{{ ansible_hostname }}"
privileged: "{{ mon_docker_privileged }}"
env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
- when: not is_atomic and ansible_os_family != 'CoreOS'
-
-- name: stat for ceph config and keys
- stat: path="{{ item }}"
- with_items: ceph_bootstrap_config_keys
- changed_when: false
- failed_when: false
- register: statmonconfig
- when: not mon_containerized_deployment_with_kv
-
-- name: fetch boostrap keys and conf from mon
- fetch:
- dest: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
- src: "{{ item.0 }}"
- flat: yes
- with_together:
- - ceph_bootstrap_config_keys
- - statmonconfig.results
- when: not mon_containerized_deployment_with_kv and item.1.stat.exists == true
- and inventory_hostname == groups.mons[0]
+ when:
+ not is_atomic and
+ ansible_os_family != 'CoreOS'
ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
#ceph_osd_docker_devices:
# - /dev/sdb
+ceph_docker_on_openstack: false
# For openstack VMs modify the mount point below depending on if the Openstack
# VM deploy tool defaults to mounting ephemeral disks
- name: umount ceph disk (if on openstack)
- mount:
+ mount:
name: /mnt
src: /dev/vdb
fstype: ext3
state: unmounted
when: ceph_docker_on_openstack
-
+
# (rootfs) for reasons I haven't figured out, docker pull and run will fail.
- name: pull ceph daemon image
shell: "docker pull {{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
# Use systemd to manage container on Atomic host
- name: generate systemd unit file
- sudo: true
+ become: true
template:
src: ceph-osd.service.j2
dest: /var/lib/ceph/ceph-osd@.service
ceph_restapi_docker_username: ceph
ceph_restapi_docker_imagename: daemon
ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables
+ceph_docker_on_openstack: false
- name: try to fetch ceph config and keys
copy:
- src: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
+ src: "{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
dest: "{{ item.0 }}"
owner: root
group: root
ceph_rgw_docker_username: ceph
ceph_rgw_docker_imagename: daemon
ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
+ceph_docker_on_openstack: false
- name: try to fetch ceph config and keys
copy:
- src: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
+ src: "{{ playbook_dir }}/{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
dest: "{{ item.0 }}"
owner: root
group: root