2015-07-28 23:35:47 +08:00
|
|
|
---
|
2018-11-09 08:56:57 +08:00
|
|
|
- name: generate environment file
|
|
|
|
become: true
|
|
|
|
copy:
|
|
|
|
dest: "/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/EnvironmentFile"
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
|
|
|
content: |
|
|
|
|
INST_NAME={{ item.instance_name }}
|
|
|
|
INST_PORT={{ item.radosgw_frontend_port }}
|
|
|
|
with_items: "{{ rgw_instances }}"
|
|
|
|
|
2016-06-01 03:59:05 +08:00
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
2017-07-29 07:00:06 +08:00
|
|
|
src: "{{ role_path }}/templates/ceph-radosgw.service.j2"
|
|
|
|
dest: /etc/systemd/system/ceph-radosgw@.service
|
2016-06-01 03:59:05 +08:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
2018-01-08 22:00:32 +08:00
|
|
|
notify:
|
|
|
|
- restart ceph rgws
|
2016-06-01 03:59:05 +08:00
|
|
|
|
2017-07-29 07:00:06 +08:00
|
|
|
# For backward compatibility
|
2017-12-21 17:19:22 +08:00
|
|
|
- name: disable old systemd unit ('ceph-rgw@'|'ceph-radosgw@radosgw.'|'ceph-radosgw@') if present
|
2017-09-17 05:36:29 +08:00
|
|
|
systemd:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
daemon_reload: yes
|
|
|
|
with_items:
|
|
|
|
- "ceph-rgw@{{ ansible_hostname }}"
|
|
|
|
- "ceph-radosgw@{{ ansible_hostname }}.service"
|
2017-12-21 17:19:22 +08:00
|
|
|
- "ceph-radosgw@radosgw.{{ ansible_hostname }}.service"
|
2018-01-18 17:06:34 +08:00
|
|
|
- ceph-radosgw@radosgw.gateway.service
|
2017-07-29 07:00:06 +08:00
|
|
|
ignore_errors: true
|
|
|
|
|
2016-06-01 03:59:05 +08:00
|
|
|
- name: systemd start rgw container
|
2017-09-17 05:36:29 +08:00
|
|
|
systemd:
|
2018-11-09 08:56:57 +08:00
|
|
|
name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}
|
2016-06-01 03:59:05 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
2018-11-09 08:56:57 +08:00
|
|
|
daemon_reload: yes
|
|
|
|
with_items: "{{ rgw_instances }}"
|