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

50 lines
1.8 KiB
YAML

---
# Use systemd to manage container on Atomic host
- name: generate systemd unit file
become: true
template:
src: "{{ playbook_dir }}/roles/ceph-rgw/templates/ceph-rgw.service.j2"
dest: /var/lib/ceph/ceph-rgw@.service
owner: "root"
group: "root"
mode: "0644"
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
- name: link systemd unit file for rgw instance
file:
src: /var/lib/ceph/ceph-rgw@.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-rgw@{{ ansible_hostname }}.service
state: link
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
- name: enable systemd unit file for rgw instance
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-rgw@{{ ansible_hostname }}.service
failed_when: false
changed_when: false
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
- name: reload systemd unit files
shell: systemctl daemon-reload
changed_when: false
failed_when: false
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
- name: systemd start rgw container
service:
name: ceph-rgw@{{ ansible_hostname }}
state: started
enabled: yes
changed_when: false
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
- name: run the rados gateway docker image
docker:
image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}:{{ ceph_rgw_docker_image_tag }}"
name: ceph-{{ ansible_hostname }}-rgw
expose: "{{ ceph_rgw_civetweb_port }}"
ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"
state: running
env: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'