Created
April 15, 2019 16:56
-
-
Save chianingwang/bd3649827f1bcdb13dd6d40b46aee388 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Stop ssnoded | |
service: name=ssnoded state=stopped | |
- name: Stop swift services (Ubuntu or CentOS 6.x) | |
service: name=ssstop state=started | |
when: (ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6') | |
or ansible_distribution == 'Ubuntu' | |
- name: Stop swift services (RHEL/CentOS 7.x) | |
shell: ssswift stop | |
when: (ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') | |
and ansible_distribution_major_version == '7' | |
- name: Stop swift services (force kill in Ubuntu or CentOS 6.x) | |
shell: /opt/ss/bin/swift-init all kill | |
when: (ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6') | |
or ansible_distribution == 'Ubuntu' | |
- name: Delete all data in /srv/node | |
shell: find {{item.mount}} -not -path {{item.mount}} -delete | |
with_items: ansible_mounts | |
when: "'/srv/node' in '{{ item.mount }}' and | |
('object' in '{{ type }}' or 'container' in '{{ type }}' or 'account' in '{{ type }}')" | |
ignore_errors: yes | |
- name: Clean all.log | |
command: truncate /var/log/swift/all.log --size 0 | |
- name: Restart syslog | |
service: name=rsyslog state=restarted | |
- name: Restart memcached | |
service: name=memcached state=restarted | |
when: "'proxy' in '{{ type }}'" | |
- name: Start swift service (Ubuntu and CentOS 6.x) | |
service: name=ssstart state=started | |
when: (ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6') | |
or ansible_distribution == 'Ubuntu' | |
- name: Start swift services (RHEL/CentOS 7.x) | |
shell: ssswift start | |
when: (ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') | |
and ansible_distribution_major_version == '7' | |
- name: Start ssnoded | |
service: name=ssnoded state=started |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment