ceph-ansible/roles/ceph-rgw/tasks/docker/start_docker_rgw.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

---
- 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 }}"
- name: generate systemd unit file
become: true
template:
src: "{{ role_path }}/templates/ceph-radosgw.service.j2"
dest: /etc/systemd/system/ceph-radosgw@.service
owner: "root"
group: "root"
mode: "0644"
notify:
- restart ceph rgws
# For backward compatibility
- name: disable old systemd unit ('ceph-rgw@'|'ceph-radosgw@radosgw.'|'ceph-radosgw@') if present
systemd:
name: "{{ item }}"
state: stopped
enabled: no
daemon_reload: yes
with_items:
- "ceph-rgw@{{ ansible_hostname }}"
- "ceph-radosgw@{{ ansible_hostname }}.service"
- "ceph-radosgw@radosgw.{{ ansible_hostname }}.service"
- ceph-radosgw@radosgw.gateway.service
ignore_errors: true
- name: systemd start rgw container
systemd:
name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}
state: started
enabled: yes
daemon_reload: yes
with_items: "{{ rgw_instances }}"