Skip to content

Commit

Permalink
Split service task into separate file (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Nov 8, 2023
1 parent ec542e6 commit 3b0a72e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 1 addition & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ galaxy_info:
- all
galaxy_tags: ['heartbeat']

dependencies:
- name: nephelaiio.elastic_repo
when: heartbeat_repo_manage
dependencies: []
2 changes: 1 addition & 1 deletion molecule/7x/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependency:
driver:
name: docker
platforms:
- name: instance
- name: heartbeat-7x
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
Expand Down
2 changes: 1 addition & 1 deletion molecule/8x/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependency:
driver:
name: docker
platforms:
- name: instance
- name: heartbeat-8x
image: "geerlingguy/docker-${MOLECULE_DOCKER_IMAGE:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
Expand Down
12 changes: 7 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---
- name: Configure elastic repository
ansible.builtin.include_role:
name: nephelaiio.elastic_repo
when: heartbeat_repo_manage

- name: Collect package facts
ansible.builtin.package_facts:
manager: auto
Expand Down Expand Up @@ -75,8 +80,5 @@
notify: heartbeat_restart
when: heartbeat_conf_manage

- name: Manage heartbeat services
ansible.builtin.service:
name: "{{ heartbeat_service_name }}"
state: "{{ heartbeat_service_status }}"
enabled: "{{ heartbeat_service_enabled }}"
- name: Include service tasks
ansible.builtin.include_tasks: service.yml
6 changes: 6 additions & 0 deletions tasks/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Manage heartbeat services
ansible.builtin.service:
name: "{{ heartbeat_service_name }}"
state: "{{ heartbeat_service_status }}"
enabled: "{{ heartbeat_service_enabled }}"

0 comments on commit 3b0a72e

Please sign in to comment.