]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
nfs: fix 2 typo
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 30 Apr 2020 14:21:14 +0000 (16:21 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 6 May 2020 17:30:12 +0000 (13:30 -0400)
The condition is missing an index here which makes the playbook failing.

Typical error:
```
The conditional check 'not item.get('skipped', False)' failed. The error was: error while evaluating conditional (not item.get('skipped', False)): 'list object' has no attribute 'get'",
```

Also, adds the missing '/keyring' on the `exec_cmd_nfs` fact.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1831342
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit cf460274c7489940968fed176c113ad473b22f4d)

roles/ceph-nfs/tasks/main.yml
roles/ceph-nfs/tasks/start_nfs.yml

index c7411bc190b4719d4b1bd30650c00ed00e958cf5..39a9b29872ab751fcbdd1aa6209bf2af87248c6e 100644 (file)
@@ -54,7 +54,7 @@
         - "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] | default([]) }}"
         - ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', '/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring']
       when:
-        - not item.get('skipped', False)
+        - not item.0.get('skipped', False)
         - item.0.item.name == 'client.rgw.' + ceph_nfs_ceph_user
 
 - name: include start_nfs.yml
index 0b8898339fe159e1fd553a9b441b3c9e507d97ef..fb416bbad778d079acd520317f56b3f75a222d28 100644 (file)
@@ -2,7 +2,7 @@
 - block:
   - name: set_fact container_exec_cmd_nfs
     set_fact:
-      exec_cmd_nfs: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=rados ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'rados' }} -n client.{{ ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else '.rgw.' + ansible_hostname }} -k /var/lib/ceph/radosgw/{{ cluster + '-rgw.' +  ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else ansible_hostname }}"
+      exec_cmd_nfs: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=rados ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'rados' }} -n client.{{ ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else 'rgw.' + ansible_hostname }} -k /var/lib/ceph/radosgw/{{ cluster + '-rgw.' +  ceph_nfs_ceph_user if groups.get(mon_group_name, []) | length == 0 else ansible_hostname }}/keyring"
 
   - name: check if rados index object exists
     shell: "{{ exec_cmd_nfs | default('') }} -p {{ cephfs_data_pool.name }} --cluster {{ cluster }} ls|grep {{ ceph_nfs_rados_export_index }}"