Copy from GitHub repo

This commit is contained in:
Dmitry Vlasov
2020-08-12 00:02:27 +03:00
parent c447c45bbb
commit 42ae66e3ec
90 changed files with 5632 additions and 0 deletions
@@ -0,0 +1,92 @@
---
- hosts: bonchvisors
remote_user: cephadmin
become: true
become_user: root
become_method: sudo
tasks:
- name: check ceph-mon service exist
shell: systemctl list-units --type=service --all | grep ceph-mon | awk '{print $1}'
args:
executable: /bin/bash
register: mon_service
# определение OSD
- name: find OSD and check if exist
shell: systemctl list-units --type=service --all | grep ceph-osd | awk '{print $1}'
args:
executable: /bin/bash
register: osd_service
- name: check ceph-mon service exist
shell: systemctl list-units --type=service --all | grep ceph-mon | awk '{print $1}'
args:
executable: /bin/bash
register: mon_service
# определение OSD
- name: find OSD and check if exist
shell: systemctl list-units --type=service --all | grep ceph-osd | awk '{print $1}'
args:
executable: /bin/bash
register: osd_service
# определение MGR
- name: check ceph-mgr service exist
shell: systemctl list-units --type=service --all | grep ceph-mgr | awk '{print $1}'
args:
executable: /bin/bash
register: mgr_service
- name: Change ceph-osd cpu affinity
lineinfile:
path: /usr/lib/systemd/system/ceph-osd@.service
insertbefore: '^RestartSec=*'
line: CPUAffinity=0,1
when: osd_service.stdout != ""
- name: Change ceph-mon cpu affinity
lineinfile:
path: /usr/lib/systemd/system/ceph-mon@.service
insertbefore: '^RestartSec=*'
line: CPUAffinity=0,1
when: mon_service.stdout != ""
- name: Change ceph-mgr cpu affinity
lineinfile:
path: /usr/lib/systemd/system/ceph-mgr@.service
insertbefore: '^StartLimitBurst=*'
line: CPUAffinity=0,1
when: mgr_service.stdout != ""
- name: restart ceph-osd service
systemd:
state: restarted
daemon_reload: yes
name: "{{ item }}"
loop: "{{osd_service.stdout_lines}}"
when: osd_service.stdout != ""
- name: restart ceph-mon service
systemd:
state: restarted
daemon_reload: yes
name: "{{ item }}"
loop: "{{mon_service.stdout_lines}}"
when: mon_service.stdout != ""
- name: restart ceph-mgr service
systemd:
state: restarted
daemon_reload: yes
name: "{{ item }}"
loop: "{{mgr_service.stdout_lines}}"
when: mgr_service.stdout != ""