diff --git a/defaults/main.yml b/defaults/main.yml index 9f88a70..631609e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,30 +28,17 @@ manila_install_method: "source" manila_git_repo: https://git.openstack.org/openstack/manila manila_git_install_branch: master -manila_developer_mode: false -manila_developer_constraints: +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')) }}" +manila_git_constraints: - "git+{{ manila_git_repo }}@{{ manila_git_install_branch }}#egg=manila" + - "--constraint {{ barbican_upper_constraints_url }}" -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -manila_pip_install_args: >- - {{ manila_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }} - {{ pip_install_options | default('') }} +manila_pip_install_args: "{{ pip_install_options | default('') }}" # Name of the virtual env to deploy into manila_venv_tag: "{{ venv_tag | default('untagged') }}" manila_bin: "{{ _manila_bin }}" -# venv_download, even when true, will use the fallback method of building the -# venv from scratch if the venv download fails. -manila_venv_download: "{{ not manila_developer_mode | bool }}" -manila_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/manila.tgz - # Enable/Disable Ceilometer manila_ceilometer_enabled: False @@ -180,8 +167,6 @@ manila_osapi_share_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | manila_rpc_executor_thread_pool_size: 64 manila_rpc_response_timeout: 60 -manila_share_name_template: share-%s - # osprofiler manila_profiler_enabled: false # manila_profiler_hmac_key is set in user_secrets.yml @@ -202,13 +187,13 @@ manila_quota_share_networks: 10 # share_backend_name: LVM # share_driver: manila.share.drivers.lvm.LVMShareDriver # driver_handles_share_servers: False -# lvm_share_volume_group: manila-shares +# lvm_share_volume_group: manila_shares # lvm_share_export_ip: # manila_backend_lvm_inuse: True if current host has an lvm backend -manila_backend_lvm_inuse: '{{ (manila_backends|default("")|to_json).find("lvm") != -1 }}' +manila_backend_lvm_inuse: "{{ (manila_backends | default('') | to_json).find('lvm') != -1 }}" # manila_backend_rbd_inuse: True if the current host has an rbd backend -manila_backend_rbd_inuse: '{{ (manila_backends|default("")|to_json).find("manila.share.drivers.cephfs") != -1 }}' +manila_backend_rbd_inuse: "{{ (manila_backends | default('')|to_json).find('manila.share.drivers.cephfs') != -1 }}" ## Policy vars # 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: - systemd-python - uwsgi +manila_user_pip_packages: [] + manila_optional_oslomsg_amqp1_pip_packages: - oslo.messaging[amqp1] @@ -244,35 +231,34 @@ manila_data_init_overrides: {} ## Service Name-Group Mapping manila_services: - manila-scheduler: + manila_scheduler: group: manila_scheduler service_name: manila-scheduler init_config_overrides: "{{ manila_scheduler_init_overrides }}" start_order: 1 execstarts: "{{ manila_bin }}/manila-scheduler" execreloads: "/bin/kill -HUP $MAINPID" - manila-share: + manila_share: group: manila_share service_name: manila-share init_config_overrides: "{{ manila_share_init_overrides }}" start_order: 2 execstarts: "{{ manila_bin }}/manila-share" execreloads: "/bin/kill -HUP $MAINPID" - manila-data: - group: manila_data + manila_data: + group: manila_share service_name: manila-data init_config_overrides: "{{ manila_data_init_overrides }}" start_order: 3 - condition: False execstarts: "{{ manila_bin }}/manila-data" execreloads: "/bin/kill -HUP $MAINPID" - manila-api: + manila_api: group: manila_api service_name: manila-api init_config_overrides: "{{ manila_api_init_overrides }}" start_order: 4 execstarts: "{{ manila_uwsgi_bin }}/uwsgi --autoload --ini /etc/uwsgi/manila-api.ini" - execreloads: "{{ manila_uwsgi_bin }}/uwsgi --reload /var/run/manila-api/manila-api.pid" + execreloads: "{{ manila_uwsgi_bin }}/uwsgi --reload /var/run/manila_api/manila-api.pid" wsgi_overrides: "{{ manila_api_uwsgi_ini_overrides }}" wsgi_app: True wsgi_name: manila-wsgi @@ -307,5 +293,3 @@ manila_api_uwsgi_ini_overrides: {} manila_environment_overrides: Service: Environment: "PATH={{ manila_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -_UUID_regex: "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}" diff --git a/doc/source/index.rst b/doc/source/index.rst index cf39dea..d86fcfd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -5,10 +5,10 @@ Manila role for OpenStack-Ansible This Ansible role installs and configures OpenStack manila. The following manila services are managed by the role: - * manila-api - * manila-scheduler - * manila-share - * manila-data (untested) + * manila_api + * manila_scheduler + * manila_share + * manila_data (untested) .. toctree:: :maxdepth: 2 diff --git a/handlers/main.yml b/handlers/main.yml index 549d7f2..ea27b91 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/meta/main.yml b/meta/main.yml index 53cff58..7d3e541 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,5 +1,5 @@ --- -# Copyright 2018, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/meta/openstack-ansible.yml b/meta/openstack-ansible.yml index b2c7aa2..015c743 100644 --- a/meta/openstack-ansible.yml +++ b/meta/openstack-ansible.yml @@ -1,5 +1,5 @@ --- -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/run_tests.sh b/run_tests.sh index cbffb04..db7a1a1 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2015, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tasks/main.yml b/tasks/main.yml index ec9fbcf..9249f64 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,28 +30,49 @@ msg: "Switching installation methods for OpenStack services is not supported" when: - ansible_local is defined - - ansible_local.openstack_ansible is defined - - ansible_local.openstack_ansible.manila is defined - - ansible_local.openstack_ansible.manila.install_method is defined - - ansible_local.openstack_ansible.manila.install_method != manila_install_method + - ansible_local['openstack_ansible'] is defined + - ansible_local['openstack_ansible']['manila'] is defined + - ansible_local['openstack_ansible']['manila']['install_method'] is defined + - ansible_local['openstack_ansible']['manila']['install_method'] != manila_install_method + +- name: Check for rpc password + fail: + msg: >- + The optiton "manila_oslomsg_rpc_password" is not defined + when: + - manila_oslomsg_rpc_password is undefined + +- name: Check for mysql password + fail: + msg: >- + The optiton "manila_container_mysql_password" is not defined + when: + - manila_container_mysql_password is undefined + +- name: Check for service password + fail: + msg: >- + The optiton "manila_service_password" is not defined + when: + - manila_service_password is undefined - name: Gather variables for installation method include_vars: "{{ manila_install_method }}_install.yml" tags: - always -- include: manila_lvm_config.yml +- import_tasks: manila_lvm_config.yml when: - - "manila_services['manila-share']['group'] in group_names" - - "manila_backend_lvm_inuse | bool" + - manila_services['manila_share']['group'] in group_names + - manila_backend_lvm_inuse | bool tags: - manila-config -- include: manila_pre_install.yml +- import_tasks: manila_pre_install.yml tags: - manila-install -- include: manila_install.yml +- import_tasks: manila_install.yml tags: - manila-install @@ -62,20 +83,18 @@ tags: - manila-config -- include: manila_cleanup_old_facts.yml - when: - - "'need_db_sync' in ansible_local['openstack_ansible']['manila']" +- import_tasks: manila_cleanup_old_facts.yml tags: - manila-config -- include: manila_post_install.yml +- import_tasks: manila_post_install.yml tags: - manila-config -- import_tasks: mq_setup.yml +- include_tasks: mq_setup.yml when: - - "manila_services['manila-api']['group'] in group_names" - - "inventory_hostname == ((groups[manila_services['manila-api']['group']]| intersect(ansible_play_hosts)) | list)[0]" + - "manila_services['manila_api']['group'] in group_names" + - "inventory_hostname == ((groups[manila_services['manila_api']['group']]| intersect(ansible_play_hosts)) | list)[0]" vars: _oslomsg_rpc_setup_host: "{{ manila_oslomsg_rpc_setup_host }}" _oslomsg_rpc_userid: "{{ manila_oslomsg_rpc_userid }}" @@ -91,48 +110,53 @@ - common-mq - manila-config -- include: manila_db_setup.yml - static: no +- include_tasks: manila_db_setup.yml when: - - "groups['manila_api'] | length > 0" - - "manila_services['manila-api']['group'] in group_names" - - "inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]" + - groups['manila_api'] | length > 0 + - manila_services['manila_api']['group'] in group_names + - inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0] tags: - manila-config -- include: manila_uwsgi.yml +- import_tasks: manila_uwsgi.yml tags: - manila-config -- include: manila_service_setup.yml - static: no - when: - - "groups['manila_api'] | length > 0" - - "manila_services['manila-api']['group'] in group_names" - - "inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0]" - tags: - - manila-config - -- name: Include ceph_client role +- name: import_tasks ceph_client role include_role: name: ceph_client vars: openstack_service_system_user: "{{ manila_system_user_name }}" - openstack_service_venv_bin: "{{ (manila_install_method == 'source') | ternary(manila_bin,'/usr/local/bin') }}" + openstack_service_venv_bin: "{{ manila_bin }}" when: - - "manila_services['manila-share']['group'] in group_names" - - "manila_backend_rbd_inuse | bool" + - manila_services['manila_share']['group'] in group_names + - manila_backend_rbd_inuse | bool tags: - ceph +- include_tasks: manila_backend_cephfs.yml + when: + - (manila_enabled_share_protocols | join('\n')) | regex_search('^ceph.*', multiline=True, ignorecase=True) + - manila_services['manila_share']['group'] in group_names + with_dict: "{{ _manila_backends | default({}) }}" + tags: + - manila-config + +- include_tasks: manila_service_setup.yml + when: + - groups['manila_api'] | length > 0 + - manila_services['manila_api']['group'] in group_names + - inventory_hostname == ((groups['manila_api'] | intersect(ansible_play_hosts)) | list)[0] + tags: + - manila-config + - name: Flush handlers meta: flush_handlers -- include: manila_backends.yml - static: no +- include_tasks: manila_backends.yml when: - - "groups[manila_services['manila-share']['group']] | length > 0" - - "manila_services['manila-api']['group'] in group_names" - - "inventory_hostname == ((groups[manila_services['manila-api']['group']] | intersect(ansible_play_hosts)) | list)[-1]" + - groups[manila_services['manila_share']['group']] | length > 0 + - manila_services['manila_api']['group'] in group_names + - inventory_hostname == ((groups[manila_services['manila_api']['group']] | intersect(ansible_play_hosts)) | list)[-1] tags: - manila-config diff --git a/tasks/manila_backend_cephfs.yml b/tasks/manila_backend_cephfs.yml index af28784..335e544 100644 --- a/tasks/manila_backend_cephfs.yml +++ b/tasks/manila_backend_cephfs.yml @@ -1,5 +1,5 @@ --- -# Copyright 2018, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tasks/manila_backends.yml b/tasks/manila_backends.yml index 2681642..1d34b41 100644 --- a/tasks/manila_backends.yml +++ b/tasks/manila_backends.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ - name: Create singular manila_backends variable for all hosts set_fact: _manila_backends: "{{ (_manila_backends | default(manila_backends | default({}))) | combine(hostvars[item]['manila_backends'] | default({})) }}" - with_items: "{{ groups[manila_services['manila-share']['group']] }}" + with_items: "{{ groups[manila_services['manila_share']['group']] }}" - name: Add in manila devices types shell: | @@ -42,17 +42,9 @@ CLI_OPTIONS="--endpoint-type internalURL {{ ((keystone_service_adminuri_insecure | bool) or (manila_service_internaluri_insecure | bool)) | ternary('--insecure','') }}" if ! {{ manila_bin }}/manila ${CLI_OPTIONS} type-list | grep -q "{{ item.key }}"; then {{ manila_bin }}/manila ${CLI_OPTIONS} type-create "{{ item.key }}" "{{ item.value.driver_handles_share_servers }}" + {{ manila_bin }}/manila ${CLI_OPTIONS} type-key "{{ item.key }}" set "share_backend_name={{ item.value.share_backend_name }}" fi args: executable: /bin/bash - with_dict: "{{ _manila_backends|default({}) }}" + with_dict: "{{ _manila_backends | default({}) }}" changed_when: false - -- include: manila_backend_cephfs.yml - static: no - when: - - (item|default("")|to_json).find("manila.share.drivers.cephfs") != -1 - - "manila_services['manila-share']['group'] in group_names" - with_dict: "{{ _manila_backends|default({}) }}" - tags: - - manila-config diff --git a/tasks/manila_cleanup_old_facts.yml b/tasks/manila_cleanup_old_facts.yml index 6cfc6ab..a10241b 100644 --- a/tasks/manila_cleanup_old_facts.yml +++ b/tasks/manila_cleanup_old_facts.yml @@ -1,5 +1,5 @@ --- -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tasks/manila_db_setup.yml b/tasks/manila_db_setup.yml index bb27e6c..3ff9e46 100644 --- a/tasks/manila_db_setup.yml +++ b/tasks/manila_db_setup.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ name: "{{ manila_galera_database }}" state: "present" delegate_to: "{{ manila_db_setup_host }}" - no_log: True + no_log: true - name: Grant access to the DB for the service mysql_user: @@ -37,7 +37,7 @@ with_items: - "localhost" - "%" - no_log: True + no_log: true - name: Perform a manila DB sync command: "{{ manila_bin }}/manila-manage db sync" @@ -50,8 +50,8 @@ become: yes become_user: "{{ manila_system_user_name }}" when: - - "(manila_all_software_updated | default('no')) | bool" - - "ansible_local['openstack_ansible']['manila']['need_online_data_migrations'] | bool" + - (manila_all_software_updated | default(false)) | bool + - ansible_local['openstack_ansible']['manila']['need_online_data_migrations'] | bool changed_when: false register: data_migrations @@ -60,7 +60,7 @@ dest: "/etc/ansible/facts.d/openstack_ansible.fact" section: manila option: need_online_data_migrations - value: False + value: false when: - not data_migrations | skipped - data_migrations is succeeded diff --git a/tasks/manila_install.yml b/tasks/manila_install.yml index ce1bac2..dcd5a0f 100644 --- a/tasks/manila_install.yml +++ b/tasks/manila_install.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,9 +36,27 @@ retries: 5 delay: 2 +- name: Install the python venv + include_role: + name: "python_venv_build" + vars: + venv_build_distro_package_list: "{{ manila_devel_distro_packages }}" + venv_install_destination_path: "{{ manila_bin | dirname }}" + venv_pip_install_args: "{{ manila_pip_install_args }}" + venv_pip_packages: >- + {{ manila_pip_packages | + union(manila_user_pip_packages) | + union(((manila_oslomsg_amqp1_enabled | bool) | ternary(manila_optional_oslomsg_amqp1_pip_packages, []))) }} + venv_facts_when_changed: + - section: "manila" + option: "venv_tag" + value: "{{ manila_venv_tag }}" + when: manila_install_method == 'source' + - name: Install manila packages from PIP include_tasks: manila_install_source.yml - when: manila_install_method == 'source' + when: + - manila_install_method == 'source' - name: Run the systemd service role include_role: @@ -54,16 +72,22 @@ systemd_BlockIOAccounting: true systemd_MemoryAccounting: true systemd_TasksAccounting: true - systemd_services: - - service_name: "{{ service_var.service_name }}" - enabled: yes - state: started - execstarts: "{{ service_var.execstarts }}" - execreloads: "{{ service_var.execreloads | default([]) }}" - config_overrides: "{{ manila_environment_overrides | combine(service_var.init_config_overrides) }}" - with_items: "{{ filtered_manila_services }}" - loop_control: - loop_var: service_var + systemd_services: |- + {% set services = [] %} + {% for service in filtered_manila_services %} + {% + set _ = service.update( + { + 'enabled': 'yes', + 'state': 'started', + 'config_overrides': service.init_config_overrides + } + ) + %} + {% set _ = service.pop('init_config_overrides') -%} + {% set _ = services.append(service) -%} + {% endfor %} + {{ services }} tags: - manila-config - systemd-service @@ -78,6 +102,6 @@ - "need_online_data_migrations" - "need_service_restart" when: - (install_packages | changed) or - ('need_online_data_migrations' not in ansible_local['openstack_ansible']['manila']) or - ('need_service_restart' not in ansible_local['openstack_ansible']['manila']) + - (install_packages is changed) or + ('need_online_data_migrations' not in ansible_local['openstack_ansible']['manila']) or + ('need_service_restart' not in ansible_local['openstack_ansible']['manila']) diff --git a/tasks/manila_install_source.yml b/tasks/manila_install_source.yml deleted file mode 100644 index 99d6738..0000000 --- a/tasks/manila_install_source.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -- name: Create developer mode constraint file - copy: - dest: "/opt/developer-pip-constraints.txt" - content: | - {% for item in manila_developer_constraints %} - {{ item }} - {% endfor %} - when: manila_developer_mode | bool - -- name: Ensure remote wheel building is disabled in developer mode - set_fact: - venv_build_host: "{{ ansible_hostname }}" - when: - - manila_developer_mode | bool - -- name: Install the python venv - include_role: - name: "python_venv_build" - private: yes - vars: - venv_build_distro_package_list: "{{ manila_devel_distro_packages }}" - venv_install_destination_path: "{{ manila_bin | dirname }}" - venv_install_distro_package_list: "{{ manila_distro_packages }}" - venv_pip_install_args: "{{ manila_pip_install_args }}" - venv_pip_packages: >- - {{ manila_pip_packages + - (manila_oslomsg_amqp1_enabled | bool) | ternary(manila_optional_oslomsg_amqp1_pip_packages, []) }} - venv_facts_when_changed: - - section: "manila" - option: "need_service_restart" - value: True - - section: "manila" - option: "need_online_data_migrations" - value: True - - section: "manila" - option: "venv_tag" - value: "{{ manila_venv_tag }}" - -- name: Copy manila rootwrap filters - command: >- - rsync --archive --itemize-changes --delete - /openstack/venvs/manila-{{ manila_venv_tag }}/etc/manila/rootwrap.d/ - /etc/manila/rootwrap.d/ - args: - warn: no - register: _copy_rootwraps - changed_when: _copy_rootwraps.stdout != '' - notify: - - Manage LB - - Restart manila services diff --git a/tasks/manila_lvm_config.yml b/tasks/manila_lvm_config.yml index 60de1ad..dbc92a3 100644 --- a/tasks/manila_lvm_config.yml +++ b/tasks/manila_lvm_config.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,8 @@ file: state: "directory" path: "/etc/lvm" - when: lvm_devices.rc == 0 + when: + - lvm_devices.rc == 0 - name: Drop lvm Config template: @@ -33,4 +34,5 @@ owner: "root" group: "root" backup: "yes" - when: lvm_devices.rc == 0 + when: + - lvm_devices.rc == 0 diff --git a/tasks/manila_post_install.yml b/tasks/manila_post_install.yml index 4d78814..9ea582d 100644 --- a/tasks/manila_post_install.yml +++ b/tasks/manila_post_install.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tasks/manila_pre_install.yml b/tasks/manila_pre_install.yml index 099fbf2..1668033 100644 --- a/tasks/manila_pre_install.yml +++ b/tasks/manila_pre_install.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ - name: create the system group group: name: "{{ manila_system_group_name }}" - gid: "{{ manila_system_group_gid|default(omit) }}" + gid: "{{ manila_system_group_gid | default(omit) }}" state: "present" system: "yes" @@ -35,9 +35,9 @@ file: path: "{{ item.path }}" state: directory - owner: "{{ item.owner|default(manila_system_user_name) }}" - group: "{{ item.group|default(manila_system_group_name) }}" - mode: "{{ item.mode|default('0755') }}" + owner: "{{ item.owner | default(manila_system_user_name) }}" + group: "{{ item.group | default(manila_system_group_name) }}" + mode: "{{ item.mode | default('0755') }}" with_items: - { path: "/openstack", mode: "0755", owner: "root", group: "root" } - { path: "/var/cache/manila", mode: "0700" } diff --git a/tasks/manila_service_setup.yml b/tasks/manila_service_setup.yml index e828f4f..765e5de 100644 --- a/tasks/manila_service_setup.yml +++ b/tasks/manila_service_setup.yml @@ -1,5 +1,5 @@ --- -# Copyright 2014, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,8 +21,7 @@ - name: Setup the service delegate_to: "{{ manila_service_setup_host }}" vars: - ansible_python_interpreter: >- - {{ (manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }} + ansible_python_interpreter: "{{ (manila_service_setup_host == 'localhost') | ternary(ansible_playbook_python, ansible_python['executable']) }}" block: - name: Add services to the keystone service catalog os_keystone_service: diff --git a/tasks/manila_uwsgi.yml b/tasks/manila_uwsgi.yml index 32cde77..811d17c 100644 --- a/tasks/manila_uwsgi.yml +++ b/tasks/manila_uwsgi.yml @@ -1,5 +1,5 @@ --- -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,8 @@ config_overrides: "{{ item.wsgi_overrides }}" config_type: ini with_items: "{{ filtered_manila_services }}" - when: item.wsgi_app | default(False) + when: + - item.wsgi_app | default(false) notify: - Manage LB - Restart manila services diff --git a/tasks/mq_setup.yml b/tasks/mq_setup.yml index b5f4766..a2d7ad4 100644 --- a/tasks/mq_setup.yml +++ b/tasks/mq_setup.yml @@ -1,5 +1,5 @@ --- -# Copyright 2018, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,8 +23,8 @@ - name: Setup RPC MQ Service (RabbitMQ) delegate_to: "{{ _oslomsg_rpc_setup_host }}" when: - - "(_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))" - - "(_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'rabbit')" + - (_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined)) + - (_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'rabbit') tags: - common-rabbitmq block: @@ -73,8 +73,8 @@ - name: Setup RPC MQ Service (Qdrouterd) delegate_to: "{{ _oslomsg_rpc_setup_host }}" when: - - "(_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined))" - - "(_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'amqp')" + - (_oslomsg_configure_rpc | default(_oslomsg_rpc_transport is defined)) + - (_oslomsg_rpc_transport is defined) and (_oslomsg_rpc_transport == 'amqp') tags: - common-qdrouterd block: diff --git a/templates/manila.conf.j2 b/templates/manila.conf.j2 index 0032490..e68eafc 100644 --- a/templates/manila.conf.j2 +++ b/templates/manila.conf.j2 @@ -37,14 +37,14 @@ storage_availability_zone = {{ manila_storage_availability_zone }} client_socket_timeout = {{ manila_client_socket_timeout }} {% if manila_enabled_share_protocols is defined %} -enabled_share_protocols={{ manila_enabled_share_protocols }} +enabled_share_protocols={{ manila_enabled_share_protocols | join(',') }} {% endif %} {% if manila_backends is defined %} -enabled_share_backends={% for backend in manila_backends|dictsort %}{{ backend.0 }}{% if not loop.last %},{% endif %}{% endfor %} +enabled_share_backends={% for backend in manila_backends | dictsort %}{{ backend.0 }}{% if not loop.last %},{% endif %}{% endfor %} # All given backend(s) -{% for backend_section in manila_backends|dictsort %} +{% for backend_section in manila_backends | dictsort %} [{{ backend_section.0 }}] {% for key, value in (backend_section.1 | dictsort) if key not in ['extra_share_types', 'shares'] %} {{ key }}={{ value }} @@ -60,7 +60,7 @@ connection = mysql+pymysql://{{ manila_galera_user }}:{{ manila_container_mysql_ ssl = {{ manila_oslomsg_rpc_use_ssl }} [oslo_messaging_notifications] -driver = {% if manila_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} +driver = {{ (manila_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} 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 %} [oslo_concurrency] diff --git a/tests/group_vars/all_containers.yml b/tests/group_vars/all_containers.yml index 0a2006e..c81b9c2 100644 --- a/tests/group_vars/all_containers.yml +++ b/tests/group_vars/all_containers.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/host_vars/infra1.yml b/tests/host_vars/infra1.yml index 5d13742..a6f0165 100644 --- a/tests/host_vars/infra1.yml +++ b/tests/host_vars/infra1.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/host_vars/localhost.yml b/tests/host_vars/localhost.yml index f88d96b..301c483 100644 --- a/tests/host_vars/localhost.yml +++ b/tests/host_vars/localhost.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/host_vars/manila1.yml b/tests/host_vars/manila1.yml index b0a493a..99ecb74 100644 --- a/tests/host_vars/manila1.yml +++ b/tests/host_vars/manila1.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/host_vars/openstack1.yml b/tests/host_vars/openstack1.yml index 86dc31f..a3f3f4b 100644 --- a/tests/host_vars/openstack1.yml +++ b/tests/host_vars/openstack1.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/host_vars/storage1.yml b/tests/host_vars/storage1.yml index a831709..ebeab39 100644 --- a/tests/host_vars/storage1.yml +++ b/tests/host_vars/storage1.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/os_manila-overrides.yml b/tests/os_manila-overrides.yml index e5af97d..5fa5123 100644 --- a/tests/os_manila-overrides.yml +++ b/tests/os_manila-overrides.yml @@ -1,5 +1,5 @@ --- -# Copyright 2016, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ tempest_run: yes tempest_test_whitelist: - smoke - manila_tempest_tests.tests.scenario.test_share_basic_ops + tempest_test_blacklist: - test: tempest.api.identity reason: Reducing run time and required resources @@ -32,7 +33,7 @@ tempest_test_blacklist: reason: Reducing run time and required resources - test: tempest.scenario.test_network_basic_ops reason: Reducing run time and required resources -tempest_service_available_manila: True + tempest_plugins: "{{ _tempest_plugins['keystone'] + _tempest_plugins['manila'] }}" tempest_tempest_conf_overrides: @@ -90,6 +91,8 @@ manila_backends: driver_handles_share_servers: False lvm_share_volume_group: manila-shares lvm_share_export_ip: "10.1.1.1" + filter_function: "share.size >= 0" + goodness_function: "share.size >= 0" generic: share_backend_name: GENERIC share_driver: manila.share.drivers.generic.GenericShareDriver @@ -99,6 +102,8 @@ manila_backends: service_instance_user: manila service_instance_password: manila interface_driver: manila.network.linux.interface.BridgeInterfaceDriver + filter_function: "share.size >= 0" + goodness_function: "share.size >= 0" test_manila_api_group: "{{ ((groups['manila_api'] is defined) and (groups['manila_api'] | length > 0)) | ternary('manila_api', 'all_containers') }}" 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" manila_developer_mode: true manila_git_install_branch: "{{ test_branch }}" manila_profiler_hmac_key: "secrete" -manila_oslomsg_rpc_password: "{{ oslomsg_rpc_password }}" +manila_oslomsg_rpc_password: "secrete" manila_oslomsg_notify_password: "{{ oslomsg_notify_password }}" manila_service_password: "secrete" manila_venv_tag: "testing" diff --git a/tests/test-install-manila.yml b/tests/test-install-manila.yml index ad87338..d6d4781 100644 --- a/tests/test-install-manila.yml +++ b/tests/test-install-manila.yml @@ -1,5 +1,5 @@ --- -# Copyright 2015, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test-setup-manila-localhost.yml b/tests/test-setup-manila-localhost.yml index fda9539..539d7f6 100644 --- a/tests/test-setup-manila-localhost.yml +++ b/tests/test-setup-manila-localhost.yml @@ -1,5 +1,5 @@ --- -# Copyright 2015, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Prepare manila-shares share group +- name: Prepare manila_shares share group hosts: localhost # This set of tasks runs against localhost # and requires root access, but tests run as @@ -48,7 +48,7 @@ - "pvcreate {{ manila_losetup.stdout }}" - "pvscan" - - name: Add manila-shares share group + - name: Add manila_shares share group lvg: vg: "{{ manila_lvm_vg_name | default('manila-shares') }}" pvs: "{{ manila_losetup.stdout }}" diff --git a/tests/test.yml b/tests/test.yml index 3226dd0..07a0ce0 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,5 +1,5 @@ --- -# Copyright 2015, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ # Setup the host - import_playbook: common/test-setup-host.yml -# Prepare the manila-share VG +# Prepare the manila_share VG - import_playbook: test-setup-manila-localhost.yml -# Prepare the manila-share VG +# Prepare the manila_share VG - import_playbook: common/test-setup-cinder-localhost.yml # Install RabbitMQ/MariaDB diff --git a/vars/distro_install.yml b/vars/distro_install.yml index bfca0e2..1f0e31a 100644 --- a/vars/distro_install.yml +++ b/vars/distro_install.yml @@ -20,16 +20,16 @@ # manila_package_list: |- {% set packages = manila_service_distro_packages %} - {% if manila_services['manila-share']['group'] in group_names %} + {% if manila_services['manila_share']['group'] in group_names %} {% set _ = packages.extend(manila_share_distro_packages) %} {% if manila_backend_lvm_inuse | bool %} {% set _ = packages.extend(manila_lvm_share_distro_packages) %} {% endif %} {% endif %} - {% if manila_services['manila-api']['group'] in group_names %} + {% if manila_services['manila_api']['group'] in group_names %} {% set _ = packages.extend(manila_api_distro_packages) %} {% endif %} - {% if manila_services['manila-scheduler']['group'] in group_names %} + {% if manila_services['manila_scheduler']['group'] in group_names %} {% set _ = packages.extend(manila_scheduler_distro_packages) %} {% endif %} {% if manila_developer_mode | bool %} diff --git a/vars/main.yml b/vars/main.yml index 13760ca..f283ff6 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,5 +1,5 @@ --- -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/vars/source_install.yml b/vars/source_install.yml index 87438cd..b5c903a 100644 --- a/vars/source_install.yml +++ b/vars/source_install.yml @@ -1,5 +1,5 @@ --- -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ # manila_package_list: |- {% set packages = manila_distro_packages %} - {% if manila_services['manila-share']['group'] in group_names %} + {% if manila_services['manila_share']['group'] in group_names %} {% set _ = packages.extend(manila_share_deps_distro_packages) %} {% if manila_backend_lvm_inuse | bool %} {% set _ = packages.extend(manila_lvm_share_distro_packages) %} diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 5c5f086..b5ca46f 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -1,4 +1,4 @@ -# Copyright 2017, Rackspace US, Inc. +# Copyright 2019, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,11 +17,3 @@ - check-requirements - publish-openstack-docs-pti - release-notes-jobs-python3 - check: - jobs: - - openstack-ansible-functional-ubuntu-bionic - - openstack-ansible-functional-distro_install-ubuntu-bionic: - voting: false - gate: - jobs: - - openstack-ansible-functional-ubuntu-bionic