Fix linting issues for ansible-lint 3.4.1

Preparing this role for the ansible-lint version bump

Change-Id: Ib78b5fd36dcd23d18fc13382359f5099405856d0
This commit is contained in:
Logan V 2016-11-02 13:03:19 +00:00
parent 6fc3caee2b
commit 7de60df8c3
10 changed files with 32 additions and 12 deletions

View File

@ -20,9 +20,10 @@ swift_gnocchi_enabled: False
## Verbosity Options
debug: False
# Set the package install state for distribution packages
# Set the package install state for distribution and pip packages
# Options are 'present' and 'latest'
swift_package_state: "latest"
swift_pip_package_state: "latest"
swift_git_repo: https://git.openstack.org/openstack/swift
swift_git_install_branch: master

View File

@ -19,8 +19,7 @@
- Restart swift services
- name: Reload upstart init scripts
shell: |
initctl reload-configuration
command: initctl reload-configuration
notify:
- Restart swift services

View File

@ -16,6 +16,7 @@
# Detect whether the init system is upstart of systemd.
- name: Check init system
command: cat /proc/1/comm
changed_when: false
register: _pid1_name
tags:
- always

View File

@ -52,7 +52,7 @@
- name: Install requires pip packages
pip:
name: "{{ swift_requires_pip_packages | join(' ') }}"
state: latest
state: "{{ swift_pip_package_state }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
@ -128,7 +128,7 @@
- name: Install pip packages
pip:
name: "{{ swift_pip_packages | join(' ') }}"
state: latest
state: "{{ swift_pip_package_state }}"
virtualenv: "{{ swift_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options_fact }}"

View File

@ -56,7 +56,7 @@
- name: Install pip packages into pypy venv
pip:
name: "{{ swift_pip_packages | join(' ') }}"
state: latest
state: "{{ swift_pip_package_state }}"
virtualenv: "{{ swift_bin | dirname }}"
virtualenv_site_packages: "no"
virtualenv_command: "{{ swift_pypy_env | dirname }}/virtualenv"

View File

@ -48,6 +48,7 @@
- "{{ swift_managed_regions | default([None]) }}"
become: yes
become_user: "{{ swift_system_user_name }}"
changed_when: false
args:
chdir: /etc/swift/ring_build_files/
@ -58,5 +59,6 @@
- "{{ swift_managed_regions | default([None]) }}"
become: yes
become_user: "{{ swift_system_user_name }}"
changed_when: false
args:
chdir: /etc/swift/ring_build_files/

View File

@ -16,11 +16,13 @@
- name: Get md5sum of local builder files
shell: |
cat /etc/swift/ring_build_files/*.builder 2>/dev/null | md5sum | cut -d " " -f1
changed_when: false
register: md5sum
- name: Get empty md5sum
shell: |
echo -n | md5sum | cut -d " " -f1
changed_when: false
register: empty_md5sum
# Fail if the remote hosts builder files is not empty AND

View File

@ -17,18 +17,29 @@
# instead of the Synchronize module. The change was required due to an upstream
# issue with the module when running with delegate_to and become. Sadly the fix
# does not seem to be trivial. "https://github.com/ansible/ansible/issues/15405"
# TODO(logan): Change to synchronize module to pass ANSIBLE0006
# and remove the skip_ansible_lint tag at that time.
- name: "Get swift rings"
command: |
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/ \
command: >
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
-avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
/etc/swift/
become: yes
become_user: "{{ swift_system_user_name }}"
changed_when: false
tags:
- skip_ansible_lint
# TODO(logan): Change to synchronize module to pass ANSIBLE0006
# and remove the skip_ansible_lint tag at that time.
- name: "Get swift rings for backup in ring_build_files directory"
command: |
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \
-avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/ \
command: >
rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
-avz {{ swift_system_user_name }}@{{ hostvars[groups['swift_hosts'][0]]['ansible_host'] }}:/etc/swift/ring_build_files/
/etc/swift/ring_build_files/
become: yes
become_user: "{{ swift_system_user_name }}"
changed_when: false
tags:
- skip_ansible_lint

View File

@ -16,6 +16,7 @@
- name: Get md5sum of builder files
shell: |
cat /etc/swift/*.builder 2>/dev/null | md5sum | cut -d " " -f1
changed_when: false
register: md5sum
- name: Register a fact for the md5sum

View File

@ -16,6 +16,7 @@
- name: Get md5sum of local builder files
shell: |
cat /etc/swift/ring_build_files/*.builder 2>/dev/null | md5sum | cut -d " " -f1
changed_when: false
register: md5sum
# Fail if the remote hosts builder files don't match
@ -38,6 +39,7 @@
- name: "Ensure contents file matches ring after ring sync for account/container"
command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/{{ item[0] }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}"
changed_when: false
with_nested:
- [ 'account', 'container' ]
- "{{ swift_managed_regions | default([None]) }}"
@ -48,6 +50,7 @@
- name: "Ensure contents file matches ring after ring sync for storage policies"
command: "/etc/swift/scripts/swift_rings_check.py -f /etc/swift/scripts/object-{{ item[0].policy.index }}.contents{% if item[1] %} -r {{ item[1] }} {% endif %}"
changed_when: false
with_nested:
- "{{ swift.storage_policies }}"
- "{{ swift_managed_regions | default([None]) }}"