Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sleighzy committed Oct 22, 2023
1 parent e411a26 commit 4587219
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 143 deletions.
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ galaxy_info:
platforms:
- name: EL
versions:
- 7
- 8
- '7'
- '8'
- name: Debian
versions:
- buster
Expand Down
26 changes: 13 additions & 13 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

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 'zookeeper' exists
assert:
ansible.builtin.assert:
that:
- "'zookeeper' in getent_passwd"
- "'zookeeper' in getent_group"
Expand All @@ -22,7 +22,7 @@
register: install_dir

- name: Assert that '/usr/share/apache-zookeeper-3.7.1' directory is created
assert:
ansible.builtin.assert:
that:
- install_dir.stat.exists
- install_dir.stat.isdir
Expand All @@ -35,7 +35,7 @@
register: zookeeper_dir

- name: Assert that '/usr/share/zookeeper' symlink is created
assert:
ansible.builtin.assert:
that:
- zookeeper_dir.stat.exists
- zookeeper_dir.stat.islnk
Expand All @@ -47,7 +47,7 @@
register: config_dir

- name: Assert that '/etc/zookeeper' directory is created
assert:
ansible.builtin.assert:
that:
- config_dir.stat.exists
- config_dir.stat.isdir
Expand All @@ -58,7 +58,7 @@
service_facts:

- name: Assert that the ZooKeeper service is installed, running, and enabled
assert:
ansible.builtin.assert:
that:
- "'zookeeper.service' in ansible_facts.services"
- ansible_facts.services['zookeeper.service'].state == 'running'
Expand All @@ -67,13 +67,13 @@
- name: Delete Znode if it already exists

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

View workflow job for this annotation

GitHub Actions / Linter

ignore-errors

Use failed_when and specify error conditions instead of using ignore_errors.
block:
- name: Get Znode
command: /usr/share/zookeeper/bin/zkCli.sh get /TestZnode1
ansible.builtin.command: /usr/share/zookeeper/bin/zkCli.sh get /TestZnode1
when: ansible_hostname == "zookeeper-1"
ignore_errors: yes
register: command_result

- name: Delete Znode if it already exists
command: /usr/share/zookeeper/bin/zkCli.sh delete /TestZnode1
ansible.builtin.command: /usr/share/zookeeper/bin/zkCli.sh delete /TestZnode1
register: command_result
when:
- ansible_hostname == "zookeeper-1"
Expand All @@ -85,7 +85,7 @@
- name: Create Znode and assert visible by all servers
block:
- name: Create a Znode entry in ZooKeeper
command: /usr/share/zookeeper/bin/zkCli.sh create /TestZnode1 "test-node-1"
ansible.builtin.command: /usr/share/zookeeper/bin/zkCli.sh create /TestZnode1 "test-node-1"
when: ansible_hostname == "zookeeper-1"
register: command_result

Expand All @@ -95,16 +95,16 @@
when: ansible_hostname == "zookeeper-1"

- name: Assert that the Znode creation command succeeded
assert:
ansible.builtin.assert:
that:
- '"Created /TestZnode1" in command_result.stderr'
when: ansible_hostname == "zookeeper-1"

- name: Read the created Znode
command: /usr/share/zookeeper/bin/zkCli.sh get /TestZnode1
ansible.builtin.command: /usr/share/zookeeper/bin/zkCli.sh get /TestZnode1
register: command_result

- name: Assert that ZooKeeper servers can read the created Znode
assert:
ansible.builtin.assert:
that:
- '"test-node-1" in command_result.stdout'
Loading

0 comments on commit 4587219

Please sign in to comment.