Browse Source

Update manila so that it works with cephfs

This change updates manila so that it can function with cephfs.
While cephfs was assumed to work these changes solidify support
and tune up the role.

Change-Id: I4d95bfc15d09b7b7c0b997d7eab91509b0c63885
Signed-off-by: cloudnull <kevin@cloudnull.com>
Kevin Carter 1 month ago
parent
commit
b9809ef89d

+ 16
- 32
defaults/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -28,30 +28,17 @@ manila_install_method: "source"
28 28
 
29 29
 manila_git_repo: https://git.openstack.org/openstack/manila
30 30
 manila_git_install_branch: master
31
-manila_developer_mode: false
32
-manila_developer_constraints:
31
+manila_upper_constraints_url: "{{ requirements_git_url | default('https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=' ~ requirements_git_install_branch | default('master')) }}"
32
+manila_git_constraints:
33 33
   - "git+{{ manila_git_repo }}@{{ manila_git_install_branch }}#egg=manila"
34
+  - "--constraint {{ barbican_upper_constraints_url }}"
34 35
 
35
-# TODO(odyssey4me):
36
-# This can be simplified once all the roles are using
37
-# python_venv_build. We can then switch to using a
38
-# set of constraints in pip.conf inside the venv,
39
-# perhaps prepared by giving a giving a list of
40
-# constraints to the role.
41
-manila_pip_install_args: >-
42
-  {{ manila_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
43
-  {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }}
44
-  {{ pip_install_options | default('') }}
36
+manila_pip_install_args: "{{ pip_install_options | default('') }}"
45 37
 
46 38
 # Name of the virtual env to deploy into
47 39
 manila_venv_tag: "{{ venv_tag | default('untagged') }}"
48 40
 manila_bin: "{{ _manila_bin }}"
49 41
 
50
-# venv_download, even when true, will use the fallback method of building the
51
-# venv from scratch if the venv download fails.
52
-manila_venv_download: "{{ not manila_developer_mode | bool }}"
53
-manila_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/manila.tgz
54
-
55 42
 # Enable/Disable Ceilometer
56 43
 manila_ceilometer_enabled: False
57 44
 
@@ -180,8 +167,6 @@ manila_osapi_share_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] |
180 167
 manila_rpc_executor_thread_pool_size: 64
181 168
 manila_rpc_response_timeout: 60
182 169
 
183
-manila_share_name_template: share-%s
184
-
185 170
 # osprofiler
186 171
 manila_profiler_enabled: false
187 172
 # manila_profiler_hmac_key is set in user_secrets.yml
@@ -202,13 +187,13 @@ manila_quota_share_networks: 10
202 187
 #     share_backend_name: LVM
203 188
 #     share_driver: manila.share.drivers.lvm.LVMShareDriver
204 189
 #     driver_handles_share_servers: False
205
-#     lvm_share_volume_group: manila-shares
190
+#     lvm_share_volume_group: manila_shares
206 191
 #     lvm_share_export_ip: <server-ip>
207 192
 
208 193
 # manila_backend_lvm_inuse: True if current host has an lvm backend
209
-manila_backend_lvm_inuse: '{{ (manila_backends|default("")|to_json).find("lvm") != -1 }}'
194
+manila_backend_lvm_inuse: "{{ (manila_backends | default('') | to_json).find('lvm') != -1 }}"
210 195
 # manila_backend_rbd_inuse: True if the current host has an rbd backend
211
-manila_backend_rbd_inuse: '{{ (manila_backends|default("")|to_json).find("manila.share.drivers.cephfs") != -1 }}'
196
+manila_backend_rbd_inuse: "{{ (manila_backends | default('')|to_json).find('manila.share.drivers.cephfs') != -1 }}"
212 197
 
213 198
 ## Policy vars
214 199
 # Provide a list of access controls to update the default policy.json with. These changes will be merged
@@ -234,6 +219,8 @@ manila_pip_packages:
234 219
   - systemd-python
235 220
   - uwsgi
236 221
 
222
+manila_user_pip_packages: []
223
+
237 224
 manila_optional_oslomsg_amqp1_pip_packages:
238 225
   - oslo.messaging[amqp1]
239 226
 
@@ -244,35 +231,34 @@ manila_data_init_overrides: {}
244 231
 
245 232
 ## Service Name-Group Mapping
246 233
 manila_services:
247
-  manila-scheduler:
234
+  manila_scheduler:
248 235
     group: manila_scheduler
249 236
     service_name: manila-scheduler
250 237
     init_config_overrides: "{{ manila_scheduler_init_overrides }}"
251 238
     start_order: 1
252 239
     execstarts: "{{ manila_bin }}/manila-scheduler"
253 240
     execreloads: "/bin/kill -HUP $MAINPID"
254
-  manila-share:
241
+  manila_share:
255 242
     group: manila_share
256 243
     service_name: manila-share
257 244
     init_config_overrides: "{{ manila_share_init_overrides }}"
258 245
     start_order: 2
259 246
     execstarts: "{{ manila_bin }}/manila-share"
260 247
     execreloads: "/bin/kill -HUP $MAINPID"
261
-  manila-data:
262
-    group: manila_data
248
+  manila_data:
249
+    group: manila_share
263 250
     service_name: manila-data
264 251
     init_config_overrides: "{{ manila_data_init_overrides }}"
265 252
     start_order: 3
266
-    condition: False
267 253
     execstarts: "{{ manila_bin }}/manila-data"
268 254
     execreloads: "/bin/kill -HUP $MAINPID"
269
-  manila-api:
255
+  manila_api:
270 256
     group: manila_api
271 257
     service_name: manila-api
272 258
     init_config_overrides: "{{ manila_api_init_overrides }}"
273 259
     start_order: 4
274 260
     execstarts: "{{ manila_uwsgi_bin }}/uwsgi --autoload --ini /etc/uwsgi/manila-api.ini"
275
-    execreloads: "{{ manila_uwsgi_bin }}/uwsgi --reload /var/run/manila-api/manila-api.pid"
261
+    execreloads: "{{ manila_uwsgi_bin }}/uwsgi --reload /var/run/manila_api/manila-api.pid"
276 262
     wsgi_overrides: "{{ manila_api_uwsgi_ini_overrides }}"
277 263
     wsgi_app: True
278 264
     wsgi_name: manila-wsgi
@@ -307,5 +293,3 @@ manila_api_uwsgi_ini_overrides: {}
307 293
 manila_environment_overrides:
308 294
   Service:
309 295
     Environment: "PATH={{ manila_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
310
-
311
-_UUID_regex: "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}"

+ 4
- 4
doc/source/index.rst View File

@@ -5,10 +5,10 @@ Manila role for OpenStack-Ansible
5 5
 This Ansible role installs and configures OpenStack manila.
6 6
 
7 7
 The following manila services are managed by the role:
8
-    * manila-api
9
-    * manila-scheduler
10
-    * manila-share
11
-    * manila-data (untested)
8
+    * manila_api
9
+    * manila_scheduler
10
+    * manila_share
11
+    * manila_data (untested)
12 12
 
13 13
 .. toctree::
14 14
    :maxdepth: 2

+ 1
- 1
handlers/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
meta/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2018, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
meta/openstack-ansible.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2017, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
run_tests.sh View File

@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/env bash
2
-# Copyright 2015, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 65
- 41
tasks/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -30,28 +30,49 @@
30 30
     msg: "Switching installation methods for OpenStack services is not supported"
31 31
   when:
32 32
     - ansible_local is defined
33
-    - ansible_local.openstack_ansible is defined
34
-    - ansible_local.openstack_ansible.manila is defined
35
-    - ansible_local.openstack_ansible.manila.install_method is defined
36
-    - ansible_local.openstack_ansible.manila.install_method != manila_install_method
33
+    - ansible_local['openstack_ansible'] is defined
34
+    - ansible_local['openstack_ansible']['manila'] is defined
35
+    - ansible_local['openstack_ansible']['manila']['install_method'] is defined
36
+    - ansible_local['openstack_ansible']['manila']['install_method'] != manila_install_method
37
+
38
+- name: Check for rpc password
39
+  fail:
40
+    msg: >-
41
+      The optiton "manila_oslomsg_rpc_password" is not defined
42
+  when:
43
+    - manila_oslomsg_rpc_password is undefined
44
+
45
+- name: Check for mysql password
46
+  fail:
47
+    msg: >-
48
+      The optiton "manila_container_mysql_password" is not defined
49
+  when:
50
+    - manila_container_mysql_password is undefined
51
+
52
+- name: Check for service password
53
+  fail:
54
+    msg: >-
55
+      The optiton "manila_service_password" is not defined
56
+  when:
57
+    - manila_service_password is undefined
37 58
 
38 59
 - name: Gather variables for installation method
39 60
   include_vars: "{{ manila_install_method }}_install.yml"
40 61
   tags:
41 62
     - always
42 63
 
43
-- include: manila_lvm_config.yml
64
+- import_tasks: manila_lvm_config.yml
44 65
   when:
45
-    - "manila_services['manila-share']['group'] in group_names"
46
-    - "manila_backend_lvm_inuse | bool"
66
+    - manila_services['manila_share']['group'] in group_names
67
+    - manila_backend_lvm_inuse | bool
47 68
   tags:
48 69
     - manila-config
49 70
 
50
-- include: manila_pre_install.yml
71
+- import_tasks: manila_pre_install.yml
51 72
   tags:
52 73
     - manila-install
53 74
 
54
-- include: manila_install.yml
75
+- import_tasks: manila_install.yml
55 76
   tags:
56 77
     - manila-install
57 78
 
@@ -62,20 +83,18 @@
62 83
   tags:
63 84
     - manila-config
64 85
 
65
-- include: manila_cleanup_old_facts.yml
66
-  when:
67
-    - "'need_db_sync' in ansible_local['openstack_ansible']['manila']"
86
+- import_tasks: manila_cleanup_old_facts.yml
68 87
   tags:
69 88
     - manila-config
70 89
 
71
-- include: manila_post_install.yml
90
+- import_tasks: manila_post_install.yml
72 91
   tags:
73 92
     - manila-config
74 93
 
75
-- import_tasks: mq_setup.yml
94
+- include_tasks: mq_setup.yml
76 95
   when:
77
-    - "manila_services['manila-api']['group'] in group_names"
78
-    - "inventory_hostname == ((groups[manila_services['manila-api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
96
+    - "manila_services['manila_api']['group'] in group_names"
97
+    - "inventory_hostname == ((groups[manila_services['manila_api']['group']]| intersect(ansible_play_hosts)) | list)[0]"
79 98
   vars:
80 99
     _oslomsg_rpc_setup_host: "{{ manila_oslomsg_rpc_setup_host }}"
81 100
     _oslomsg_rpc_userid: "{{ manila_oslomsg_rpc_userid }}"
@@ -91,48 +110,53 @@
91 110
     - common-mq
92 111
     - manila-config
93 112
 
94
-- include: manila_db_setup.yml
95
-  static: no
113
+- include_tasks: manila_db_setup.yml
96 114
   when:
97
-    - "groups['manila_api'] | length > 0"
98
-    - "manila_services['manila-api']['group'] in group_names"
99
-    - "inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]"
100
-  tags:
101
-    - manila-config
102
-
103
-- include: manila_uwsgi.yml
115
+    - groups['manila_api'] | length > 0
116
+    - manila_services['manila_api']['group'] in group_names
117
+    - inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]
104 118
   tags:
105 119
     - manila-config
106 120
 
107
-- include: manila_service_setup.yml
108
-  static: no
109
-  when:
110
-    - "groups['manila_api'] | length > 0"
111
-    - "manila_services['manila-api']['group'] in group_names"
112
-    - "inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]"
121
+- import_tasks: manila_uwsgi.yml
113 122
   tags:
114 123
     - manila-config
115 124
 
116
-- name: Include ceph_client role
125
+- name: import_tasks ceph_client role
117 126
   include_role:
118 127
     name: ceph_client
119 128
   vars:
120 129
     openstack_service_system_user: "{{ manila_system_user_name }}"
121
-    openstack_service_venv_bin: "{{ (manila_install_method == 'source') | ternary(manila_bin,'/usr/local/bin') }}"
130
+    openstack_service_venv_bin: "{{ manila_bin }}"
122 131
   when:
123
-    - "manila_services['manila-share']['group'] in group_names"
124
-    - "manila_backend_rbd_inuse | bool"
132
+    - manila_services['manila_share']['group'] in group_names
133
+    - manila_backend_rbd_inuse | bool
125 134
   tags:
126 135
     - ceph
127 136
 
137
+- include_tasks: manila_backend_cephfs.yml
138
+  when:
139
+    - (manila_enabled_share_protocols | join('\n')) | regex_search('^ceph.*', multiline=True, ignorecase=True)
140
+    - manila_services['manila_share']['group'] in group_names
141
+  with_dict: "{{ _manila_backends | default({}) }}"
142
+  tags:
143
+    - manila-config
144
+
145
+- include_tasks: manila_service_setup.yml
146
+  when:
147
+    - groups['manila_api'] | length > 0
148
+    - manila_services['manila_api']['group'] in group_names
149
+    - inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]
150
+  tags:
151
+    - manila-config
152
+
128 153
 - name: Flush handlers
129 154
   meta: flush_handlers
130 155
 
131
-- include: manila_backends.yml
132
-  static: no
156
+- include_tasks: manila_backends.yml
133 157
   when:
134
-    - "groups[manila_services['manila-share']['group']] | length > 0"
135
-    - "manila_services['manila-api']['group'] in group_names"
136
-    - "inventory_hostname == ((groups[manila_services['manila-api']['group']] | intersect(ansible_play_hosts)) | list)[-1]"
158
+    - groups[manila_services['manila_share']['group']] | length > 0
159
+    - manila_services['manila_api']['group'] in group_names
160
+    - inventory_hostname == ((groups[manila_services['manila_api']['group']] | intersect(ansible_play_hosts)) | list)[-1]
137 161
   tags:
138 162
     - manila-config

+ 1
- 1
tasks/manila_backend_cephfs.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2018, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 4
- 12
tasks/manila_backends.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
34 34
 - name: Create singular manila_backends variable for all hosts
35 35
   set_fact:
36 36
     _manila_backends: "{{ (_manila_backends | default(manila_backends | default({}))) | combine(hostvars[item]['manila_backends'] | default({})) }}"
37
-  with_items: "{{ groups[manila_services['manila-share']['group']] }}"
37
+  with_items: "{{ groups[manila_services['manila_share']['group']] }}"
38 38
 
39 39
 - name: Add in manila devices types
40 40
   shell: |
@@ -42,17 +42,9 @@
42 42
     CLI_OPTIONS="--endpoint-type internalURL {{ ((keystone_service_adminuri_insecure | bool) or (manila_service_internaluri_insecure | bool)) | ternary('--insecure','') }}"
43 43
     if ! {{ manila_bin }}/manila ${CLI_OPTIONS} type-list | grep -q "{{ item.key }}"; then
44 44
       {{ manila_bin }}/manila ${CLI_OPTIONS} type-create "{{ item.key }}" "{{ item.value.driver_handles_share_servers }}"
45
+      {{ manila_bin }}/manila ${CLI_OPTIONS} type-key "{{ item.key }}" set "share_backend_name={{ item.value.share_backend_name }}"
45 46
     fi
46 47
   args:
47 48
     executable: /bin/bash
48
-  with_dict: "{{ _manila_backends|default({}) }}"
49
+  with_dict: "{{ _manila_backends | default({}) }}"
49 50
   changed_when: false
50
-
51
-- include: manila_backend_cephfs.yml
52
-  static: no
53
-  when:
54
-    - (item|default("")|to_json).find("manila.share.drivers.cephfs") != -1
55
-    - "manila_services['manila-share']['group'] in group_names"
56
-  with_dict: "{{ _manila_backends|default({}) }}"
57
-  tags:
58
-    - manila-config

+ 1
- 1
tasks/manila_cleanup_old_facts.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2017, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 6
- 6
tasks/manila_db_setup.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
21 21
     name: "{{ manila_galera_database }}"
22 22
     state: "present"
23 23
   delegate_to: "{{ manila_db_setup_host }}"
24
-  no_log: True
24
+  no_log: true
25 25
 
26 26
 - name: Grant access to the DB for the service
27 27
   mysql_user:
@@ -37,7 +37,7 @@
37 37
   with_items:
38 38
     - "localhost"
39 39
     - "%"
40
-  no_log: True
40
+  no_log: true
41 41
 
42 42
 - name: Perform a manila DB sync
43 43
   command: "{{ manila_bin }}/manila-manage db sync"
@@ -50,8 +50,8 @@
50 50
   become: yes
51 51
   become_user: "{{ manila_system_user_name }}"
52 52
   when:
53
-    - "(manila_all_software_updated | default('no')) | bool"
54
-    - "ansible_local['openstack_ansible']['manila']['need_online_data_migrations'] | bool"
53
+    - (manila_all_software_updated | default(false)) | bool
54
+    - ansible_local['openstack_ansible']['manila']['need_online_data_migrations'] | bool
55 55
   changed_when: false
56 56
   register: data_migrations
57 57
 
@@ -60,7 +60,7 @@
60 60
     dest: "/etc/ansible/facts.d/openstack_ansible.fact"
61 61
     section: manila
62 62
     option: need_online_data_migrations
63
-    value: False
63
+    value: false
64 64
   when:
65 65
     - not data_migrations | skipped
66 66
     - data_migrations  is succeeded

+ 39
- 15
tasks/manila_install.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -36,9 +36,27 @@
36 36
   retries: 5
37 37
   delay: 2
38 38
 
39
+- name: Install the python venv
40
+  include_role:
41
+    name: "python_venv_build"
42
+  vars:
43
+    venv_build_distro_package_list: "{{ manila_devel_distro_packages }}"
44
+    venv_install_destination_path: "{{ manila_bin | dirname }}"
45
+    venv_pip_install_args: "{{ manila_pip_install_args }}"
46
+    venv_pip_packages: >-
47
+      {{ manila_pip_packages |
48
+           union(manila_user_pip_packages) |
49
+             union(((manila_oslomsg_amqp1_enabled | bool) | ternary(manila_optional_oslomsg_amqp1_pip_packages, []))) }}
50
+    venv_facts_when_changed:
51
+      - section: "manila"
52
+        option: "venv_tag"
53
+        value: "{{ manila_venv_tag }}"
54
+  when: manila_install_method == 'source'
55
+
39 56
 - name: Install manila packages from PIP
40 57
   include_tasks: manila_install_source.yml
41
-  when: manila_install_method == 'source'
58
+  when:
59
+    - manila_install_method == 'source'
42 60
 
43 61
 - name: Run the systemd service role
44 62
   include_role:
@@ -54,16 +72,22 @@
54 72
     systemd_BlockIOAccounting: true
55 73
     systemd_MemoryAccounting: true
56 74
     systemd_TasksAccounting: true
57
-    systemd_services:
58
-      - service_name: "{{ service_var.service_name }}"
59
-        enabled: yes
60
-        state: started
61
-        execstarts: "{{ service_var.execstarts }}"
62
-        execreloads: "{{ service_var.execreloads | default([]) }}"
63
-        config_overrides: "{{ manila_environment_overrides | combine(service_var.init_config_overrides) }}"
64
-  with_items: "{{ filtered_manila_services }}"
65
-  loop_control:
66
-    loop_var: service_var
75
+    systemd_services: |-
76
+      {% set services = [] %}
77
+      {% for service in filtered_manila_services %}
78
+      {%
79
+        set _ = service.update(
80
+          {
81
+            'enabled': 'yes',
82
+            'state': 'started',
83
+            'config_overrides': service.init_config_overrides
84
+          }
85
+        )
86
+      %}
87
+      {%   set _ = service.pop('init_config_overrides') -%}
88
+      {%   set _ = services.append(service) -%}
89
+      {% endfor %}
90
+      {{ services }}
67 91
   tags:
68 92
     - manila-config
69 93
     - systemd-service
@@ -78,6 +102,6 @@
78 102
     - "need_online_data_migrations"
79 103
     - "need_service_restart"
80 104
   when:
81
-        (install_packages | changed) or
82
-        ('need_online_data_migrations' not in ansible_local['openstack_ansible']['manila']) or
83
-        ('need_service_restart' not in ansible_local['openstack_ansible']['manila'])
105
+    - (install_packages is changed) or
106
+      ('need_online_data_migrations' not in ansible_local['openstack_ansible']['manila']) or
107
+      ('need_service_restart' not in ansible_local['openstack_ansible']['manila'])

+ 0
- 71
tasks/manila_install_source.yml View File

@@ -1,71 +0,0 @@
1
----
2
-# Copyright 2014, Rackspace US, Inc.
3
-#
4
-# Licensed under the Apache License, Version 2.0 (the "License");
5
-# you may not use this file except in compliance with the License.
6
-# You may obtain a copy of the License at
7
-#
8
-#     http://www.apache.org/licenses/LICENSE-2.0
9
-#
10
-# Unless required by applicable law or agreed to in writing, software
11
-# distributed under the License is distributed on an "AS IS" BASIS,
12
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-# See the License for the specific language governing permissions and
14
-# limitations under the License.
15
-
16
-# TODO(odyssey4me):
17
-# This can be simplified once all the roles are using
18
-# python_venv_build. We can then switch to using a
19
-# set of constraints in pip.conf inside the venv,
20
-# perhaps prepared by giving a giving a list of
21
-# constraints to the role.
22
-- name: Create developer mode constraint file
23
-  copy:
24
-    dest: "/opt/developer-pip-constraints.txt"
25
-    content: |
26
-      {% for item in manila_developer_constraints %}
27
-      {{ item }}
28
-      {% endfor %}
29
-  when: manila_developer_mode | bool
30
-
31
-- name: Ensure remote wheel building is disabled in developer mode
32
-  set_fact:
33
-    venv_build_host: "{{ ansible_hostname }}"
34
-  when:
35
-    - manila_developer_mode | bool
36
-
37
-- name: Install the python venv
38
-  include_role:
39
-    name: "python_venv_build"
40
-    private: yes
41
-  vars:
42
-    venv_build_distro_package_list: "{{ manila_devel_distro_packages }}"
43
-    venv_install_destination_path: "{{ manila_bin | dirname }}"
44
-    venv_install_distro_package_list: "{{ manila_distro_packages }}"
45
-    venv_pip_install_args: "{{ manila_pip_install_args }}"
46
-    venv_pip_packages: >-
47
-      {{ manila_pip_packages +
48
-         (manila_oslomsg_amqp1_enabled | bool) | ternary(manila_optional_oslomsg_amqp1_pip_packages, []) }}
49
-    venv_facts_when_changed:
50
-      - section: "manila"
51
-        option: "need_service_restart"
52
-        value: True
53
-      - section: "manila"
54
-        option: "need_online_data_migrations"
55
-        value: True
56
-      - section: "manila"
57
-        option: "venv_tag"
58
-        value: "{{ manila_venv_tag }}"
59
-
60
-- name: Copy manila rootwrap filters
61
-  command: >-
62
-    rsync --archive --itemize-changes --delete
63
-    /openstack/venvs/manila-{{ manila_venv_tag }}/etc/manila/rootwrap.d/
64
-    /etc/manila/rootwrap.d/
65
-  args:
66
-    warn: no
67
-  register: _copy_rootwraps
68
-  changed_when: _copy_rootwraps.stdout != ''
69
-  notify:
70
-    - Manage LB
71
-    - Restart manila services

+ 5
- 3
tasks/manila_lvm_config.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -24,7 +24,8 @@
24 24
   file:
25 25
     state: "directory"
26 26
     path: "/etc/lvm"
27
-  when: lvm_devices.rc == 0
27
+  when:
28
+    - lvm_devices.rc == 0
28 29
 
29 30
 - name: Drop lvm Config
30 31
   template:
@@ -33,4 +34,5 @@
33 34
     owner: "root"
34 35
     group: "root"
35 36
     backup: "yes"
36
-  when: lvm_devices.rc == 0
37
+  when:
38
+    - lvm_devices.rc == 0

+ 1
- 1
tasks/manila_post_install.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 5
- 5
tasks/manila_pre_install.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
16 16
 - name: create the system group
17 17
   group:
18 18
     name: "{{ manila_system_group_name }}"
19
-    gid: "{{ manila_system_group_gid|default(omit) }}"
19
+    gid: "{{ manila_system_group_gid | default(omit) }}"
20 20
     state: "present"
21 21
     system: "yes"
22 22
 
@@ -35,9 +35,9 @@
35 35
   file:
36 36
     path: "{{ item.path }}"
37 37
     state: directory
38
-    owner: "{{ item.owner|default(manila_system_user_name) }}"
39
-    group: "{{ item.group|default(manila_system_group_name) }}"
40
-    mode: "{{ item.mode|default('0755') }}"
38
+    owner: "{{ item.owner | default(manila_system_user_name) }}"
39
+    group: "{{ item.group | default(manila_system_group_name) }}"
40
+    mode: "{{ item.mode | default('0755') }}"
41 41
   with_items:
42 42
     - { path: "/openstack", mode: "0755", owner: "root", group: "root" }
43 43
     - { path: "/var/cache/manila", mode: "0700" }

+ 2
- 3
tasks/manila_service_setup.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2014, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -21,8 +21,7 @@
21 21
 - name: Setup the service
22 22
   delegate_to: "{{ manila_service_setup_host }}"
23 23
   vars:
24
-    ansible_python_interpreter: >-
25
-      {{ (manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }}
24
+    ansible_python_interpreter: "{{ (manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }}"
26 25
   block:
27 26
     - name: Add services to the keystone service catalog
28 27
       os_keystone_service:

+ 3
- 2
tasks/manila_uwsgi.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2017, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -27,7 +27,8 @@
27 27
     config_overrides: "{{ item.wsgi_overrides }}"
28 28
     config_type: ini
29 29
   with_items: "{{ filtered_manila_services }}"
30
-  when: item.wsgi_app | default(False)
30
+  when:
31
+    - item.wsgi_app | default(false)
31 32
   notify:
32 33
     - Manage LB
33 34
     - Restart manila services

+ 5
- 5
tasks/mq_setup.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2018, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -23,8 +23,8 @@
23 23
 - name: Setup RPC MQ Service (RabbitMQ)
24 24
   delegate_to: "{{ _oslomsg_rpc_setup_host }}"
25 25
   when:
26
-    - "(_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))"
27
-    - "(_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'rabbit')"
26
+    - (_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))
27
+    - (_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'rabbit')
28 28
   tags:
29 29
     - common-rabbitmq
30 30
   block:
@@ -73,8 +73,8 @@
73 73
 - name: Setup RPC MQ Service (Qdrouterd)
74 74
   delegate_to: "{{ _oslomsg_rpc_setup_host }}"
75 75
   when:
76
-    - "(_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))"
77
-    - "(_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'amqp')"
76
+    - (_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))
77
+    - (_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'amqp')
78 78
   tags:
79 79
     - common-qdrouterd
80 80
   block:

+ 4
- 4
templates/manila.conf.j2 View File

@@ -37,14 +37,14 @@ storage_availability_zone = {{ manila_storage_availability_zone }}
37 37
 client_socket_timeout = {{ manila_client_socket_timeout }}
38 38
 
39 39
 {% if manila_enabled_share_protocols is defined %}
40
-enabled_share_protocols={{ manila_enabled_share_protocols }}
40
+enabled_share_protocols={{ manila_enabled_share_protocols | join(',') }}
41 41
 {% endif %}
42 42
 
43 43
 {% if manila_backends is defined %}
44
-enabled_share_backends={% for backend in manila_backends|dictsort %}{{ backend.0 }}{% if not loop.last %},{% endif %}{% endfor %}
44
+enabled_share_backends={% for backend in manila_backends | dictsort %}{{ backend.0 }}{% if not loop.last %},{% endif %}{% endfor %}
45 45
 
46 46
 # All given backend(s)
47
-{% for backend_section in manila_backends|dictsort %}
47
+{% for backend_section in manila_backends | dictsort %}
48 48
 [{{ backend_section.0 }}]
49 49
 {% for key, value in (backend_section.1 | dictsort) if key not in ['extra_share_types', 'shares'] %}
50 50
 {{ key }}={{ value }}
@@ -60,7 +60,7 @@ connection = mysql+pymysql://{{ manila_galera_user }}:{{ manila_container_mysql_
60 60
 ssl = {{ manila_oslomsg_rpc_use_ssl }}
61 61
 
62 62
 [oslo_messaging_notifications]
63
-driver = {% if manila_ceilometer_enabled %}messagingv2{% else %}noop{% endif %}
63
+driver = {{ (manila_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}
64 64
 transport_url = {{ manila_oslomsg_notify_transport }}://{% for host in manila_oslomsg_notify_servers.split(',') %}{{ manila_oslomsg_notify_userid }}:{{ manila_oslomsg_notify_password }}@{{ host }}:{{ manila_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ manila_oslomsg_notify_vhost }}{% if manila_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
65 65
 
66 66
 [oslo_concurrency]

+ 1
- 1
tests/group_vars/all_containers.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
tests/host_vars/infra1.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
tests/host_vars/localhost.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
tests/host_vars/manila1.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
tests/host_vars/openstack1.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 1
- 1
tests/host_vars/storage1.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 8
- 3
tests/os_manila-overrides.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2016, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ tempest_run: yes
17 17
 tempest_test_whitelist:
18 18
   - smoke
19 19
   - manila_tempest_tests.tests.scenario.test_share_basic_ops
20
+
20 21
 tempest_test_blacklist:
21 22
   - test: tempest.api.identity
22 23
     reason: Reducing run time and required resources
@@ -32,7 +33,7 @@ tempest_test_blacklist:
32 33
     reason: Reducing run time and required resources
33 34
   - test: tempest.scenario.test_network_basic_ops
34 35
     reason: Reducing run time and required resources
35
-tempest_service_available_manila: True
36
+
36 37
 tempest_plugins: "{{ _tempest_plugins['keystone'] + _tempest_plugins['manila'] }}"
37 38
 
38 39
 tempest_tempest_conf_overrides:
@@ -90,6 +91,8 @@ manila_backends:
90 91
     driver_handles_share_servers: False
91 92
     lvm_share_volume_group: manila-shares
92 93
     lvm_share_export_ip: "10.1.1.1"
94
+    filter_function: "share.size >= 0"
95
+    goodness_function: "share.size >= 0"
93 96
   generic:
94 97
     share_backend_name: GENERIC
95 98
     share_driver: manila.share.drivers.generic.GenericShareDriver
@@ -99,6 +102,8 @@ manila_backends:
99 102
     service_instance_user: manila
100 103
     service_instance_password: manila
101 104
     interface_driver: manila.network.linux.interface.BridgeInterfaceDriver
105
+    filter_function: "share.size >= 0"
106
+    goodness_function: "share.size >= 0"
102 107
 
103 108
 test_manila_api_group: "{{ ((groups['manila_api'] is defined) and (groups['manila_api'] | length > 0)) | ternary('manila_api', 'all_containers') }}"
104 109
 test_manila_share_group: "{{ ((groups['manila_share'] is defined) and (groups['manila_share'] | length > 0)) | ternary('manila_share', 'all_containers') }}"
@@ -108,7 +113,7 @@ manila_container_mysql_password: "SuperSecrete"
108 113
 manila_developer_mode: true
109 114
 manila_git_install_branch: "{{ test_branch }}"
110 115
 manila_profiler_hmac_key: "secrete"
111
-manila_oslomsg_rpc_password: "{{ oslomsg_rpc_password }}"
116
+manila_oslomsg_rpc_password: "secrete"
112 117
 manila_oslomsg_notify_password: "{{ oslomsg_notify_password }}"
113 118
 manila_service_password: "secrete"
114 119
 manila_venv_tag: "testing"

+ 1
- 1
tests/test-install-manila.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2015, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 3
- 3
tests/test-setup-manila-localhost.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2015, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
13 13
 # See the License for the specific language governing permissions and
14 14
 # limitations under the License.
15 15
 
16
-- name: Prepare manila-shares share group
16
+- name: Prepare manila_shares share group
17 17
   hosts: localhost
18 18
   # This set of tasks runs against localhost
19 19
   # and requires root access, but tests run as
@@ -48,7 +48,7 @@
48 48
         - "pvcreate {{ manila_losetup.stdout }}"
49 49
         - "pvscan"
50 50
 
51
-    - name: Add manila-shares share group
51
+    - name: Add manila_shares share group
52 52
       lvg:
53 53
         vg: "{{ manila_lvm_vg_name | default('manila-shares') }}"
54 54
         pvs: "{{ manila_losetup.stdout }}"

+ 3
- 3
tests/test.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2015, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
16 16
 # Setup the host
17 17
 - import_playbook: common/test-setup-host.yml
18 18
 
19
-# Prepare the manila-share VG
19
+# Prepare the manila_share VG
20 20
 - import_playbook: test-setup-manila-localhost.yml
21 21
 
22
-# Prepare the manila-share VG
22
+# Prepare the manila_share VG
23 23
 - import_playbook: common/test-setup-cinder-localhost.yml
24 24
 
25 25
 # Install RabbitMQ/MariaDB

+ 3
- 3
vars/distro_install.yml View File

@@ -20,16 +20,16 @@
20 20
 #
21 21
 manila_package_list: |-
22 22
   {% set packages = manila_service_distro_packages %}
23
-  {% if manila_services['manila-share']['group'] in group_names %}
23
+  {% if manila_services['manila_share']['group'] in group_names %}
24 24
   {%   set _ = packages.extend(manila_share_distro_packages) %}
25 25
   {%   if manila_backend_lvm_inuse | bool %}
26 26
   {%     set _ = packages.extend(manila_lvm_share_distro_packages) %}
27 27
   {%   endif %}
28 28
   {% endif %}
29
-  {% if manila_services['manila-api']['group'] in group_names %}
29
+  {% if manila_services['manila_api']['group'] in group_names %}
30 30
   {%   set _ = packages.extend(manila_api_distro_packages) %}
31 31
   {% endif %}
32
-  {% if manila_services['manila-scheduler']['group'] in group_names %}
32
+  {% if manila_services['manila_scheduler']['group'] in group_names %}
33 33
   {%   set _ = packages.extend(manila_scheduler_distro_packages) %}
34 34
   {% endif %}
35 35
   {% if manila_developer_mode | bool %}

+ 1
- 1
vars/main.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2017, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.

+ 2
- 2
vars/source_install.yml View File

@@ -1,5 +1,5 @@
1 1
 ---
2
-# Copyright 2017, Rackspace US, Inc.
2
+# Copyright 2019, Rackspace US, Inc.
3 3
 #
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
20 20
 #
21 21
 manila_package_list: |-
22 22
   {% set packages = manila_distro_packages %}
23
-  {% if manila_services['manila-share']['group'] in group_names %}
23
+  {% if manila_services['manila_share']['group'] in group_names %}
24 24
   {%   set _ = packages.extend(manila_share_deps_distro_packages) %}
25 25
   {%   if manila_backend_lvm_inuse | bool %}
26 26
   {%     set _ = packages.extend(manila_lvm_share_distro_packages) %}

+ 1
- 9
zuul.d/project.yaml View File

@@ -1,4 +1,4 @@
1
-# Copyright 2017, Rackspace US, Inc.
1
+# Copyright 2019, Rackspace US, Inc.
2 2
 #
3 3
 # Licensed under the Apache License, Version 2.0 (the "License");
4 4
 # you may not use this file except in compliance with the License.
@@ -17,11 +17,3 @@
17 17
       - check-requirements
18 18
       - publish-openstack-docs-pti
19 19
       - release-notes-jobs-python3
20
-    check:
21
-      jobs:
22
-        - openstack-ansible-functional-ubuntu-bionic
23
-        - openstack-ansible-functional-distro_install-ubuntu-bionic:
24
-            voting: false
25
-    gate:
26
-      jobs:
27
-        - openstack-ansible-functional-ubuntu-bionic

Loading…
Cancel
Save