Skip to content

Commit

Permalink
linter: fix ansible-lint warnings (#1586)
Browse files Browse the repository at this point in the history
* linter: fix ansible-lint warnings

* Update linter.yml
  • Loading branch information
gdams committed Oct 2, 2020
1 parent 030b191 commit 91ca514
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,19 @@ on:


jobs:
yamlint:
name: Yamlint
yamllint:
name: Yamllint
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Set up Python 3.x
uses: actions/setup-python@v2
- name: 'Yamllint'
uses: karancode/yamllint-github-action@master
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install yamllint==1.13.0
- name: yamlint
run: |
cd ansible
yamllint -c yamllint.yml .
yamllint_comment: true
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ansible_lint:
name: Ansible Lint
Expand Down Expand Up @@ -68,4 +60,4 @@ jobs:
ansible-playbook playbooks/AdoptOpenJDK_ITW_Playbook/main.yml --syntax-check
ansible-playbook playbooks/vagrant.yml --syntax-check
ansible-playbook playbooks/aix.yml --syntax-check
ansible-playbook playbooks/ubuntu-jck.yml --syntax-check
ansible-playbook playbooks/ubuntu-jck.yml --syntax-check
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
arch:
- amd64
- arm64-graviton2
- ppc64le

env:
env:
- TARGET="adoptopenjdk/centos7_build_image"

os:
os:
- linux

dist: bionic
Expand All @@ -32,4 +33,4 @@ jobs:
docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux &&
docker manifest annotate $TARGET $PPC64LE --arch ppc64le --os linux
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; docker manifest push $TARGET; fi
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; docker manifest push $TARGET; fi
10 changes: 7 additions & 3 deletions ansible/yamllint.yml → .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
extends: default

ignore: |
.github/
rules:
line-length:
max: 120
level: warning
line-length: disable
comments-indentation: disable
comments: disable
# mixed style truthy values are OK for Ansible code
truthy: disable
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
args:
creates: krb5.jckusers.txt
tags:
#false positive for 'use shell only when shell is required'
#this whole piece should be rewritten to avoid 'bashsible' code style
# false positive for 'use shell only when shell is required'
# this whole piece should be rewritten to avoid 'bashsible' code style
- skip_ansible_lint

- name: Start krb5-kdc service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- hosts: all
gather_facts: yes
tasks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
##############################
# Enable IPv6 in sysctl.conf #
##############################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
#########################################################################################
# AdoptOpenJDK - Ansible Playbook to install Nagios plugins on CentOS 7 on x86 hardware #
#########################################################################################
Expand Down
4 changes: 2 additions & 2 deletions ansible/playbooks/aix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
when: yum.stat.islnk is not defined
tags:
- yum
#TODO: Package installs should not use latest
# TODO: Package installs should not use latest
- skip_ansible_lint

- name: Yum update
Expand All @@ -169,7 +169,7 @@
state: latest
tags:
- yum
#TODO: Package installs should not use latest
# TODO: Package installs should not use latest
- skip_ansible_lint

- name: Install yum package support
Expand Down

0 comments on commit 91ca514

Please sign in to comment.