2015-07-28 23:35:47 +08:00
|
|
|
---
|
2016-06-01 03:59:05 +08:00
|
|
|
# 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"
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-01 03:59:05 +08:00
|
|
|
|
|
|
|
- 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
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-01 03:59:05 +08:00
|
|
|
|
|
|
|
- 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
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-01 03:59:05 +08:00
|
|
|
|
|
|
|
- name: reload systemd unit files
|
|
|
|
shell: systemctl daemon-reload
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-01 03:59:05 +08:00
|
|
|
|
|
|
|
- name: systemd start rgw container
|
|
|
|
service:
|
|
|
|
name: ceph-rgw@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-01 03:59:05 +08:00
|
|
|
|
2015-07-28 23:35:47 +08:00
|
|
|
- name: run the rados gateway docker image
|
2015-10-19 11:19:31 +08:00
|
|
|
docker:
|
|
|
|
image: "{{ ceph_rgw_docker_username }}/{{ ceph_rgw_docker_imagename }}"
|
|
|
|
name: ceph-{{ ansible_hostname }}-rgw
|
2016-01-23 03:10:41 +08:00
|
|
|
expose: "{{ ceph_rgw_civetweb_port }}"
|
2015-10-19 11:19:31 +08:00
|
|
|
ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"
|
|
|
|
state: running
|
2016-01-23 03:10:41 +08:00
|
|
|
env: "CEPH_DAEMON=RGW,{{ ceph_rgw_docker_extra_env }}"
|
2015-10-19 11:19:31 +08:00
|
|
|
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
|
2016-06-18 00:59:53 +08:00
|
|
|
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'
|