mirror of https://github.com/ceph/ceph-ansible.git
82 lines
3.6 KiB
YAML
82 lines
3.6 KiB
YAML
---
|
|
- name: Pulling Ceph container image
|
|
ansible.builtin.command: "{{ timeout_command }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
|
changed_when: false
|
|
register: docker_image
|
|
until: docker_image.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
when: (ceph_docker_dev_image is undefined or not ceph_docker_dev_image | bool)
|
|
environment:
|
|
HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
|
|
HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
|
|
NO_PROXY: "{{ ceph_docker_no_proxy }}"
|
|
|
|
- name: Pulling alertmanager/prometheus/grafana container images
|
|
ansible.builtin.command: "{{ timeout_command }} {{ container_binary }} pull {{ item }}"
|
|
changed_when: false
|
|
register: monitoring_images
|
|
until: monitoring_images.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
loop:
|
|
- "{{ alertmanager_container_image }}"
|
|
- "{{ prometheus_container_image }}"
|
|
- "{{ grafana_container_image }}"
|
|
when:
|
|
- dashboard_enabled | bool
|
|
- inventory_hostname in groups.get(monitoring_group_name, [])
|
|
environment:
|
|
HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
|
|
HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
|
|
NO_PROXY: "{{ ceph_docker_no_proxy }}"
|
|
|
|
- name: Pulling node-exporter container image
|
|
ansible.builtin.command: "{{ timeout_command }} {{ container_binary }} pull {{ node_exporter_container_image }}"
|
|
changed_when: false
|
|
register: node_exporter_image
|
|
until: node_exporter_image.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
when:
|
|
- dashboard_enabled | bool
|
|
- inventory_hostname in groups.get(mon_group_name, []) or
|
|
inventory_hostname in groups.get(osd_group_name, []) or
|
|
inventory_hostname in groups.get(mds_group_name, []) or
|
|
inventory_hostname in groups.get(rgw_group_name, []) or
|
|
inventory_hostname in groups.get(mgr_group_name, []) or
|
|
inventory_hostname in groups.get(rbdmirror_group_name, []) or
|
|
inventory_hostname in groups.get(nfs_group_name, []) or
|
|
inventory_hostname in groups.get(monitoring_group_name, [])
|
|
environment:
|
|
HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
|
|
HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
|
|
NO_PROXY: "{{ ceph_docker_no_proxy }}"
|
|
|
|
- name: Export local ceph dev image
|
|
ansible.builtin.command: >
|
|
{{ container_binary }} save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
"{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
|
|
delegate_to: localhost
|
|
changed_when: false
|
|
when: (ceph_docker_dev_image is defined and ceph_docker_dev_image)
|
|
run_once: true
|
|
|
|
- name: Copy ceph dev image file
|
|
ansible.builtin.copy:
|
|
src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
mode: "0644"
|
|
when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
|
|
|
|
- name: Load ceph dev image
|
|
ansible.builtin.command: "{{ container_binary }} load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
changed_when: false
|
|
when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
|
|
|
|
- name: Remove tmp ceph dev image file
|
|
ansible.builtin.file:
|
|
name: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
|
|
state: absent
|
|
when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
|