Fix linting issues found via project-config

There are no playbooks that use the roles in this repo in a way that
would lint them, however running linters in project-config found
numerous issues in these roles. Correct the roles.

Change-Id: I017532c8aed8fd90474052423c7ba2510cf84631
Signed-off-by: Jesse Keating <omgjlk@us.ibm.com>
This commit is contained in:
Jesse Keating 2017-09-13 14:56:21 -06:00
parent bca15b28f0
commit d3128dab95
4 changed files with 46 additions and 33 deletions

View File

@ -3,6 +3,9 @@
- name: Update apt cache - name: Update apt cache
become: yes become: yes
command: apt-get update command: apt-get update
# skip linting for above comment
tags:
- skip_ansible_lint
- name: Update dnf cache - name: Update dnf cache
become: yes become: yes
@ -23,4 +26,4 @@
command: "{{ item }}" command: "{{ item }}"
with_items: with_items:
- zypper clean - zypper clean
- zypper refresh - zypper refresh

View File

@ -1,4 +1,5 @@
- include_role: - name: include the log path role
include_role:
name: set-zuul-log-path-fact name: set-zuul-log-path-fact
- debug: - debug:

View File

@ -1,35 +1,43 @@
- name: Allow pushing to non-bare repo - name: Allow pushing to non-bare repo
command: "git config --local receive.denyCurrentBranch ignore" git_config:
args: scope: local
chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}" name: receive.denyCurrentBranch
value: ignore
repo: "{{ ansible_user_dir }}/{{ item.src_dir}}"
with_items: "{{ zuul.projects }}" with_items: "{{ zuul.projects }}"
- name: Synchronize src repos to workspace directory - block:
command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}" # Do not lint these tasks, gets confused by git actions that cannot be done
args: # by git modules
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" tags:
with_items: "{{ zuul.projects }}" - skip_ansible_lint
delegate_to: localhost
- name: Determine local HEAD - name: Synchronize src repos to workspace directory
shell: "git status |head -1 |awk '{ print $NF }'" command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}"
args: args:
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
with_items: "{{ zuul.projects }}" with_items: "{{ zuul.projects }}"
delegate_to: localhost delegate_to: localhost
register: statuses
# Do this as a multi-line shell so that we can do the loop once - name: Determine local HEAD
- name: Update remote repository state correctly shell: "git status |head -1 |awk '{ print $NF }'"
shell: | args:
# Reset is needed because we pushed to a non-bare repo chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
git reset --hard with_items: "{{ zuul.projects }}"
# Undo the config setting we did above delegate_to: localhost
git config --local --unset receive.denyCurrentBranch register: statuses
# checkout the branch matching the branch set up by the executor
git checkout {{ item.1.stdout }} # Do this as a multi-line shell so that we can do the loop once
args: - name: Update remote repository state correctly
chdir: "{{ ansible_user_dir }}/{{ item.0.src_dir }}" shell: |
with_together: # Reset is needed because we pushed to a non-bare repo
- "{{ zuul.projects }}" git reset --hard
- "{{ statuses.results }}" # Undo the config setting we did above
git config --local --unset receive.denyCurrentBranch
# checkout the branch matching the branch set up by the executor
git checkout {{ item.1.stdout }}
args:
chdir: "{{ ansible_user_dir }}/{{ item.0.src_dir }}"
with_together:
- "{{ zuul.projects }}"
- "{{ statuses.results }}"

View File

@ -1,4 +1,5 @@
- include_role: - name: include the log path role
include_role:
name: set-zuul-log-path-fact name: set-zuul-log-path-fact
- name: Create log directories - name: Create log directories