lint: bumping to latest versions
- run `pre-commit autoupdate` and fixed new issues - adopted newer pre-commit config for ansible-lint 4.2.0+ - fixed some reported broken rules - temporary disabled few rules, just to contain the size of of review, planning to drop/fix them in follow-ups. Change-Id: I807ba4e919527be56c85ec72d0f4c7148f04e994
This commit is contained in:
parent
0de40307b8
commit
16649df878
@ -7,7 +7,10 @@ quiet: false
|
|||||||
skip_list:
|
skip_list:
|
||||||
# TODO(ssbarnea): Gradually remove these skips ASAP
|
# TODO(ssbarnea): Gradually remove these skips ASAP
|
||||||
- 204 # Lines should be no longer than 160 chars
|
- 204 # Lines should be no longer than 160 chars
|
||||||
|
- 301 # Commands should not change things if nothing needs doing
|
||||||
|
- 302 # rm used in place of argument state=absent to file module
|
||||||
- 303 # sed used in place of template, replace or lineinfile module
|
- 303 # sed used in place of template, replace or lineinfile module
|
||||||
|
- 306 # Shells that use pipes should set the pipefail option
|
||||||
- 504 # Do not use 'local_action', use 'delegate_to: localhost'
|
- 504 # Do not use 'local_action', use 'delegate_to: localhost'
|
||||||
- 601 # Don't compare to literal True/False
|
- 601 # Don't compare to literal True/False
|
||||||
- 602 # Don't compare to empty string
|
- 602 # Don't compare to empty string
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.3.0
|
rev: v2.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
@ -15,18 +15,24 @@ repos:
|
|||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
files: .*\.(yaml|yml)$
|
files: .*\.(yaml|yml)$
|
||||||
- repo: https://github.com/adrienverge/yamllint.git
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
rev: v1.18.0
|
rev: v1.20.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
files: \.(yaml|yml)$
|
files: \.(yaml|yml)$
|
||||||
types: [file, yaml]
|
types: [file, yaml]
|
||||||
entry: yamllint --strict -f parsable
|
entry: yamllint --strict -f parsable
|
||||||
- repo: https://github.com/ansible/ansible-lint
|
- repo: https://github.com/ansible/ansible-lint
|
||||||
rev: v4.1.1a1
|
rev: v4.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: ansible-lint
|
- id: ansible-lint
|
||||||
files: \.(yaml|yml)$
|
always_run: true
|
||||||
entry: ansible-lint --force-color -v
|
pass_filenames: false
|
||||||
|
# do not add file filters here as ansible-lint does not give reliable
|
||||||
|
# results when called with individual files.
|
||||||
|
# https://github.com/ansible/ansible-lint/issues/611
|
||||||
|
verbose: true
|
||||||
|
# plugins is the standard collection dir for modules
|
||||||
|
entry: env ANSIBLE_LIBRARY=plugins ansible-lint --force-color -p -v
|
||||||
- repo: https://github.com/openstack-dev/bashate.git
|
- repo: https://github.com/openstack-dev/bashate.git
|
||||||
rev: 0.6.0
|
rev: 0.6.0
|
||||||
hooks:
|
hooks:
|
||||||
|
@ -12,3 +12,4 @@
|
|||||||
become: true
|
become: true
|
||||||
shell: >
|
shell: >
|
||||||
"{{ working_dir }}"/add-provisioning-interface.sh
|
"{{ working_dir }}"/add-provisioning-interface.sh
|
||||||
|
changed_when: true
|
||||||
|
@ -70,8 +70,11 @@
|
|||||||
|
|
||||||
- name: get undercloud ip
|
- name: get undercloud ip
|
||||||
delegate_to: "{{ virthost }}"
|
delegate_to: "{{ virthost }}"
|
||||||
shell: ip route get 1 | awk '{print $NF;exit}'
|
shell: |
|
||||||
|
set -euo pipefail
|
||||||
|
ip route get 1 | awk '{print $NF;exit}'
|
||||||
register: registered_undercloud_ip
|
register: registered_undercloud_ip
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Re-add the virthost to the inventory
|
- name: Re-add the virthost to the inventory
|
||||||
add_host:
|
add_host:
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
- name: Map project name to DLRN project name
|
- name: Map project name to DLRN project name
|
||||||
register: project_name_mapped
|
register: project_name_mapped
|
||||||
shell: >
|
shell: >
|
||||||
|
set -euo pipefail;
|
||||||
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
|
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
|
||||||
export PROJECT_NAME=$(echo {{ artg_change.project }} | sed "s|openstack/||");
|
export PROJECT_NAME=$(echo {{ artg_change.project }} | sed "s|openstack/||");
|
||||||
rdopkg findpkg -s $PROJECT_NAME -l rdoinfo | grep ^name | awk '{print $2}'
|
rdopkg findpkg -s $PROJECT_NAME -l rdoinfo | grep ^name | awk '{print $2}'
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- name: Check if virtualenv is in the system
|
- name: Check if virtualenv is in the system
|
||||||
shell: "{{ python_cmd }} -m virtualenv --version"
|
command: "{{ python_cmd }} -m virtualenv --version"
|
||||||
args:
|
args:
|
||||||
warn: false
|
warn: false
|
||||||
register: virtualenv_exist
|
register: virtualenv_exist
|
||||||
@ -92,6 +92,7 @@
|
|||||||
dest: '{{ build_repo_dir }}/DLRN/projects.ini'
|
dest: '{{ build_repo_dir }}/DLRN/projects.ini'
|
||||||
|
|
||||||
- name: Install and update pip
|
- name: Install and update pip
|
||||||
|
# noqa 403
|
||||||
pip:
|
pip:
|
||||||
name: pip
|
name: pip
|
||||||
virtualenv: "{{ build_repo_dir }}/dlrn-venv"
|
virtualenv: "{{ build_repo_dir }}/dlrn-venv"
|
||||||
@ -106,6 +107,7 @@
|
|||||||
when: not dlrn_pre_installed|bool
|
when: not dlrn_pre_installed|bool
|
||||||
|
|
||||||
- name: Pip install DLRN
|
- name: Pip install DLRN
|
||||||
|
# noqa 403
|
||||||
pip:
|
pip:
|
||||||
name: dlrn
|
name: dlrn
|
||||||
virtualenv: "{{ build_repo_dir }}/dlrn-venv"
|
virtualenv: "{{ build_repo_dir }}/dlrn-venv"
|
||||||
@ -254,12 +256,12 @@
|
|||||||
find {{ build_repo_dir }}/DLRN/data/repos -type f -name '*.rpm' -print0 | xargs -0 cp -t {{ build_repo_dir }}/gating_repo;
|
find {{ build_repo_dir }}/DLRN/data/repos -type f -name '*.rpm' -print0 | xargs -0 cp -t {{ build_repo_dir }}/gating_repo;
|
||||||
|
|
||||||
- name: Run createrepo on generated rpms
|
- name: Run createrepo on generated rpms
|
||||||
shell: 'createrepo gating_repo'
|
command: createrepo gating_repo
|
||||||
args:
|
args:
|
||||||
chdir: '{{ build_repo_dir }}'
|
chdir: '{{ build_repo_dir }}'
|
||||||
|
|
||||||
- name: Compress the repo
|
- name: Compress the repo
|
||||||
shell: 'tar czf {{ artg_compressed_gating_repo }} gating_repo'
|
command: 'tar czf {{ artg_compressed_gating_repo }} gating_repo'
|
||||||
args:
|
args:
|
||||||
chdir: '{{ build_repo_dir }}'
|
chdir: '{{ build_repo_dir }}'
|
||||||
- name: Trigger repo injection for quickstart
|
- name: Trigger repo injection for quickstart
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
copy: "src={{ local_working_dir }}/gating_repo.tar.gz dest=/tmp/gating_repo.tar.gz"
|
copy: "src={{ local_working_dir }}/gating_repo.tar.gz dest=/tmp/gating_repo.tar.gz"
|
||||||
|
|
||||||
- name: Copy compressed repo to /tmp
|
- name: Copy compressed repo to /tmp
|
||||||
shell: cp -f {{ ib_repo_file_path }} /tmp/gating_repo.tar.gz
|
command: cp -f {{ ib_repo_file_path }} /tmp/gating_repo.tar.gz
|
||||||
when: ib_repo_host is not defined
|
when: ib_repo_host is not defined
|
||||||
|
|
||||||
- include: install_built_repo.yml
|
- include: install_built_repo.yml
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: ensure libguestfs is installed
|
- name: ensure libguestfs is installed
|
||||||
|
# noqa 403
|
||||||
yum: name=libguestfs-tools-c state=latest
|
yum: name=libguestfs-tools-c state=latest
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Set abs path for image
|
- name: Set abs path for image
|
||||||
shell: echo "{{ image_to_modify }}"
|
command: echo "{{ image_to_modify }}"
|
||||||
register: image_to_modify_abs_path
|
register: image_to_modify_abs_path
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Create a temp dir for extracting images
|
- name: Create a temp dir for extracting images
|
||||||
command: mktemp -d
|
command: mktemp -d
|
||||||
|
@ -120,7 +120,8 @@
|
|||||||
- delete
|
- delete
|
||||||
|
|
||||||
- name: Get output from nodes
|
- name: Get output from nodes
|
||||||
shell: openstack stack output show {{ stack_name }} subnode_ip_pairs -c output_value -f value
|
command: >
|
||||||
|
openstack stack output show {{ stack_name }} subnode_ip_pairs -c output_value -f value
|
||||||
register: subnode_ips
|
register: subnode_ips
|
||||||
|
|
||||||
- name: Add hosts
|
- name: Add hosts
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
when: ansible_distribution|lower != 'fedora'
|
when: ansible_distribution|lower != 'fedora'
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
# noqa 403
|
||||||
package:
|
package:
|
||||||
name: "{{ packages_list }}"
|
name: "{{ packages_list }}"
|
||||||
state: latest
|
state: latest
|
||||||
@ -74,9 +75,10 @@
|
|||||||
- include: clone-ci-repos.yml
|
- include: clone-ci-repos.yml
|
||||||
|
|
||||||
- name: Set primary public key on all hosts
|
- name: Set primary public key on all hosts
|
||||||
shell: cat /etc/nodepool/id_rsa.pub
|
command: cat /etc/nodepool/id_rsa.pub
|
||||||
register: primary_key
|
register: primary_key
|
||||||
when: inventory_hostname == "subnode-0"
|
when: inventory_hostname == "subnode-0"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Add primary key
|
- name: Add primary key
|
||||||
lineinfile:
|
lineinfile:
|
||||||
@ -141,6 +143,7 @@
|
|||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Update packages
|
- name: Update packages
|
||||||
|
# noqa 403
|
||||||
package:
|
package:
|
||||||
name: '*'
|
name: '*'
|
||||||
state: latest
|
state: latest
|
||||||
|
@ -96,8 +96,9 @@
|
|||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Get full stack status info in case of failure
|
- name: Get full stack status info in case of failure
|
||||||
shell: openstack stack show "{{ stack_name }}"
|
command: openstack stack show "{{ stack_name }}"
|
||||||
register: failed_stack
|
register: failed_stack
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Show stack status in case of failure
|
- name: Show stack status in case of failure
|
||||||
debug: var="failed_stack.stdout"
|
debug: var="failed_stack.stdout"
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
- name: Install python setuptools (easy_install)
|
- name: Install python setuptools (easy_install)
|
||||||
when: easy_install_exists.rc != 0
|
when: easy_install_exists.rc != 0
|
||||||
|
# noqa 403
|
||||||
package:
|
package:
|
||||||
state: latest
|
state: latest
|
||||||
name:
|
name:
|
||||||
@ -34,6 +35,7 @@
|
|||||||
command: "{{ python_cmd }} -m easy_install pip"
|
command: "{{ python_cmd }} -m easy_install pip"
|
||||||
|
|
||||||
- name: Update pip
|
- name: Update pip
|
||||||
|
# noqa 403
|
||||||
pip:
|
pip:
|
||||||
name: pip
|
name: pip
|
||||||
state: latest
|
state: latest
|
||||||
@ -41,6 +43,7 @@
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Pip install container-check
|
- name: Pip install container-check
|
||||||
|
# noqa 403
|
||||||
pip:
|
pip:
|
||||||
name: container-check
|
name: container-check
|
||||||
state: latest
|
state: latest
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
block:
|
block:
|
||||||
- name: Ensure rpm requirements for ssl and heat template are installed
|
- name: Ensure rpm requirements for ssl and heat template are installed
|
||||||
become: true
|
become: true
|
||||||
|
# noqa 403
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- openssl
|
- openssl
|
||||||
|
@ -183,6 +183,7 @@
|
|||||||
quickstart_venv: "{{ lookup('env','OPT_WORKDIR') }}"
|
quickstart_venv: "{{ lookup('env','OPT_WORKDIR') }}"
|
||||||
block:
|
block:
|
||||||
- name: Install ansible-lint
|
- name: Install ansible-lint
|
||||||
|
# noqa 403
|
||||||
pip:
|
pip:
|
||||||
name: ansible-lint
|
name: ansible-lint
|
||||||
state: latest
|
state: latest
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
when: release == 'newton'
|
when: release == 'newton'
|
||||||
|
|
||||||
- name: Install openstack services tempest plugins
|
- name: Install openstack services tempest plugins
|
||||||
|
# noqa 403
|
||||||
package:
|
package:
|
||||||
state: latest
|
state: latest
|
||||||
name: "{{ item | regex_replace( '^python[0-9]*-(.*)$', python_package_prefix + '-\\1' ) }}"
|
name: "{{ item | regex_replace( '^python[0-9]*-(.*)$', python_package_prefix + '-\\1' ) }}"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
when: release != 'newton'
|
when: release != 'newton'
|
||||||
|
|
||||||
- name: Check if virtualenv is in the system
|
- name: Check if virtualenv is in the system
|
||||||
shell: "{{ python_cmd }} -m virtualenv --version"
|
command: "{{ python_cmd }} -m virtualenv --version"
|
||||||
register: virtualenv_exist
|
register: virtualenv_exist
|
||||||
failed_when: false
|
failed_when: false
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
shell: find /var/cache/tripleo-quickstart/images/* -mtime +3 -exec rm -rf {} \;
|
shell: find /var/cache/tripleo-quickstart/images/* -mtime +3 -exec rm -rf {} \;
|
||||||
|
|
||||||
- name: remove tripleo-quickstart /var/oooqvms
|
- name: remove tripleo-quickstart /var/oooqvms
|
||||||
shell: rm -rf /var/oooqvms/
|
command: rm -rf /var/oooqvms/
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
- name: remove ansible-role-tripleo-image-build artifacts
|
- name: remove ansible-role-tripleo-image-build artifacts
|
||||||
shell: >
|
shell: >
|
||||||
@ -56,10 +57,11 @@
|
|||||||
|
|
||||||
- name: destroy local libvirt storage, networks and config
|
- name: destroy local libvirt storage, networks and config
|
||||||
become: true
|
become: true
|
||||||
shell: "rm -rf {{ working_dir }}/.config/libvirt"
|
command: "rm -rf {{ working_dir }}/.config/libvirt"
|
||||||
|
|
||||||
- name: get user_id for stack user
|
- name: get user_id for stack user
|
||||||
shell: >
|
shell: >
|
||||||
|
set -euo pipefail;
|
||||||
cat /etc/passwd | grep stack | awk -F ':' '{ print $3 }'
|
cat /etc/passwd | grep stack | awk -F ':' '{ print $3 }'
|
||||||
register: user_id
|
register: user_id
|
||||||
|
|
||||||
@ -103,10 +105,11 @@
|
|||||||
user: name={{ non_root_user }} remove=yes force=yes state=absent
|
user: name={{ non_root_user }} remove=yes force=yes state=absent
|
||||||
|
|
||||||
- name: remove stack home dir
|
- name: remove stack home dir
|
||||||
shell: rm -Rf {{ item }}
|
command: rm -Rf {{ item }}
|
||||||
with_items:
|
with_items:
|
||||||
- /home/{{ non_root_user }}
|
- /home/{{ non_root_user }}
|
||||||
- /var/spool/mail/{{ non_root_user }}
|
- /var/spool/mail/{{ non_root_user }}
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
- name: remove files automation files from /root
|
- name: remove files automation files from /root
|
||||||
file: name={{ item }} state=absent
|
file: name={{ item }} state=absent
|
||||||
|
Loading…
Reference in New Issue
Block a user