Skip to content

Commit

Permalink
Fix lint (#34)
Browse files Browse the repository at this point in the history
* Add lint rules

* add bages

* Fix yamllint and Readme
  • Loading branch information
ViachaslauKabak authored and tgadiev committed Dec 18, 2018
1 parent 2595eaf commit 92727d7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Ansible lint:
before_script:
- git clone https://github.com/lean-delivery/ansible-lint-rules.git ~/ansible-lint-rules
script:
- ansible-lint -c .ansible-lint `find . -regex ".*\.\(yml\)"`
- ansible-lint . -c .ansible-lint
after_script:
- rm -rf ~/ansible-lint-rules
tags:
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ before_install:
- git clone -b ${lint_version} https://github.com/lean-delivery/ansible-lint-rules.git ~/ansible-lint-rules

install:
- pip install --upgrade ansible==2.5.* ansible-lint docker-py molecule==2.17 pyOpenSSL PyYAML pytest==3.7.4
- pip install --upgrade ansible==2.5.* molecule==2.17 docker-py pyOpenSSL PyYAML pytest==3.7.4
- pip install git+https://github.com/ansible/ansible-lint.git
- ansible --version
- ansible-lint --version

script:
- ansible-lint -c .ansible-lint `find . -regex ".*\.\(yml\)"`
- ansible-lint . -c .ansible-lint
- molecule test -s default

notifications:
Expand Down
28 changes: 24 additions & 4 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
---
extends: default

rules:
# 150 chars should be enough, but don't fail if a line is longer
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
empty-lines:
max: 3
level: error
hyphens:
level: error
truthy: disable
comments: disable
comments-indentation: disable
indentation: disable
key-duplicates: enable
line-length:
max: 150
level: warning
# don't bother me with this rule
truthy: disable
comments-indentation: disable
new-lines: disable

ignore: |
molecule
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Jenkins 2 installation
=========
[![License](https://img.shields.io/badge/license-Apache-green.svg?style=flat)](https://raw.githubusercontent.com/lean-delivery/ansible-role-jenkins/master/LICENSE)
[![Build Status](https://travis-ci.org/lean-delivery/ansible-role-jenkins.svg?branch=master)](https://travis-ci.org/lean-delivery/ansible-role-jenkins)
[![Galaxy](https://img.shields.io/badge/galaxy-lean_delivery.jenkins-blue.svg)](https://galaxy.ansible.com/lean_delivery/ansible-role-jenkins)
![Ansible](https://img.shields.io/ansible/role/d/29895.svg)
![Ansible](https://img.shields.io/badge/dynamic/json.svg?label=min_ansible_version&url=https%3A%2F%2Fgalaxy.ansible.com%2Fapi%2Fv1%2Froles%2F29895%2F&query=$.min_ansible_version)
## Summary

This role:
Expand Down
24 changes: 0 additions & 24 deletions tasks/configure_smtp.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
---
# - name: "Check SMTP configuration"
# jenkins_script:
# url: "http://localhost:{{ jenkins2_config_http_port }}"
# script: "{{ lookup('template', 'check-smtp.groovy.j2') }}"
# user: '{{ jenkins2_cli_username }}'
# password: '{{ jenkins2_cli_password }}'
# validate_certs: False
# timeout: 120
# register: smtp

- name: "Configure SMTP"
jenkins_script:
url: "http://localhost:{{ jenkins2_config_http_port }}"
Expand All @@ -17,17 +7,3 @@
password: '{{ jenkins2_cli_password }}'
validate_certs: False
timeout: 120
# when: smtp.output|trim != jenkins2_smtp_host and jenkins2_smtp_enabled

# - name: "Wait for SMTP configuration apply's"
# jenkins_script:
# url: "http://localhost:{{ jenkins2_config_http_port }}"
# script: "{{ lookup('template', 'check-smtp.groovy.j2') }}"
# user: '{{ jenkins2_cli_username }}'
# password: '{{ jenkins2_cli_password }}'
# validate_certs: False
# timeout: 120
# register: smtp_check
# until: smtp_check.output|trim == jenkins2_smtp_host
# retries: 60
# delay: 1
3 changes: 3 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
- lxml
- awscli
- pip
register: installed_packages
until: installed_packages is success
become: True

- name: "Create group"
Expand Down Expand Up @@ -60,6 +62,7 @@
name: "{{ jenkins2_package_version }}"
state: present
register: jenkins_was_installed
until: jenkins_was_installed is success
become: True

- name: "Jenkins confuguration"
Expand Down

0 comments on commit 92727d7

Please sign in to comment.