Skip to content

Commit

Permalink
Do not perform a systemd daemon-reload unless necessary
Browse files Browse the repository at this point in the history
Co-authored-by: Nick <[email protected]>
  • Loading branch information
jsf9k and mcdonnnj committed Jun 18, 2024
1 parent f70c8f9 commit 0e7990c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@
dest: /etc/systemd/system/amazon-cloudwatch-agent.service.d/override.conf
mode: 0644
src: override.conf
register: copy_dropin_file

# The AWS CloudWatch Agent systemd unit kicks off a process that
# starts the CloudWatch Agent and then dies. Therefore we can't start
# it here because it will be started again during the idempotence test
# and therefore will fail idempotence.
- name: Enable AWS CloudWatch Agent
ansible.builtin.systemd_service:
daemon_reload: true
# There is no need to perform a daemon-reload unless the config
# has changed.
daemon_reload: copy_dropin_file.changed
enabled: true
name: amazon-cloudwatch-agent

Expand Down

0 comments on commit 0e7990c

Please sign in to comment.