Do not log passwords

This prevents data to be leaked into the callback plugin.

Some style changes are included to make it easier to read,
the copyright notice is added as it should have been from
the start, and a duplicate retry argument is removed.

Change-Id: I11c3da84fa6469764a19b6a387ef312124dfba2a
(cherry picked from commit 130e8da005)
This commit is contained in:
Jesse Pretorius 2018-04-18 11:54:48 +01:00
parent 71fb3dc58b
commit 2719ce077e
3 changed files with 41 additions and 2 deletions

View File

@ -28,6 +28,7 @@
delay: 10
when:
- swift_gnocchi_enabled | bool
no_log: True
- name: Store Gnocchi project id
set_fact:

View File

@ -29,6 +29,7 @@
until: add_service|success
retries: 5
delay: 2
no_log: True
# Create an admin user
- name: Ensure swift user
@ -47,6 +48,7 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
# Add a role to the user
- name: Ensure swift user to admin role
@ -65,6 +67,7 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: Ensure swiftoperator role
keystone:
@ -79,6 +82,7 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: "Create keystone user for swift-dispersion"
keystone:
@ -96,6 +100,7 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: "Create keystone role for ResellerAdmin"
keystone:
@ -110,6 +115,7 @@
until: add_role|success
retries: 5
delay: 10
no_log: True
- name: "Add ResellerAdmin role to the service tenant and ceilometer user"
keystone:
@ -127,6 +133,7 @@
retries: 5
delay: 10
when: swift_ceilometer_enabled | bool
no_log: True
- name: "Add swiftoperator role to swift-dispersion user"
keystone:
@ -143,6 +150,7 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
# Create an endpoint
- name: Ensure swift endpoint
@ -167,3 +175,4 @@
until: add_service|success
retries: 5
delay: 10
no_log: True

View File

@ -1,8 +1,24 @@
---
# Copyright 2016, 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.
- name: Setup testing - 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:
@ -26,6 +42,8 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: Ensure required roles
keystone:
command: "ensure_role"
@ -44,6 +62,8 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: Add swift users for testing
keystone:
command: "ensure_user"
@ -68,6 +88,8 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: Ensure roles for swift test users
keystone:
command: "ensure_user_role"
@ -93,6 +115,8 @@
until: add_service|success
retries: 5
delay: 10
no_log: True
- name: Clone swift repository on proxy-host
git:
repo: "https://git.openstack.org/openstack/swift"
@ -100,6 +124,7 @@
update: yes
clone: yes
version: "{{ swift_git_install_branch }}"
- name: Install requirements for swift
pip:
requirements: "{{ item }}"
@ -110,20 +135,24 @@
{{ pip_install_options | default('') }}
with_items:
- "/opt/swift/test-requirements.txt"
- 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
@ -132,14 +161,14 @@
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"
vars_files:
- common/test-vars.yml