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

This commit is contained in:
Zuul 2021-06-07 19:15:08 +00:00 committed by Gerrit Code Review
commit 9e88ecab5c
5 changed files with 34 additions and 23 deletions

View File

@ -11,7 +11,8 @@ tripleo_cephadm_container_image: "ceph"
tripleo_cephadm_container_tag: "v15" tripleo_cephadm_container_tag: "v15"
tripleo_cephadm_container_cli: "podman" tripleo_cephadm_container_cli: "podman"
tripleo_cephadm_container_options: "--net=host --ipc=host" 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_conf: "{{ tripleo_cephadm_config_home }}/{{ tripleo_cephadm_cluster }}.conf"
tripleo_cephadm_bootstrap_conf: "/home/{{ tripleo_cephadm_ssh_user }}/bootstrap_{{ 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 # path on ansible host (i.e. undercloud) of the ceph spec

View File

@ -33,8 +33,11 @@
{% endif %} {% endif %}
--entrypoint {{ ceph_command | default('ceph') }} --entrypoint {{ ceph_command | default('ceph') }}
{{ tripleo_cephadm_container_ns }}/{{ tripleo_cephadm_container_image }}:{{ tripleo_cephadm_container_tag }} {{ 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) -%} {% 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 %}
{%- endif %} {%- endif %}

View File

@ -18,6 +18,10 @@
include_tasks: ceph_cli.yaml include_tasks: ceph_cli.yaml
vars: vars:
ceph_command: 'rados' 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 - name: check if rados index object exists
shell: | shell: |

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 ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph /var/log/ganesha
{% endif %} {% endif %}
ExecStartPre=-/usr/bin/{{ container_cli }} rm ceph-nfs-%i 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 \ ExecStart=/usr/bin/{{ container_cli }} run --rm --net=host \
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \ -d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
-v /var/lib/ceph:/var/lib/ceph:z \ -v /var/lib/ceph:/var/lib/ceph:z \

View File

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