--- /dev/null
+---
+- name: check ntp installation on atomic
+ command: rpm -q chrony
+ register: ntp_pkg_query
+ ignore_errors: true
+ changed_when: false
+ when: ansible_os_family == 'RedHat'
--- /dev/null
+---
+- include: ../checks/check_ntp_atomic.yml
+ when: ansible_os_family == 'RedHat'
+
+- name: start the ntp service
+ service:
+ name: chronyd
+ enabled: yes
+ state: started
+ when:
+ - ntp_pkg_query.rc == 0
when: ceph_health.rc != 0
- include: pre_requisite.yml
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_mds_docker_username }}"
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '<')
-
+
- name: install docker-py
pip:
name: docker-py
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
net: host
state: running
env: "CEPH_DAEMON=MDS,CEPHFS_CREATE=1,{{ ceph_mds_docker_extra_env }}"
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
+ volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'
-e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}} \
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
--privileged \
-e CEPH_DAEMON=MDS \
-e CEPHFS_CREATE=1 \
- include: pre_requisite.yml
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_mon_docker_username }}"
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
state: "running"
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_FSID={{ fsid }},{{ ceph_mon_extra_envs }}"
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
+ volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
when:
- ansible_os_family != 'RedHat'
- ansible_os_family != 'CoreOS'
state: "running"
privileged: "{{ mon_docker_privileged }}"
env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},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: "/etc/localtime:/etc/localtime:ro"
when:
- ansible_os_family != 'RedHat'
- ansible_os_family != 'CoreOS'
-e KV_IP={{kv_endpoint}}\
-e KV_PORT={{kv_port}} \
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
{% if mon_docker_privileged -%}
--privileged \
{% endif -%}
- include: pre_requisite.yml
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_nfs_docker_username }}"
enabled: yes
tags:
with_pkg
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
privileged: true
ports: "{{ ceph_nfs_port }}:{{ ceph_nfs_port }},111:111"
env: "CEPH_DAEMON=NFS,CEPH_PUBLIC_NETWORK={{ ceph_nfs_docker_subnet }},{{ ceph_nfs_extra_envs }}"
- volumes: "/etc/ceph:/etc/ceph,/etc/ganesha:/etc/ganesha"
+ volumes: "/etc/ceph:/etc/ceph,/etc/ganesha:/etc/ganesha,/etc/localtime:/etc/localtime:ro"
when:
not is_atomic and
ansible_os_family != 'CoreOS' and
state: "running"
privileged: true
env: "CEPH_DAEMON=NFS,CEPH_PUBLIC_NETWORK={{ ceph_nfs_docker_subnet }},{{ ceph_nfs_extra_envs }}"
- volumes: "/etc/ganesha:/etc/ganesha"
+ volumes: "/etc/ganesha:/etc/ganesha,/etc/localtime:/etc/localtime:ro"
when:
not is_atomic and
ansible_os_family != 'CoreOS' and
-e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}}\
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
--privileged \
-e CEPH_DAEMON=NFS \
-e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \
- include: pre_requisite.yml
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: '{{ ceph_osd_docker_username }}'
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
-v /etc/ceph:/etc/ceph \
-v /var/lib/ceph/:/var/lib/ceph/ \
-v /dev:/dev \
+ -v /etc/localtime:/etc/localtime:ro \
-e "OSD_DEVICE={{ item.0 }}" \
-e "{{ ceph_osd_docker_prepare_env }}" \
"{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}:{{ ceph_osd_docker_image_tag }}" \
--name="{{ ansible_hostname }}-osd-prepare-{{ item.0 |
regex_replace('/', '') }}" \
-v /dev:/dev \
+ -v /etc/localtime:/etc/localtime:ro \
-e "OSD_DEVICE={{ item.0 }}" \
-e "{{ ceph_osd_docker_prepare_env }}" \
-e CEPH_DAEMON=osd_ceph_disk_prepare \
state: started
privileged: yes
env: "OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}"
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev:/dev,/run:/run"
+ volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro,/dev:/dev,/run:/run"
with_items: ceph_osd_docker_devices
when:
- ansible_os_family != 'RedHat'
state: running
privileged: yes
env: "KV_TYPE={{kv_type}},KV_IP={{kv_endpoint}},OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}"
- volumes: "/dev/:/dev/"
+ volumes: "/etc/localtime:/etc/localtime:ro,/dev/:/dev/"
with_items: ceph_osd_docker_devices
when:
- ansible_os_family != 'RedHat'
-e KV_IP={{kv_endpoint}} \
-e KV_PORT={{kv_port}} \
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
-v /dev:/dev \
--privileged \
-e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE \
when: ceph_health.rc != 0
- include: pre_requisite.yml
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_rbd_mirror_docker_username }}"
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
name: ceph-{{ ansible_hostname }}-rbd-mirror
net: host
state: running
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
+ volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'
-e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}} \
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
--privileged \
-e CEPH_DAEMON=RBD_MIRROR \
--name={{ ansible_hostname }} \
---
+- name: check if it is Atomic host
+ stat: path=/run/ostree-booted
+ register: stat_ostree
+
+- name: set fact for using Atomic host
+ set_fact:
+ is_atomic: '{{ stat_ostree.stat.exists }}'
+
- include: pre_requisite.yml
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_restapi_docker_username }}"
enabled: yes
tags:
with_pkg
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
expose: "{{ ceph_restapi_port }}"
state: running
env: "RESTAPI_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_restapi_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=RESTAPI,{{ ceph_restapi_docker_extra_env }}"
- volumes: "/etc/ceph:/etc/ceph"
+ volumes: "/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
when: ceph_health.rc != 0
- include: pre_requisite.yml
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_atomic.yml"
+ when:
+ - is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_redhat.yml"
+ when:
+ - not is_atomic
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: "{{ playbook_dir }}/roles/ceph-common/tasks/misc/ntp_debian.yml"
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: "{{ playbook_dir }}/roles/ceph-common/tasks/docker/fetch_image.yml"
vars:
ceph_docker_username: "{{ ceph_rgw_docker_username }}"
enabled: yes
tags:
with_pkg
+
+- name: install ntp on redhat using yum
+ yum:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'yum'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on redhat using dnf
+ dnf:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'RedHat'
+ - ansible_pkg_mgr == 'dnf'
+ - ntp_service_enabled
+ tags:
+ with_pkg
+
+- name: install ntp on debian
+ apt:
+ name: ntp
+ state: present
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+ tags:
+ with_pkg
ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"
state: running
env: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}"
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
+ volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'
-e KV_TYPE={{kv_type}} \
-e KV_IP={{kv_endpoint}} \
{% endif -%}
+ -v /etc/localtime:/etc/localtime:ro \
--privileged \
-e CEPH_DAEMON=RGW \
--name={{ ansible_hostname }} \