--- - name: generate environment file become: true copy: dest: "/var/lib/ceph/radosgw/{{ cluster }}-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 - name: systemd start rgw container systemd: name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }} state: started enabled: yes masked: no daemon_reload: yes with_items: "{{ rgw_instances }}"