Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/roles/httpd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@
dest: /etc/systemd/system/httpd.service.d/foreman-target.conf
mode: "0644"
content: |
[Install]
WantedBy=default.target foreman.target
[Unit]
PartOf=foreman.target
[Install]
WantedBy=foreman.target
notify: Restart httpd

- name: Reload systemd daemon
ansible.builtin.systemd:
daemon_reload: true
Expand Down
8 changes: 6 additions & 2 deletions tests/httpd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ def test_httpd_headers_use_dashes(server):
assert cmd.stdout.strip() == '', f"HTTP header names should use dashes, not underscores:\n{cmd.stdout}"


def test_httpd_foreman_target_drop_in(server):
def test_httpd_foreman_target_config(server):
drop_in = server.file("/etc/systemd/system/httpd.service.d/foreman-target.conf")
assert drop_in.exists
assert drop_in.is_file
assert drop_in.contains("PartOf=foreman.target")
assert drop_in.contains("WantedBy=foreman.target")
assert drop_in.contains(r"WantedBy=default\.target foreman\.target")

wants_link = server.file("/etc/systemd/system/foreman.target.wants/httpd.service")
assert wants_link.exists
assert wants_link.is_symlink
Loading