1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

6.3 pwroff (#107)

* poweroff

* poweroff

* poweroff
This commit is contained in:
Tim Moody 2017-07-06 17:44:07 -04:00 committed by georgejhunt
parent 4461ef2189
commit 8cf6af0f1b
5 changed files with 33 additions and 6 deletions

View file

@ -54,7 +54,7 @@
- "{{ doc_root }}/common/html" - "{{ doc_root }}/common/html"
- "{{ doc_root }}/common/images" - "{{ doc_root }}/common/images"
- "{{ doc_root }}/common/assets" - "{{ doc_root }}/common/assets"
- "{{ doc_root }}/common/menu-defs" - "{{ doc_root }}/common/services"
- name: Create olpc-scripts directory - name: Create olpc-scripts directory
file: path={{ item }} file: path={{ item }}

View file

@ -0,0 +1,5 @@
<?php
echo exec ( "sudo poweroff");
?>

View file

@ -3,13 +3,21 @@
state=present state=present
with_items: with_items:
- apache2 - apache2
- php5 - php{{ php_version }}
- php5-curl - php{{ php_version }}-curl
- php5-sqlite # - php{{ php_version }}-sqlite
tags: tags:
- download - download
when: is_debian when: is_debian
- name: Debian changed sqlite name
package: name=php{{ php_version }}-sqlite
when: is_debian and ansible_distribution_major_version == "8"
- name: Debian changed sqlite name
package: name=php{{ php_version }}-sqlite3
when: ansible_local.local_facts.os_ver == "debian-9"
- name: Install httpd required packages - name: Install httpd required packages
package: name={{ item }} package: name={{ item }}
state=present state=present
@ -139,7 +147,7 @@
- base - base
- include: home-page.yml - include: home-page.yml
- name: place the script to generate home pages - name: place the script to generate home pages
template: src=refresh-wiki-docs.sh template: src=refresh-wiki-docs.sh
dest=/usr/bin/iiab-refresh-wiki-docs dest=/usr/bin/iiab-refresh-wiki-docs
@ -147,5 +155,15 @@
- name: generate the offline documents - name: generate the offline documents
command: /usr/bin/iiab-refresh-wiki-docs 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
when: allow_apache_sudo
- name: Remove apache_user permission for poweroff
file: dest=/etc/sudoers.d/020_apache_poweroff
state=absent
when: not allow_apache_sudo

View file

@ -0,0 +1 @@
{{ apache_user }} ALL =NOPASSWD: /sbin/poweroff, /bin/systemctl poweroff

View file

@ -88,6 +88,9 @@ wan_nameserver:
# 3-BASE # 3-BASE
# apache
allow_apache_sudo: False
# dhcpd # dhcpd
dhcpd_install: True dhcpd_install: True
dhcpd_enabled: False dhcpd_enabled: False
@ -169,7 +172,7 @@ ejabberd_enabled: False
# idmgr and activity-server # idmgr and activity-server
idmgr_install: True idmgr_install: True
activity-server_install: True activity_server_install: False
xo_services_enabled: False xo_services_enabled: False
# 6-GENERIC-APPS # 6-GENERIC-APPS