diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 584056eb0..4102bc168 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -147,7 +147,7 @@ - base - include: home-page.yml - + - name: place the script to generate home pages template: src=refresh-wiki-docs.sh dest=/usr/bin/iiab-refresh-wiki-docs @@ -156,3 +156,8 @@ - name: generate the offline documents command: /usr/bin/iiab-refresh-wiki-docs when: not nodocs + +- name: Give apache_user permission for poweroff + template: src=020_apache_poweroff.j2 + dest=/etc/sudoers.d/020_apache_poweroff + mode=0755 diff --git a/roles/httpd/templates/020_apache_poweroff.j2 b/roles/httpd/templates/020_apache_poweroff.j2 new file mode 100644 index 000000000..828472aa7 --- /dev/null +++ b/roles/httpd/templates/020_apache_poweroff.j2 @@ -0,0 +1 @@ +{{ apache_user }} ALL =NOPASSWD: /sbin/poweroff, /bin/systemctl poweroff \ No newline at end of file