diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-02-04 11:33:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 11:33:44 -0800 |
commit | 26caf813c55a090279260436ec315d8331bcc2e4 (patch) | |
tree | f8d9e6468b78c6659440da1baebc3c15a6c4ac44 /roles | |
parent | ff7a9b6f634582a785c7fac6476365659e996d58 (diff) | |
parent | ac122861b8173b98659609c47b3e04e2c8a12546 (diff) | |
download | openshift-26caf813c55a090279260436ec315d8331bcc2e4.tar.gz openshift-26caf813c55a090279260436ec315d8331bcc2e4.tar.bz2 openshift-26caf813c55a090279260436ec315d8331bcc2e4.tar.xz openshift-26caf813c55a090279260436ec315d8331bcc2e4.zip |
Merge pull request #6969 from mjudeikis/gluster-dynamic-invetory-bug
Automatic merge from submit-queue.
dynamic inventory bug when group exists but its empty
@jarrpa output from my test for the gluster block
I use dynamic inventory. And the result of this is that ansible see all possible groups available, but some of them are empty [1]. Because group exists, fist condition is evaluated as true and it fails with the array is an empty error...
```
...
'all': [u'54.144.5.175',
u'52.200.175.54',
u'54.237.208.252',
u'52.55.224.72',
u'52.207.103.246',
u'34.227.95.191',
u'34.238.127.160'],
u'bastion': [u'34.227.95.191'],
u'bastion.0': [u'34.227.95.191'],
u'etcd': [u'34.238.127.160'],
u'glusterfs': [u'52.200.175.54', u'52.207.103.246', u'54.144.5.175'],
u'glusterfs.0': [u'52.200.175.54'],
u'glusterfs.1': [u'52.207.103.246'],
u'glusterfs.2': [u'54.144.5.175'],
u'glusterfs_registry': [],
u'infra': [u'52.55.224.72'],
u'infra.0': [u'52.55.224.72'],
u'masters': [u'34.238.127.160'],
u'masters.0': [u'34.238.127.160'],
...
```
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_hosted/tasks/storage/glusterfs.yml | 2 | ||||
-rw-r--r-- | roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/roles/openshift_hosted/tasks/storage/glusterfs.yml b/roles/openshift_hosted/tasks/storage/glusterfs.yml index b39c44b01..7223a5afe 100644 --- a/roles/openshift_hosted/tasks/storage/glusterfs.yml +++ b/roles/openshift_hosted/tasks/storage/glusterfs.yml @@ -35,7 +35,7 @@ mount: state: mounted fstype: glusterfs - src: "{% if 'glusterfs_registry' in groups %}{% set node = groups.glusterfs_registry[0] %}{% elif 'glusterfs' in groups %}{% set node = groups.glusterfs[0] %}{% endif %}{% if openshift_hosted_registry_storage_glusterfs_ips is defined and openshift_hosted_registry_storage_glusterfs_ips|length > 0 %}{{ openshift_hosted_registry_storage_glusterfs_ips[0] }}{% elif 'glusterfs_hostname' in hostvars[node] %}{{ hostvars[node].glusterfs_hostname }}{% elif 'openshift' in hostvars[node] %}{{ hostvars[node].openshift.node.nodename }}{% else %}{{ node }}{% endif %}:/{{ openshift_hosted_registry_storage_glusterfs_path }}" + src: "{% if 'glusterfs_registry' in groups and groups['glusterfs_registry'] | length > 0 %}{% set node = groups.glusterfs_registry[0] %}{% elif 'glusterfs' in groups and groups['glusterfs'] | length > 0 %}{% set node = groups.glusterfs[0] %}{% endif %}{% if openshift_hosted_registry_storage_glusterfs_ips is defined and openshift_hosted_registry_storage_glusterfs_ips|length > 0 %}{{ openshift_hosted_registry_storage_glusterfs_ips[0] }}{% elif 'glusterfs_hostname' in hostvars[node] %}{{ hostvars[node].glusterfs_hostname }}{% elif 'openshift' in hostvars[node] %}{{ hostvars[node].openshift.node.nodename }}{% else %}{{ node }}{% endif %}:/{{ openshift.hosted.registry.storage.glusterfs.path }}" name: "{{ mktemp.stdout }}" - name: Set registry volume permissions diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml index befacb04f..10c29fd37 100644 --- a/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml +++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml @@ -48,7 +48,7 @@ glusterfs_heketi_ssh_sudo: "{{ openshift_storage_glusterfs_registry_heketi_ssh_sudo | bool }}" glusterfs_heketi_ssh_keyfile: "{{ openshift_storage_glusterfs_registry_heketi_ssh_keyfile }}" glusterfs_heketi_fstab: "{{ openshift_storage_glusterfs_registry_heketi_fstab }}" - glusterfs_nodes: "{% if groups.glusterfs_registry is defined %}{% set nodes = groups.glusterfs_registry %}{% elif 'groups.glusterfs' is defined %}{% set nodes = groups.glusterfs %}{% else %}{% set nodes = '[]' %}{% endif %}{{ nodes }}" + glusterfs_nodes: "{% if groups.glusterfs_registry is defined and groups['glusterfs_registry'] | length > 0 %}{% set nodes = groups.glusterfs_registry %}{% elif 'groups.glusterfs' is defined and groups['glusterfs'] | length > 0 %}{% set nodes = groups.glusterfs %}{% else %}{% set nodes = '[]' %}{% endif %}{{ nodes }}" - include_tasks: glusterfs_common.yml when: |