Skip to content

Commit 7bf6046

Browse files
committed
lint errors
1 parent 05908dd commit 7bf6046

File tree

8 files changed

+43
-30
lines changed

8 files changed

+43
-30
lines changed

.github/workflows/lint.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
name: CI
1+
---
2+
name: Ansible Lint
23

3-
on: [push, pull_request]
4+
'on': [push, pull_request]
45

56
jobs:
6-
build:
7+
lint:
78
runs-on: ubuntu-latest
89
name: ansible-lint
910
steps:
10-
- uses: actions/checkout@master
11-
- uses: actions/setup-python@v2
12-
- run: pip install ansible ansible-lint
13-
- run: ansible-lint --version
14-
- run: ansible-lint .
11+
- name: checkout codebase
12+
uses: actions/checkout@master
13+
14+
- name: setup python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.x'
18+
19+
- name: install dependencies
20+
run: pip3 install ansible ansible-lint yamllint
21+
22+
- name: check ansible-lint version
23+
run: ansible-lint --version
24+
25+
- name: lint
26+
run: |
27+
ansible-lint .
28+
yamllint .

example.vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
config_dir: '/home/ansible/omada/'
33
omada_url: https://static.tp-link.com/2021/202105/20210507/Omada_SDN_Controller_v4.3.5_linux_x64.tar.gz
44
omada_dir: '/home/ansible/omada/'
5+
mongo_url: https://repo.mongodb.org/yum/redhat/{{ ansible_distribution_major_version }}/mongodb-org/3.6/x86_64/RPMS/mongodb-org-server-3.6.23-1.el{{ ansible_distribution_major_version }}.x86_64.rpm

main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
pre_tasks:
66
- name: vars
77
include_vars: vars.yml
8-
8+
99
- name: install packages
1010
import_tasks: tasks/packages.yml
11-
11+
1212
tasks:
1313
- name: download Controller from tplink
1414
import_tasks: tasks/setup.yml

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
collections:
3-
- community.general
3+
- community.general

tasks/ip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
register: ip
66
when: omada_preset.rc == 0
77

8-
- name: url
8+
- name: url
99
debug:
10-
msg: "Omada Controller is running at {{ ipify_public_ip }}:8088"
10+
msg: "Omada Controller is running at {{ ipify_public_ip }}:8088"

tasks/omada.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22

33
- name: Install Omada
4-
become: yes
4+
become: 'yes'
55
command: install.sh -y -n
66
args:
77
chdir: /home/ansible/omada/
88
register: omadainstall
99
when: omada_preset.rc == 1
1010

11-
- name: omada install status
11+
- name: omada install status
1212
debug:
1313
msg: "{{ omadainstall.stdout_lines }}"
1414
when: omada_preset.rc == 1
@@ -18,5 +18,3 @@
1818
name: tpeap
1919
state: started
2020
enabled: true
21-
22-

tasks/packages.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010
- name: apt install packages
1111
apt:
1212
name:
13-
- mongodb
14-
- jsvc
15-
- curl
16-
- openjdk-8-jre-headless
13+
- mongodb
14+
- jsvc
15+
- curl
16+
- openjdk-8-jre-headless
1717
state: present
1818
cache_valid_time: 3600
1919
when: ansible_facts.os_family == "Debian"
2020

2121
- name: yum cache update & upgrade
22-
yum:
22+
yum:
2323
name: "*"
2424
state: latest
2525
update_cache: true
2626
when: ansible_facts.os_family == "RedHat"
27-
27+
2828
- name: yum install packages
2929
yum:
30-
name:
30+
name:
3131
- curl
3232
- java-1.8.0-openjdk-headless.x86_64
3333
- jsvc
@@ -37,7 +37,7 @@
3737

3838
- name: Install mongodb from rpm
3939
yum:
40-
name: https://repo.mongodb.org/yum/redhat/{{ ansible_distribution_major_version }}/mongodb-org/3.6/x86_64/RPMS/mongodb-org-server-3.6.23-1.el{{ ansible_distribution_major_version }}.x86_64.rpm
40+
name: " {{ mongo_url }} "
4141
state: present
4242
when: ansible_facts.os_family == "RedHat"
4343

@@ -59,4 +59,4 @@
5959
failed_when: false
6060
changed_when: false
6161
check_mode: false
62-
register: omada_preset
62+
register: omada_preset

tasks/setup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
- name: Create Omada Directory "{{ omada_dir }}"
4-
file:
4+
file:
55
path: "{{ omada_dir }}"
66
state: directory
77
mode: '0755'
@@ -10,6 +10,6 @@
1010
unarchive:
1111
src: "{{ omada_url }}"
1212
dest: "{{ omada_dir }}"
13-
remote_src: yes
14-
extra_opts:
15-
--strip-components=1
13+
remote_src: 'yes'
14+
extra_opts:
15+
--strip-components=1

0 commit comments

Comments
 (0)