From 54caed729903a57e37f6337ef3ae398ad7e69bf7 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Sat, 18 Jun 2016 14:44:59 +0200 Subject: [PATCH] Complete RackTables installation. --- roles/racktables/tasks/main.yml | 11 +++++ roles/racktables/templates/secret.php.j2 | 55 ++++++++++++++++++++++++ roles/racktables/templates/vhost.j2 | 2 +- 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 roles/racktables/templates/secret.php.j2 diff --git a/roles/racktables/tasks/main.yml b/roles/racktables/tasks/main.yml index 7dab177..584ad93 100644 --- a/roles/racktables/tasks/main.yml +++ b/roles/racktables/tasks/main.yml @@ -6,7 +6,9 @@ - mysql-server - php5-fpm - php5-gd + - php5-ldap - php5-mysql + - php5-snmp - python-mysqldb - name: Configure MySQL database @@ -18,6 +20,15 @@ - name: Create vhost directory file: path=/var/www/racktables state=directory owner=www-data group=www-data +- name: Unpack RackTables + unarchive: src=http://heanet.dl.sourceforge.net/project/racktables/RackTables-0.20.11.tar.gz dest=/opt copy=no + +- name: Create link + file: src=/opt/RackTables-0.20.11 dest=/opt/racktables state=link + +- name: Configure RackTables + template: src=secret.php.j2 dest=/opt/RackTables-0.20.11/wwwroot/inc/secret.php owner=www-data group=www-data mode=0400 + - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/racktables notify: Restart nginx diff --git a/roles/racktables/templates/secret.php.j2 b/roles/racktables/templates/secret.php.j2 new file mode 100644 index 0000000..f99abd2 --- /dev/null +++ b/roles/racktables/templates/secret.php.j2 @@ -0,0 +1,55 @@ + 'localhost', +# 'domain' => 'example.com', +# 'search_attr' => '', +# 'search_dn' => '', +# // The following credentials will be used when searching for the user's DN: +# 'search_bind_rdn' => NULL, +# 'search_bind_password' => NULL, +# 'displayname_attrs' => '', +# 'options' => array (LDAP_OPT_PROTOCOL_VERSION => 3), +# 'use_tls' => 2, // 0 == don't attempt, 1 == attempt, 2 == require +#); + +# For SAML configuration details: +# http://wiki.racktables.org/index.php?title=SAML + +#$SAML_options = array +#( +# 'simplesamlphp_basedir' => '../simplesaml', +# 'sp_profile' => 'default-sp', +# 'usernameAttribute' => 'eduPersonPrincipName', +# 'fullnameAttribute' => 'fullName', +# 'groupListAttribute' => 'memberOf', +#); + +# This HTML banner is intended to assist users in dispatching their issues +# to the local tech support service. Its text (in its verbatim form) will +# be appended to assorted error messages visible in user's browser (including +# "not authenticated" message). Beware of placing any sensitive information +# here, it will be readable by unauthorized visitors. +#$helpdesk_banner = 'This RackTables instance is supported by Example Inc. IT helpdesk, dial ext. 1234 to report a problem.'; + +?> diff --git a/roles/racktables/templates/vhost.j2 b/roles/racktables/templates/vhost.j2 index 793cc43..a4cd9f3 100644 --- a/roles/racktables/templates/vhost.j2 +++ b/roles/racktables/templates/vhost.j2 @@ -4,7 +4,7 @@ server { server_name {{ racktables_domain }}; - root /var/www/racktables; + root /opt/racktables/wwwroot; index index.php;