Remove python-keystoneclient package install

Now that we no longer use our own keystone module, but
instead make use of the ansible runtime venv's shade
library and upstream ansible modules, we can eliminate
this package/library being installed on the host.

To do this, we also ensure that the functional test
now uses the Ansible runtime venv for all OpenStack
modules, and we use the native Ansible OpenStack
modules instead of our own.

Change-Id: I0ecb55308a846ad0f1bb05c10b9e0aad3da15449
This commit is contained in:
Jesse Pretorius 2018-08-09 09:26:11 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 70978b3cec
commit cd17cb20d7
4 changed files with 140 additions and 154 deletions

View File

@ -13,162 +13,154 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Setup testing - run Swift functional tests
- name: Setup for swift functional tests
hosts: localhost
connection: local
gather_facts: no
vars_files:
- common/test-vars.yml
vars:
ansible_python_interpreter: "{{ ansible_playbook_python }}"
tasks:
- name: Add test projects
os_project:
cloud: default
state: present
name: "{{ item }}"
domain_id: "default"
endpoint_type: admin
verify: "{{ not keystone_service_adminuri_insecure }}"
register: _add_test_projects
until: _add_test_projects is success
retries: 5
delay: 10
with_items:
- "test1"
- "test2"
- "test5"
- "test6"
when: groups['keystone_all'] is defined
- name: Add test roles
os_keystone_role:
cloud: default
state: present
name: "{{ item }}"
endpoint_type: admin
verify: "{{ not keystone_service_adminuri_insecure }}"
register: add_test_roles
until: add_test_roles is success
retries: 5
delay: 10
with_items:
- "test-role"
- "test5"
when: groups['keystone_all'] is defined
- name: Add test users
os_user:
cloud: default
state: present
name: "{{ item.user_name }}"
password: "{{ item.password }}"
domain: default
default_project: "{{ item.project_name }}"
endpoint_type: admin
verify: "{{ not keystone_service_adminuri_insecure }}"
register: add_test_users
until: add_test_users is success
retries: 5
delay: 10
no_log: True
with_items:
- { user_name: "test1", project_name: "test1", password: "test1" }
- { user_name: "test2", project_name: "test2", password: "test2" }
- { user_name: "test3", project_name: "test1", password: "test3" }
- { user_name: "test5", project_name: "test5", password: "test5" }
- { user_name: "test6", project_name: "test6", password: "test6" }
when: groups['keystone_all'] is defined
- name: Add service user to admin role
os_user_role:
cloud: default
state: present
user: "{{ item.user_name }}"
role: "{{ item.role_name }}"
project: "{{ item.project_name }}"
endpoint_type: admin
verify: "{{ not keystone_service_adminuri_insecure }}"
register: add_test_user_roles
until: add_test_user_roles is success
retries: 5
delay: 10
with_items:
- { user_name: "test1", project_name: "test1", role_name: "admin" }
- { user_name: "test2", project_name: "test2", role_name: "admin" }
- { user_name: "test3", project_name: "test1", role_name: "test-role" }
- { user_name: "test5", project_name: "test5", role_name: "test5" }
- { user_name: "test6", project_name: "test6", role_name: "ResellerAdmin" }
when: groups['keystone_all'] is defined
- name: Run Swift functional tests
hosts: swift_proxy[0]
user: root
gather_facts: true
vars_files:
- common/test-vars.yml
pre_tasks:
- name: Ensure test projects
keystone:
command: "ensure_tenant"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
description: "Testing tenant"
tenant_name: "{{item.project_name }}"
domain_name: "{{ item.domain_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
with_items:
- { project_name: "test1", domain_name: "Default" }
- { project_name: "test2", domain_name: "Default" }
- { project_name: "test5", domain_name: "Default" }
- { project_name: "test6", domain_name: "Default" }
when: groups['keystone_all'] is defined
register: add_service
run_once: true
until: add_service is success
retries: 5
delay: 10
no_log: True
tasks:
- name: Clone swift repository on proxy-host
git:
repo: "https://git.openstack.org/openstack/swift"
dest: "/opt/swift"
update: yes
clone: yes
version: "{{ swift_git_install_branch }}"
- name: Ensure required roles
keystone:
command: "ensure_role"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
role_name: "{{ item }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
with_items:
- "test-role"
- "test5"
when: groups['keystone_all'] is defined
run_once: true
register: add_service
until: add_service is success
retries: 5
delay: 10
no_log: True
- name: Install requirements for swift
pip:
requirements: "{{ item }}"
virtualenv: "{{ swift_venv_bin | dirname }}"
extra_args: >-
{{ swift_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('') }}
with_items:
- "/opt/swift/test-requirements.txt"
- name: Add swift users for testing
keystone:
command: "ensure_user"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
user_name: "{{ item.user_name }}"
project_name: "{{ item.project_name }}"
domain_name: "{{ item.domain_name }}"
password: "{{ item.password }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
with_items:
- { user_name: "test1", project_name: "test1", password: "test1", domain_name: "Default" }
- { user_name: "test2", project_name: "test2", password: "test2", domain_name: "Default" }
- { user_name: "test3", project_name: "test1", password: "test3", domain_name: "Default" }
- { user_name: "test5", project_name: "test5", password: "test5", domain_name: "Default" }
- { user_name: "test6", project_name: "test6", password: "test6", domain_name: "Default" }
when: groups['keystone_all'] is defined
run_once: true
register: add_service
until: add_service is success
retries: 5
delay: 10
no_log: True
- name: Setup test.conf for testing
template:
src: "swift_test.conf.j2"
dest: "/etc/swift/test.conf"
owner: "swift"
group: "swift"
- name: Create swap file for swift-storage hosts
command: dd if=/dev/zero of=/swift_swap bs=1M count=1024
when:
- inventory_hostname in groups['swift_hosts']
- name: Ensure roles for swift test users
keystone:
command: "ensure_user_role"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
user_name: "{{ item.user_name }}"
domain_name: "{{ item.domain_name }}"
project_name: "{{ item.project_name }}"
role_name: "{{ item.role_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
with_items:
- { user_name: "test1", project_name: "test1", role_name: "admin", domain_name: "Default" }
- { user_name: "test2", project_name: "test2", role_name: "admin", domain_name: "Default" }
- { user_name: "test3", project_name: "test1", role_name: "test-role", domain_name: "Default" }
- { user_name: "test5", project_name: "test5", role_name: "test5", domain_name: "Default" }
- { user_name: "test6", project_name: "test6", role_name: "ResellerAdmin", domain_name: "Default" }
when: groups['keystone_all'] is defined
run_once: true
register: add_service
until: add_service is success
retries: 5
delay: 10
no_log: True
- name: Make swap for swift-storage hosts
command: mkswap /swift_swap
when:
- inventory_hostname in groups['swift_hosts']
- name: Clone swift repository on proxy-host
git:
repo: "https://git.openstack.org/openstack/swift"
dest: "/opt/swift"
update: yes
clone: yes
version: "{{ swift_git_install_branch }}"
- name: Add swap to fstab for swift-storage hosts
lineinfile:
dest: /etc/fstab
regexp: "swift_swap"
line: "/swift_swap none swap sw 0 0"
state: present
when:
- inventory_hostname in groups['swift_hosts']
- name: Install requirements for swift
pip:
requirements: "{{ item }}"
virtualenv: "{{ swift_venv_bin | dirname }}"
extra_args: >-
{{ swift_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('') }}
with_items:
- "/opt/swift/test-requirements.txt"
- name: Turn swap on for swift-storage hosts
command: swapon -a
when:
- inventory_hostname in groups['swift_hosts']
- name: Setup test.conf for testing
template:
src: "swift_test.conf.j2"
dest: "/etc/swift/test.conf"
owner: "swift"
group: "swift"
- name: Create swap file for swift-storage hosts
command: dd if=/dev/zero of=/swift_swap bs=1M count=1024
when:
- inventory_hostname in groups['swift_hosts']
- name: Make swap for swift-storage hosts
command: mkswap /swift_swap
when:
- inventory_hostname in groups['swift_hosts']
- name: Add swap to fstab for swift-storage hosts
lineinfile:
dest: /etc/fstab
regexp: "swift_swap"
line: "/swift_swap none swap sw 0 0"
state: present
when:
- inventory_hostname in groups['swift_hosts']
- name: Turn swap on for swift-storage hosts
command: swapon -a
when:
- inventory_hostname in groups['swift_hosts']
- name: Run functional tests for swift
shell: "source /openstack/venvs/swift-untagged/bin/activate && ./.functests"
args:
chdir: "/opt/swift/"
executable: "/bin/bash"
tags:
- skip_ansible_lint
- name: Run functional tests for swift
shell: "source /openstack/venvs/swift-untagged/bin/activate && ./.functests"
args:
chdir: "/opt/swift/"
executable: "/bin/bash"
tags:
- skip_ansible_lint

View File

@ -23,13 +23,11 @@ swift_distro_packages:
- liberasurecode-dev
- libffi-dev
- openssh-server
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-dev
- rsync
- libssl-dev
swift_service_distro_packages:
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-keystonemiddleware
- python-memcache
- python-swift

View File

@ -21,7 +21,6 @@ swift_distro_packages:
- liberasurecode-devel
- libffi-devel
- openssh-server
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-devel
- rsync
- openssl-devel
@ -35,7 +34,6 @@ swift_service_distro_packages:
- openstack-swift-object
- openstack-swift-plugin-swift3
- openstack-swift-proxy
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-keystonemiddleware
- python-memcached
- python-swift

View File

@ -22,7 +22,6 @@ swift_distro_packages:
- liberasurecode-devel
- libffi-devel
- openssh
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-devel
- rsync
- libopenssl-devel
@ -36,7 +35,6 @@ swift_service_distro_packages:
- openstack-swift-container
- openstack-swift-object
- openstack-swift-proxy
- python-keystoneclient # Keystoneclient needed to OSA keystone lib
- python-keystonemiddleware
- python-python-memcached
- python-swift