Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Adhere to ansible-lint rules #242

Closed
bbaassssiiee opened this issue Dec 30, 2019 · 2 comments
Closed

Adhere to ansible-lint rules #242

bbaassssiiee opened this issue Dec 30, 2019 · 2 comments

Comments

@bbaassssiiee
Copy link
Contributor

Code style can be improved. This helps others that use ansible-lint for validation of IaC.

@bbaassssiiee
Copy link
Contributor Author

[701] Role info should contain description
jdauphant.nginx/meta/main.yml:1
{'meta/main.yml': {'galaxy_info': {'author': 'DAUPHANT Julien', 'license': 'BSD', 'min_ansible_version': 2.4, 'platforms': [{'name': 'EL', 'versions': ['all'], '__line__': 7, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'Fedora', 'versions': ['all'], '__line__': 10, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'opensuse', 'versions': ['all'], '__line__': 13, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'Ubuntu', 'versions': ['all'], '__line__': 16, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'Debian', 'versions': ['all'], '__line__': 19, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'FreeBSD', 'versions': [10.0, 10.1, 10.2, 10.3, 11.0, 11.1], '__line__': 22, '__file__': 'jdauphant.nginx/meta/main.yml'}, {'name': 'SmartOS', '__line__': 30, '__file__': 'jdauphant.nginx/meta/main.yml'}], 'galaxy_tags': ['web'], '__line__': 2, '__file__': 'jdauphant.nginx/meta/main.yml'}, 'allow_duplicates': True, 'dependencies': [], '__line__': 1, '__file__': 'jdauphant.nginx/meta/main.yml'}}

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/amplify.yml:30
  when: amplify_agent_installed.failed == true

[403] Package installs should not use latest
jdauphant.nginx/tasks/amplify.yml:33
Task/Handler: Update Amplify Agent if already installed and update flag is enabled

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/amplify.yml:37
  when: amplify_agent_installed.failed == false and nginx_amplify_update_agent == true

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/configuration.yml:14
  when: nginx_mime_types_file.stat.exists == False

[201] Trailing whitespace
jdauphant.nginx/tasks/configuration.yml:17


[204] Lines should be no longer than 160 chars
jdauphant.nginx/tasks/configuration.yml:78
- name: Create configuration files in modules-available (only for nginx official repo or custom modules, Centos/RHEL/Debian/Ubuntu EPEL/APT repo packages have these config files already)

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/ensure-dirs.yml:4
    path: "{{nginx_conf_dir}}/{{ item }}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/ensure-dirs.yml:8
    mode: "{{nginx_dir_perm}}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/ensure-dirs.yml:23
    owner: "{{nginx_log_user}}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/ensure-dirs.yml:24
    group: "{{nginx_log_group}}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/ensure-dirs.yml:25
    mode: "{{nginx_log_perm}}"

[502] All tasks should be named
jdauphant.nginx/tasks/main.yml:3
Task/Handler: include_vars {{ item }}

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/main.yml:15
  when: nginx_official_repo == True

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/main.yml:40
  when: nginx_set_real_ip_from_cloudflare == True

[601] Don't compare to literal True/False
jdauphant.nginx/tasks/main.yml:44
  when: nginx_amplify == true and (ansible_distribution in ['RedHat', 'CentOS', 'Debian', 'Amazon', 'Ubuntu'])

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/main.yml:48
  service: name={{ nginx_service_name }} state={{nginx_start_service | ternary('started', 'stopped')}} enabled={{nginx_start_at_boot}}

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-defaults.yml:4
    path: "{{nginx_conf_dir}}/sites-enabled/default"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-defaults.yml:11
    path: "{{nginx_conf_dir}}/sites-enabled/default.conf"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-defaults.yml:20
    path: "{{nginx_conf_dir}}/conf.d/default.conf"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-extras.yml:3
  shell: ls -1 {{nginx_conf_dir}}/sites-enabled || true

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-extras.yml:9
    path: "{{nginx_conf_dir}}/sites-enabled/{{ item }}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-extras.yml:18
  shell: find {{nginx_conf_dir}}/conf.d -maxdepth 1 -type f -name '*.conf' -exec basename {} \;

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-extras.yml:24
    name: "{{nginx_conf_dir}}/conf.d/{{ item }}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-unwanted.yml:4
    path: "{{nginx_conf_dir}}/{{ item[0] }}/{{ item[1] }}.conf"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-unwanted.yml:14
    path: "{{nginx_conf_dir}}/conf.d/{{ item }}.conf"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/remove-unwanted.yml:30
    path: "{{nginx_conf_dir}}/auth_basic/{{ item }}"

[206] Variables should have spaces before and after: {{ var_name }}
jdauphant.nginx/tasks/selinux.yml:3
  package: name={{ nginx_python_selinux_pkgs | default(omit)}} state=present

jdauphant pushed a commit that referenced this issue Dec 30, 2019
* trailing whitespace

* [701] Role info should contain description

* [601] Don't compare to literal True/False

* [502] All tasks should be named

* [206] Variables should have spaces before and after: {{ var_name }}

* skip_ansible_lint rule [403] Package installs should not use latest

* [204] Lines should be no longer than 160 chars
@jdauphant
Copy link
Owner

fixed by #243

mrwacky42 added a commit to HeadspaceMeditation/ansible-role-nginx that referenced this issue Jan 18, 2020
* Explicitly setting the nginx configuration file in (jdauphant#223)

the "check nginx configuration" handler.

* Fixing Ansible 2.7.0 deprication warnings (jdauphant#225)

* * Fixing Ansible 2.7.0 deprication warnings
  For further details take a look at: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions

* * Remving travis deprecation warning - Moving from "--sudo" to "--become"

* * Ignoring symlinks errors during ansible_check_mode

* Small spelling correction (jdauphant#228)

* Add support to declare nginx modules in config file (jdauphant#227)

* We can declare nginx modules now

* We can declare nginx modules now

* Correct load_module definition in template

* Add task to remove `default.conf` from sites-enabled/ (jdauphant#231)

* Add task to remove `default.conf` from sites-enabled/

* Check if `default` site is not inside user config

* fix modules definition and add README section about this feature (jdauphant#232)

* Fix typo in modules config and restrict to EPEL (jdauphant#232) (jdauphant#235)

* Fix typo in modules config and restrict to EPEL (jdauphant#232)

* Fixes warning from duplicate when's in modules configuration (jdauphant#233)

* Extends support for configuring modules (jdauphant#236) (jdauphant#237)

Module configuration should now work for the following:

 Centos/RHEL with either EPEL or Official Nginx repo
 Debian/Ubuntu with either standard APT repo or Official Nginx repo

Please see issue jdauphant#236 for further details.

* Update README.md

* download mime.types file if it's missing (jdauphant#241)

* configuration: allow templates for conf.d independent files (jdauphant#238)

* Fix for jdauphant#242 Stick to ansible-lint rules. (jdauphant#243)

* trailing whitespace

* [701] Role info should contain description

* [601] Don't compare to literal True/False

* [502] All tasks should be named

* [206] Variables should have spaces before and after: {{ var_name }}

* skip_ansible_lint rule [403] Package installs should not use latest

* [204] Lines should be no longer than 160 chars

Co-authored-by: Timo Runge <[email protected]>
Co-authored-by: TheSycamore <[email protected]>
Co-authored-by: Dmitry Ge <[email protected]>
Co-authored-by: Tommaso <[email protected]>
Co-authored-by: Perry Kollmorgen <[email protected]>
Co-authored-by: Julien DAUPHANT <[email protected]>
Co-authored-by: Tony Crowe <[email protected]>
Co-authored-by: paulrbr-fl <[email protected]>
Co-authored-by: Bas <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants