Skip to content

Commit 7be5372

Browse files
Merge pull request #971 from fmount/glance-nfs
Update glance adoption scenarios
2 parents 3e09afd + 5d29ca1 commit 7be5372

3 files changed

Lines changed: 26 additions & 21 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- name: Fail if no nfs_server_addr/nfs_server_path are definied
2+
when:
3+
- glance_nfs_server_addr is not defined
4+
- glance_nfs_server_path is not defined
5+
ansible.builtin.fail:
6+
msg:
7+
- 'glance_nfs_server_addr/glance_nfs_server_path must be defined'
8+
9+
- name: Generate the glance CR config spec based on the selected backend
10+
ansible.builtin.template:
11+
src: glance_nfs.yaml.j2
12+
dest: /tmp/glance_nfs.yaml
13+
mode: "0600"
14+
15+
- name: Deploy GlanceAPI with NFS backend
16+
ansible.builtin.shell: |
17+
{{ shell_header }}
18+
{{ oc_header }}
19+
oc patch openstackcontrolplane openstack --type=merge --patch-file=/tmp/glance_nfs.yaml

tests/roles/glance_adoption/tasks/main.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,14 @@
1212

1313
- name: deploy podified Glance with local backend
1414
when: glance_backend == 'nfs'
15-
block:
16-
- name: Fail if no nfs_server_addr/nfs_server_path are definied
17-
when:
18-
- nfs_server_addr is not defined
19-
- nfs_server_path is not defined
20-
ansible.builtin.fail:
21-
msg:
22-
- 'nfs_server_addr/nfs_server_path must be defined'
23-
- name: Generate the glance CR config spec based on the selected backend
24-
ansible.builtin.template:
25-
src: glance_nfs.yaml.j2
26-
dest: /tmp/glance_nfs.yaml
27-
mode: "0600"
28-
- name: Deploy GlanceAPI with NFS backend
29-
ansible.builtin.shell: |
30-
{{ shell_header }}
31-
{{ oc_header }}
32-
oc patch openstackcontrolplane openstack --type=merge --patch-file=/tmp/glance_nfs.yaml
15+
ansible.builtin.include_tasks: glance_nfs.yaml
3316

3417
- name: template out the glance backend
3518
ansible.builtin.template:
3619
src: "{{ role_path }}/templates/glance_ceph.yaml.j2"
3720
dest: "{{ role_path }}/files/glance_ceph.yaml"
3821
mode: '644'
22+
when: glance_backend == 'ceph'
3923

4024
- name: deploy podified Glance with Ceph backend
4125
ansible.builtin.shell: |
@@ -49,6 +33,7 @@
4933
src: "{{ role_path }}/templates/glance_swift.yaml.j2"
5034
dest: "{{ role_path }}/files/glance_swift.yaml"
5135
mode: '644'
36+
when: glance_backend == 'swift'
5237

5338
- name: deploy podified Glance with Swift backend
5439
ansible.builtin.shell: |
@@ -62,6 +47,7 @@
6247
src: "{{ role_path }}/templates/glance_cinder.yaml.j2"
6348
dest: "{{ role_path }}/files/glance_cinder.yaml"
6449
mode: '644'
50+
when: glance_backend == 'cinder'
6551

6652
- name: deploy podified Glance with Cinder backend
6753
ansible.builtin.shell: |

tests/roles/glance_adoption/templates/glance_nfs.yaml.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
databaseInstance: openstack
1212
glanceAPIs:
1313
default:
14-
replicas: 1
14+
replicas: 3
1515
type: single
1616
extraMounts:
1717
- extraVol:
@@ -22,7 +22,7 @@ spec:
2222
volumes:
2323
- name: nfs
2424
nfs:
25-
path: "{{ nfs_server_path }}"
26-
server: "{{ nfs_server_address }}"
25+
path: "{{ glance_nfs_server_path }}"
26+
server: "{{ glance_nfs_server_addr }}"
2727
name: r1
2828
region: r1

0 commit comments

Comments
 (0)