Skip to content

Commit

Permalink
Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sleighzy committed Nov 29, 2023
1 parent d52739a commit 0a9cb72
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 60 deletions.
7 changes: 4 additions & 3 deletions handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
- name: Reload initd
command: initctl reload-configuration
ansible.builtin.command: initctl reload-configuration
changed_when: false

- name: Restart kafka service
service:
ansible.builtin.service:
name: kafka
state: restarted
when: kafka_restart

- name: Restart kafka systemd
systemd:
ansible.builtin.systemd:
name: kafka
state: restarted
daemon_reload: yes
Expand Down
6 changes: 3 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ galaxy_info:
platforms:
- name: EL
versions:
- 6
- 7
- 8
- '6'
- '7'
- '8'
- name: Debian
versions:
- buster
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

tasks:
- name: 'Test Kafka role'
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
6 changes: 3 additions & 3 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

pre_tasks:
- name: Install Java 8 (OpenJDK) on RedHat/CentOS
yum:
ansible.builtin.yum:
name: java-1.8.0-openjdk
state: installed
when: ansible_os_family == "RedHat"

- name: Install Java 11 (OpenJDK) on Debian
apt:
ansible.builtin.apt:
name: openjdk-11-jdk
state: present
update_cache: yes
Expand All @@ -23,7 +23,7 @@
# ZooKeeper service is constantly restarted by systemd which causes
# the Molecule tests to fail as the service is not started correctly.
- name: Install ps on Debian
apt:
ansible.builtin.apt:
name: procps
state: present
when: ansible_os_family == "Debian"
Expand Down
42 changes: 21 additions & 21 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@

tasks:
- name: Get users
getent:
ansible.builtin.getent:
database: passwd

- name: Get groups
getent:
ansible.builtin.getent:
database: group

- name: Assert that user and group 'kafka' exists
assert:
- name: ansible.builtin.assert that user and group 'kafka' exists

Check failure on line 13 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- "'kafka' in getent_passwd"
- "'kafka' in getent_group"

- name: Register '/opt/kafka_2.13-3.5.1' installation directory status
stat:
ansible.builtin.stat:
path: '/opt/kafka_2.13-3.5.1'
register: install_dir

- name: Assert that '/opt/kafka_2.13-3.5.1' directory is created
assert:
- name: ansible.builtin.assert that '/opt/kafka_2.13-3.5.1' directory is created

Check failure on line 24 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- install_dir.stat.exists
- install_dir.stat.isdir
- install_dir.stat.pw_name == 'kafka'
- install_dir.stat.gr_name == 'kafka'

- name: Register '/opt/kafka' symlink directory status
stat:
ansible.builtin.stat:
path: '/opt/kafka'
register: kafka_dir

- name: Assert that '/opt/kafka' symlink is created
assert:
- name: ansible.builtin.assert that '/opt/kafka' symlink is created

Check failure on line 37 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- kafka_dir.stat.exists
- kafka_dir.stat.islnk
Expand All @@ -46,21 +46,21 @@
path: '/var/log/kafka'
register: kafka_log_dir

- name: Assert that '/var/log/kafka' directory is created
assert:
- name: ansible.builtin.assert that '/var/log/kafka' directory is created

Check failure on line 49 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- kafka_log_dir.stat.exists
- kafka_log_dir.stat.isdir
- kafka_log_dir.stat.pw_name == 'kafka'
- kafka_log_dir.stat.gr_name == 'kafka'

- name: Register '/opt/kafka/logs' symlink directory status
stat:
ansible.builtin.stat:
path: '/opt/kafka/logs'
register: application_logs_symlink

- name: Assert that '/opt/kafka/logs' symlink is created
assert:
- name: ansible.builtin.assert that '/opt/kafka/logs' symlink is created

Check failure on line 62 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- application_logs_symlink.stat.exists
- application_logs_symlink.stat.islnk
Expand All @@ -69,23 +69,23 @@
- application_logs_symlink.stat.gr_name == 'kafka'

- name: Register '/etc/kafka' directory status
stat:
ansible.builtin.stat:
path: '/etc/kafka'
register: config_dir

- name: Assert that '/etc/kafka' directory is created
assert:
- name: ansible.builtin.assert that '/etc/kafka' directory is created

Check failure on line 76 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- config_dir.stat.exists
- config_dir.stat.isdir
- config_dir.stat.pw_name == 'kafka'
- config_dir.stat.gr_name == 'kafka'

- name: Populate service facts
service_facts:
ansible.builtin.service_facts:

- name: Assert that Kafka service is installed, running, and enabled
assert:
- name: ansible.builtin.assert that Kafka service is installed, running, and enabled

Check failure on line 87 in molecule/default/verify.yml

View workflow job for this annotation

GitHub Actions / Linter

name[casing]

All names should start with an uppercase letter.
ansible.builtin.assert:
that:
- "'kafka.service' in ansible_facts.services"
- ansible_facts.services['kafka.service'].state == 'running'
Expand Down
Loading

0 comments on commit 0a9cb72

Please sign in to comment.