Merge pull request #910 from font/ntp_enable

Add option to enable ntp
pull/926/head
Leseb 2016-08-09 10:26:57 +02:00 committed by GitHub
commit 3590ed0d9f
29 changed files with 390 additions and 10 deletions

View File

@ -0,0 +1,6 @@
---
- name: check ntp installation on atomic
command: rpm -q chrony
register: ntp_pkg_query
ignore_errors: true
changed_when: false

View File

@ -0,0 +1,11 @@
---
- include: ../checks/check_ntp_atomic.yml
when: is_atomic
- name: start the ntp service
service:
name: chronyd
enabled: yes
state: started
when:
- ntp_pkg_query.rc == 0

View File

@ -17,6 +17,24 @@
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 }}"

View File

@ -116,7 +116,7 @@
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '<')
- name: install docker-py
pip:
name: docker-py
@ -125,3 +125,34 @@
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

View File

@ -44,5 +44,5 @@
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'

View File

@ -14,6 +14,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-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 \

View File

@ -20,6 +20,23 @@
- 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 }}"

View File

@ -126,3 +126,35 @@
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

View File

@ -85,7 +85,7 @@
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'
@ -99,6 +99,7 @@
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'

View File

@ -15,6 +15,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \
-e KV_IP={{kv_endpoint}}\
-e KV_PORT={{kv_port}} \
{% endif -%}
-v /etc/localtime:/etc/localtime:ro \
{% if mon_docker_privileged -%}
--privileged \
{% endif -%}

View File

@ -20,6 +20,23 @@
- 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 }}"

View File

@ -97,3 +97,35 @@
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

View File

@ -61,7 +61,7 @@
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
@ -75,7 +75,7 @@
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

View File

@ -15,6 +15,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \
-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 }} \

View File

@ -20,6 +20,23 @@
- 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 }}'

View File

@ -125,3 +125,35 @@
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

View File

@ -28,6 +28,7 @@
-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 }}" \
@ -48,6 +49,7 @@
--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 \
@ -106,7 +108,7 @@
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'
@ -122,7 +124,7 @@
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'

View File

@ -15,6 +15,7 @@ ExecStart=/usr/bin/docker run --rm --net=host --pid=host\
-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 \

View File

@ -17,6 +17,24 @@
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 }}"

View File

@ -124,3 +124,35 @@
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

View File

@ -43,5 +43,5 @@
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'

View File

@ -14,6 +14,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-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 }} \

View File

@ -1,5 +1,31 @@
---
- 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 }}"

View File

@ -122,3 +122,35 @@
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

View File

@ -7,4 +7,4 @@
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"

View File

@ -17,6 +17,24 @@
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 }}"

View File

@ -110,3 +110,35 @@
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

View File

@ -45,5 +45,5 @@
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'

View File

@ -14,6 +14,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-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 }} \