Browse Source

Merge "Deploy standalone ganesha instances using cephadm" into stable/wallaby

changes/39/795139/1
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
9e88ecab5c
5 changed files with 34 additions and 23 deletions
  1. +2
    -1
      tripleo_ansible/roles/tripleo_cephadm/defaults/main.yml
  2. +5
    -2
      tripleo_ansible/roles/tripleo_cephadm/tasks/ceph_cli.yaml
  3. +4
    -0
      tripleo_ansible/roles/tripleo_cephadm/tasks/nfs.yaml
  4. +1
    -1
      tripleo_ansible/roles/tripleo_cephadm/templates/ceph-nfs.service.j2
  5. +22
    -19
      tripleo_ansible/roles/tripleo_run_cephadm/tasks/prepare.yml

+ 2
- 1
tripleo_ansible/roles/tripleo_cephadm/defaults/main.yml View File

@ -11,7 +11,8 @@ tripleo_cephadm_container_image: "ceph"
tripleo_cephadm_container_tag: "v15"
tripleo_cephadm_container_cli: "podman"
tripleo_cephadm_container_options: "--net=host --ipc=host"
tripleo_cephadm_admin_keyring: "{{ tripleo_cephadm_config_home }}/{{ tripleo_cephadm_cluster }}.client.admin.keyring"
tripleo_cephadm_keyring_prefix: "{{ tripleo_cephadm_config_home }}/{{ tripleo_cephadm_cluster }}.client"
tripleo_cephadm_admin_keyring: "{{ tripleo_cephadm_keyring_prefix }}.admin.keyring"
tripleo_cephadm_conf: "{{ tripleo_cephadm_config_home }}/{{ tripleo_cephadm_cluster }}.conf"
tripleo_cephadm_bootstrap_conf: "/home/{{ tripleo_cephadm_ssh_user }}/bootstrap_{{ tripleo_cephadm_cluster }}.conf"
# path on ansible host (i.e. undercloud) of the ceph spec


+ 5
- 2
tripleo_ansible/roles/tripleo_cephadm/tasks/ceph_cli.yaml View File

@ -33,8 +33,11 @@
{% endif %}
--entrypoint {{ ceph_command | default('ceph') }}
{{ tripleo_cephadm_container_ns }}/{{ tripleo_cephadm_container_image }}:{{ tripleo_cephadm_container_tag }}
{% if ceph_command|default('ceph') == 'ceph' -%}
{% if ceph_command|default('ceph') == 'ceph' or ceph_command|default('ceph') == 'rados' -%}
{% if not admin_daemon|default(false) -%}
--fsid {{ tripleo_cephadm_fsid }} -c {{ tripleo_cephadm_conf }} -k {{ tripleo_cephadm_admin_keyring }}
--fsid {{ tripleo_cephadm_fsid }} -c {{ tripleo_cephadm_conf }} -k {{ tripleo_cephadm_keyring_prefix }}.{{ select_keyring| default('admin') }}.keyring
{%- endif %}
{% if external_cluster|default(false) -%}
-n client.{{ select_keyring }}
{%- endif %}
{%- endif %}

+ 4
- 0
tripleo_ansible/roles/tripleo_cephadm/tasks/nfs.yaml View File

@ -18,6 +18,10 @@
include_tasks: ceph_cli.yaml
vars:
ceph_command: 'rados'
# ceph cli needs manila cephx keyring if admin is not available
select_keyring: "{{ 'manila' if groups['ceph_mon'] | default([]) | length == 0 else 'admin' }}"
# when ceph is external and admin keyring is not available we're passing -n client.{{ selected_keyring }}
external_cluster: "{{ true if groups['ceph_mon'] | default([]) | length == 0 else false }}"
- name: check if rados index object exists
shell: |


+ 1
- 1
tripleo_ansible/roles/tripleo_cephadm/templates/ceph-nfs.service.j2 View File

@ -11,7 +11,7 @@ ExecStartPre=-/usr/bin/{{ container_cli }} rm --storage ceph-nfs-%i
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph /var/log/ganesha
{% endif %}
ExecStartPre=-/usr/bin/{{ container_cli }} rm ceph-nfs-%i
ExecStartPre={{ '/bin/mkdir' if ansible_facts['os_family'] == 'Debian' else '/usr/bin/mkdir' }} -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
ExecStartPre=/usr/bin/mkdir -p /etc/ceph /etc/ganesha /var/lib/nfs/ganesha /var/log/ganesha
ExecStart=/usr/bin/{{ container_cli }} run --rm --net=host \
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
-v /var/lib/ceph:/var/lib/ceph:z \


+ 22
- 19
tripleo_ansible/roles/tripleo_run_cephadm/tasks/prepare.yml View File

@ -83,32 +83,35 @@
| combine(cephfs_data|default({}))
| to_nice_yaml }}"
- name: Set bootstrap host
set_fact:
tripleo_cephadm_bootstrap_host: "{{ groups['ceph_mon'][0] }}"
- name: Configure boostrap host info for cephadm
when: "{{ groups['ceph_mon'] | default([]) | length > 0 }}"
block:
- name: Set bootstrap host
set_fact:
tripleo_cephadm_bootstrap_host: "{{ groups['ceph_mon'][0] }}"
- name: Set first monitor IP
set_fact:
tripleo_cephadm_first_mon_ip: "{{ hostvars[tripleo_cephadm_bootstrap_host][tripleo_run_cephadm_net] |
default(ansible_host) }}"
vars:
tripleo_run_cephadm_net: "{{ service_net_map['ceph_mon_network']|default('') + '_ip' }}"
- name: Set first monitor IP
set_fact:
tripleo_cephadm_first_mon_ip: "{{ hostvars[tripleo_cephadm_bootstrap_host][tripleo_run_cephadm_net] |
default(ansible_host) }}"
vars:
tripleo_run_cephadm_net: "{{ service_net_map['ceph_mon_network']|default('') + '_ip' }}"
- name: genereate ceph_spec for bootstrap
ceph_spec_bootstrap:
new_ceph_spec: "{{ tripleo_run_cephadm_spec_path }}"
tripleo_ansible_inventory: "{{ inventory_file }}"
fqdn: "{{ ceph_spec_fqdn }}"
osd_spec: "{{ ceph_osd_spec }}"
when:
- tripleo_cephadm_dynamic_spec
- name: genereate ceph_spec for bootstrap
ceph_spec_bootstrap:
new_ceph_spec: "{{ tripleo_run_cephadm_spec_path }}"
tripleo_ansible_inventory: "{{ inventory_file }}"
fqdn: "{{ ceph_spec_fqdn }}"
osd_spec: "{{ ceph_osd_spec }}"
when:
- tripleo_cephadm_dynamic_spec
- name: generate ansible cephadm-extra-vars for running tripleo_cephadm role
copy:
dest: "{{ playbook_dir }}/cephadm/cephadm-extra-vars-ansible.yml"
content: |
tripleo_cephadm_bootstrap_host: {{ tripleo_cephadm_bootstrap_host }}
tripleo_cephadm_first_mon_ip: {{ tripleo_cephadm_first_mon_ip }}
tripleo_cephadm_bootstrap_host: {{ tripleo_cephadm_bootstrap_host | default('') }}
tripleo_cephadm_first_mon_ip: {{ tripleo_cephadm_first_mon_ip | default('') }}
tripleo_cephadm_spec_on_bootstrap: false
tripleo_cephadm_pools: {{ openstack_pools.get('openstack_pools', []) }}
tripleo_cephadm_keys: {{ keys.get('keys',[]) }}


Loading…
Cancel
Save