Skip to content

Commit

Permalink
Merge pull request #53 from sleighzy/fix-ansible-tests
Browse files Browse the repository at this point in the history
Fix Ansible Molecule unit tests
  • Loading branch information
sleighzy authored Aug 30, 2024
2 parents 3d2f890 + 1dbaac3 commit 92420cb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 97 deletions.
21 changes: 6 additions & 15 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,49 +32,40 @@ platforms:
groups:
- zookeeper-nodes
- name: zookeeper-2
image: geerlingguy/docker-debian10-ansible:latest
docker_networks:
- name: zookeeper
ipam_config:
- subnet: '172.26.0.0/16'
image: redhat/ubi9:latest
networks:
- name: zookeeper
ipv4_address: '172.26.10.2'
etc_hosts: "{'zookeeper-1': '172.26.10.1', 'zookeeper-3': '172.26.10.3'}"
pre_build_image: true
privileged: true
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
command: '/usr/lib/systemd/systemd'
pre_build_image: true
capabilities:
- SYS_ADMIN
command: /lib/systemd/systemd
groups:
- zookeeper-nodes
- name: zookeeper-3
image: geerlingguy/docker-debian10-ansible:latest
docker_networks:
- name: zookeeper
ipam_config:
- subnet: '172.26.0.0/16'
image: redhat/ubi9:latest
networks:
- name: zookeeper
ipv4_address: '172.26.10.3'
etc_hosts: "{'zookeeper-1': '172.26.10.1', 'zookeeper-2': '172.26.10.2'}"
pre_build_image: true
privileged: true
tmpfs:
- /run
- /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
command: '/usr/lib/systemd/systemd'
pre_build_image: true
capabilities:
- SYS_ADMIN
command: /lib/systemd/systemd
groups:
- zookeeper-nodes
provisioner:
Expand Down
22 changes: 6 additions & 16 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,18 @@
gather_facts: true

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

- name: Install python-firewall
ansible.builtin.yum:
name:
- python3-firewall
- firewalld
state: installed
when: ansible_distribution == "Rocky" and ansible_distribution_major_version == "8"
when: ansible_os_family == "RedHat"

- name: Install python-firewall
- name: Install Java 8 (OpenJDK) on RedHat/CentOS
ansible.builtin.yum:
name:
- python-firewall
- firewalld
name: java-1.8.0-openjdk
state: installed
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
when: ansible_os_family == "RedHat"

- name: Install Java 11 (OpenJDK) on Debian
ansible.builtin.apt:
Expand All @@ -44,9 +35,8 @@
state: present
when: ansible_os_family == "Debian"

- name: Install ps on Rocky Linux
- name: Install ps on RedHat/CentOS
ansible.builtin.yum:
name: procps
state: present
use_backend: dnf
when: ansible_distribution == "Rocky" and ansible_distribution_major_version == "8"
when: ansible_os_family == "RedHat"
1 change: 1 addition & 0 deletions templates/zookeeper.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ExecStart={{ zookeeper_dir }}/bin/zkServer.sh start
ExecStop={{ zookeeper_dir }}/bin/zkServer.sh stop
SuccessExitStatus=143
Restart=on-failure
RestartSec=5
User={{ zookeeper_user }}
Group={{ zookeeper_group }}

Expand Down
8 changes: 0 additions & 8 deletions tests/inventory

This file was deleted.

2 changes: 0 additions & 2 deletions tests/requirements.yml

This file was deleted.

56 changes: 0 additions & 56 deletions tests/test.yaml

This file was deleted.

0 comments on commit 92420cb

Please sign in to comment.