Skip to content

Commit 8531722

Browse files
committed
Merge pull request #106 from Shm013/103-New_style_lint
Clean up ansible-lint and yamllint issues
2 parents 53681dc + 6b4993f commit 8531722

27 files changed

+133
-118
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
# Recommend matching the black line length (default 88),
3+
# rather than using the flake8 default of 79:
4+
max-line-length = 88
5+
extend-ignore =
6+
# See https://github.com/PyCQA/pycodestyle/issues/373
7+
E203,

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
ko_fi: sleepingkyoto
23
custom:
34
- "https://monappy.jp/u/lae"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.vscode/
33
.history
44
*.retry
5-
*.code-workspace
5+
*.code-workspace
6+
*.sw?

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ before_script:
3737
- cd tests/
3838
script:
3939
- ansible-lint ../ || true
40+
- yamllint ../ || true
4041
- ansible-playbook -i inventory deploy.yml --syntax-check
4142
- ansible-playbook -i inventory deploy.yml
4243
- 'ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=no ANSIBLE_DISPLAY_OK_HOSTS=no

.yamllint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
extends: default
23

34
rules:
@@ -11,3 +12,5 @@ rules:
1112
# NOTE(retr0h): Templates no longer fail this lint rule.
1213
# Uncomment if running old Molecule templates.
1314
# truthy: disable
15+
16+
ignore: .travis.yml

defaults/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ netbox_git_uri: "https://github.com/netbox-community/netbox.git"
1111
netbox_install_epel: true
1212

1313
netbox_superuser_username: admin
14-
#netbox_superuser_password: changeme
14+
# netbox_superuser_password: changeme
1515
netbox_superuser_email: admin@localhost
1616

1717
netbox_database: netbox
1818
netbox_database_user: netbox
19-
#netbox_database_password: changeme
20-
#netbox_database_host: localhost
19+
# netbox_database_password: changeme
20+
# netbox_database_host: localhost
2121
netbox_database_port: 5432
22-
#netbox_database_socket: /var/run/postgresql
22+
# netbox_database_socket: /var/run/postgresql
2323
netbox_database_conn_age: 0
2424

2525
netbox_redis_host: 127.0.0.1
@@ -41,12 +41,12 @@ netbox_metrics_dir: netbox_metrics
4141
netbox_metrics_path: "/run/{{ netbox_metrics_dir }}"
4242

4343
netbox_config:
44-
#SECRET_KEY:
44+
# SECRET_KEY:
4545
ALLOWED_HOSTS:
4646
- localhost
4747
- 127.0.0.1
48-
#NAPALM_USERNAME:
49-
#NAPALM_PASSWORD:
48+
# NAPALM_USERNAME:
49+
# NAPALM_PASSWORD:
5050
MEDIA_ROOT: "{{ netbox_shared_path }}/media"
5151
REPORTS_ROOT: "{{ netbox_shared_path }}/reports"
5252
SCRIPTS_ROOT: "{{ netbox_shared_path }}/scripts"

examples/netbox_config.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
netbox_config:
3-
#SECRET_KEY: "hLk3ED%o#P0teb&UjKN)Quvr=SW$HcM^Z(Rzy_sBXFfpY+5TVC" # let this be generated by the role so you don't have to store it
3+
# SECRET_KEY: "hLk3ED%o#P0teb&UjKN)Quvr=SW$HcM^Z(Rzy_sBXFfpY+5TVC" # let this be generated by the role so you don't have to store it
44
ALLOWED_HOSTS:
55
- 127.0.0.1
66
- localhost
@@ -24,16 +24,16 @@ netbox_config:
2424
BASE_PATH: netbox/
2525
CACHE_TIMEOUT: 900
2626
CHANGELOG_RETENTION: 90
27-
CORS_ORIGIN_ALLOW_ALL: False
28-
#CORS_ORIGIN_REGEX_WHITELIST:
27+
CORS_ORIGIN_ALLOW_ALL: false
28+
# CORS_ORIGIN_REGEX_WHITELIST:
2929
CORS_ORIGIN_WHITELIST:
3030
- hostname.domain.example
3131
DATE_FORMAT: N j, Y
3232
DATETIME_FORMAT: 'N j, Y g:i a'
33-
DEBUG: yes
33+
DEBUG: true
3434
# yes, no, false, true, False, True are all valid booleans in Ansible - they will be inserted correctly in configuration.py
3535
DOCS_ROOT: docs/
36-
ENFORCE_GLOBAL_UNIQUE: False
36+
ENFORCE_GLOBAL_UNIQUE: false
3737
EMAIL:
3838
SERVER: localhost
3939
PORT: 25
@@ -51,7 +51,7 @@ netbox_config:
5151
- ::1
5252
LOGGING:
5353
version: 1
54-
disable_existing_loggers: False
54+
disable_existing_loggers: false
5555
handlers:
5656
console:
5757
class: logging.StreamHandler
@@ -60,19 +60,19 @@ netbox_config:
6060
handlers:
6161
- console
6262
level: INFO
63-
LOGIN_REQUIRED: yes
63+
LOGIN_REQUIRED: true
6464
LOGIN_TIMEOUT: 1209600
65-
MAINTENANCE_MODE: False
65+
MAINTENANCE_MODE: false
6666
MAX_PAGE_SIZE: 500
6767
MEDIA_ROOT: /srv/netbox_media
68-
METRICS_ENABLED: True
68+
METRICS_ENABLED: true
6969
NAPALM_USERNAME: netbox
7070
NAPALM_PASSWORD: NetBox42
7171
NAPALM_TIMEOUT: 30
7272
NAPALM_ARGS:
7373
keepalive: 60
7474
PAGINATE_COUNT: 100
75-
PREFER_IPV4: False
75+
PREFER_IPV4: false
7676
RACK_ELEVATION_DEFAULT_UNIT_HEIGHT: 22
7777
RACK_ELEVATION_DEFAULT_UNIT_WIDTH: 220
7878
REPORTS_ROOT: /srv/netbox_reports
@@ -83,4 +83,4 @@ netbox_config:
8383
SHORT_TIME_FORMAT: 'H:i:s'
8484
TIME_FORMAT: 'g:i a'
8585
TIME_ZONE: UTC
86-
WEBHOOKS_ENABLED: False
86+
WEBHOOKS_ENABLED: false

examples/playbook_single_host_deploy.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- hosts: all
3-
become: yes
3+
become: true
44
roles:
55
- geerlingguy.postgresql
66
- davidwittman.redis
@@ -33,24 +33,24 @@
3333
- rhel-*-extras-rpms
3434
when: "ansible_distribution == 'Red Hat Enterprise Linux'"
3535
- block:
36-
- name: Set PostgreSQL facts to use PG10 for RedHat distributions
37-
set_fact:
38-
postgresql_version: 10
39-
postgresql_packages:
40-
- postgresql10
41-
- postgresql10-server
42-
- postgresql10-contrib
43-
- postgresql10-libs
44-
postgresql_data_dir: /var/lib/pgsql/10/data
45-
postgresql_bin_path: /usr/pgsql-10/bin
46-
postgresql_config_path: /var/lib/pgsql/10/data
47-
postgresql_daemon: postgresql-10
48-
- name: Install the EPEL yum repository
49-
yum:
50-
name: epel-release
51-
- name: Install the PostgreSQL yum repository
52-
yum:
53-
name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
36+
- name: Set PostgreSQL facts to use PG10 for RedHat distributions
37+
set_fact:
38+
postgresql_version: 10
39+
postgresql_packages:
40+
- postgresql10
41+
- postgresql10-server
42+
- postgresql10-contrib
43+
- postgresql10-libs
44+
postgresql_data_dir: /var/lib/pgsql/10/data
45+
postgresql_bin_path: /usr/pgsql-10/bin
46+
postgresql_config_path: /var/lib/pgsql/10/data
47+
postgresql_daemon: postgresql-10
48+
- name: Install the EPEL yum repository
49+
yum:
50+
name: epel-release
51+
- name: Install the PostgreSQL yum repository
52+
yum:
53+
name: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_distribution_major_version }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm"
5454
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version =='7'"
5555

5656
# You can use this playbook as-is to setup a full NetBox server, just change

handlers/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
systemd:
55
name: netbox.socket
66
state: restarted
7-
daemon_reload: yes
7+
daemon_reload: true
88

99
- name: restart netbox.service
1010
systemd:
1111
name: netbox.service
1212
state: restarted
13-
daemon_reload: yes
13+
daemon_reload: true
1414

1515
- name: reload netbox.service
1616
systemd:
@@ -21,4 +21,4 @@
2121
systemd:
2222
name: netbox-rqworker.service
2323
state: restarted
24-
daemon_reload: yes
24+
daemon_reload: true

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
galaxy_info:
23
author: Musee Ullah
34
description: Installs and configures NetBox, a DCIM suite, in a production setting.

0 commit comments

Comments
 (0)