aboutsummaryrefslogtreecommitdiffstats
path: root/roles/obsd_httpd
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2026-10-07 21:06:35 -0700
committerEugene Triguba <hello@eugenetriguba.com>2026-10-11 18:36:50 -0700
commitf60e2a723c744628823cad6344a8d3d0dd4c32e4 (patch)
tree02201b37edbe05070aac9c5f2c2335dbe25c22bc /roles/obsd_httpd
parentRetab file (diff)
downloadsite-configs-f60e2a723c744628823cad6344a8d3d0dd4c32e4.zip
Update configs
Diffstat (limited to 'roles/obsd_httpd')
-rw-r--r--roles/obsd_httpd/handlers/main.yml2
-rw-r--r--roles/obsd_httpd/tasks/main.yml27
2 files changed, 3 insertions, 26 deletions
diff --git a/roles/obsd_httpd/handlers/main.yml b/roles/obsd_httpd/handlers/main.yml
deleted file mode 100644
index 3af955f..0000000
--- a/roles/obsd_httpd/handlers/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-- name: restart httpd
- ansible.builtin.command: rcctl restart httpd
diff --git a/roles/obsd_httpd/tasks/main.yml b/roles/obsd_httpd/tasks/main.yml
index 36ff9fb..6e21ab8 100644
--- a/roles/obsd_httpd/tasks/main.yml
+++ b/roles/obsd_httpd/tasks/main.yml
@@ -16,8 +16,6 @@
notify: restart httpd
- name: Ensure all registered httpd fragment files exist
- # If they don't exist, httpd validate will fail. So we want to create them,
- # even if empty for now.
ansible.builtin.copy:
content: ""
dest: "{{ httpd_conf_d }}/{{ item }}"
@@ -27,29 +25,10 @@
mode: "0644"
loop: "{{ httpd_fragments }}"
-- name: Validate httpd config
- ansible.builtin.command: httpd -n
- changed_when: false
-
- name: Enable httpd and slowcgi
- ansible.builtin.command: "rcctl enable {{ item }}"
- args:
- creates: "/etc/rc.conf.d/{{ item }}"
- loop:
- - httpd
- - slowcgi
- changed_when: true
-
-- name: Check service status
- ansible.builtin.command: rcctl check {{ item }}
- register: httpd_check
- changed_when: false
- failed_when: false # rc 1 exit code means "not running"
+ ansible.builtin.service:
+ name: "{{ item }}"
+ enabled: true
loop:
- httpd
- slowcgi
-
-- name: Start services that are not running
- ansible.builtin.command: rcctl start {{ item.item }}
- loop: "{{ httpd_check.results }}"
- when: item.rc != 0