diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-03-27 11:26:17 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-10 10:55:33 +0000 |
commit | 973b9172664378406e7c844906277dce894f1467 (patch) | |
tree | 5a25979bfe457577f11dfcedf79b99f4e943ae31 /openstack/usr | |
parent | 9ad5d43eb64e1b4d42e27127a58a55ca655373e8 (diff) | |
download | definitions-973b9172664378406e7c844906277dce894f1467.tar.gz |
horizon: Move setup scripts to Ansible.
Now horizon-setup also configures Apache, given that they will be in
the same host. This can be split in different setup scripts.
Diffstat (limited to 'openstack/usr')
-rwxr-xr-x | openstack/usr/share/openstack/apache-httpd-server-setup | 47 | ||||
-rw-r--r-- | openstack/usr/share/openstack/horizon.yml | 25 | ||||
-rw-r--r-- | openstack/usr/share/openstack/openstack-horizon-setup | 40 |
3 files changed, 25 insertions, 87 deletions
diff --git a/openstack/usr/share/openstack/apache-httpd-server-setup b/openstack/usr/share/openstack/apache-httpd-server-setup deleted file mode 100755 index 8f8cdd60..00000000 --- a/openstack/usr/share/openstack/apache-httpd-server-setup +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2015 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -set -e - -if [ -f /var/openstack/apache-http-setup ]; then - exit 0 -fi - -############################################################################### -# Move suexec to the directory where apache is configured to have it # -# Check configure in strata/apache-httpd-server/httpd-server.morph # -############################################################################### -mkdir -p /var/www -groupadd -r apache -useradd -c "Apache Server" -d /var/www -g apache \ - -s /bin/false apache - -############################################################################### -# Move suexec to the directory where apache is configured to have it # -# Check configure in strata/apache-httpd-server/httpd-server.morph # -############################################################################### -mkdir -p /usr/lib/httpd -mv -v /usr/sbin/suexec /usr/lib/httpd/suexec -chgrp apache /usr/lib/httpd/suexec -chmod 4754 /usr/lib/httpd/suexec -chown -R apache:apache /var/www - -install -D -m 644 /proc/self/fd/0 <<'EOF' /var/openstack/apache-http-setup -Apache http setup: success -EOF - -exit 0 diff --git a/openstack/usr/share/openstack/horizon.yml b/openstack/usr/share/openstack/horizon.yml new file mode 100644 index 00000000..b6113b6b --- /dev/null +++ b/openstack/usr/share/openstack/horizon.yml @@ -0,0 +1,25 @@ +--- +- hosts: localhost + tasks: + +# Setup apache, this may end up in apache.yml + - name: Create the apache user. + user: name=apache comment="Apache Server" shell=/sbin/nologin home=/var/www + + - file: path=/usr/sbin/suexec group=apache mode=4750 + +# Setup horizon + - name: Create the horizon user. + user: name=horizon comment="Openstack Horizon User" shell=/sbin/nologin home=/var/lib/horizon + + - name: Create the /var folders for horizon + file: path={{ item }} state=directory owner=horizon group=horizon + with_items: + - /var/lib/horizon + + - file: src=/etc/horizon/apache-horizon.conf dest=/etc/httpd/conf.d/apache-horizon.conf state=link + + - name: Enable and start apache services needed by horizon + service: name={{ item }} enabled=yes state=started + with_items: + - apache-httpd.service diff --git a/openstack/usr/share/openstack/openstack-horizon-setup b/openstack/usr/share/openstack/openstack-horizon-setup deleted file mode 100644 index af944477..00000000 --- a/openstack/usr/share/openstack/openstack-horizon-setup +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -set -e - -if [ -f /var/openstack/horizon-setup ]; then - exit 0 -fi - -# Create required system users and groups -getent group horizon >/dev/null || groupadd -r --gid 167 horizon -getent passwd neutron >/dev/null || \ - useradd --uid 167 -r -g horizon -d /var/lib/horizon -s /sbin/nologin \ - -c "Horizon user" horizon - -chown -R horizon:horizon /var/lib/horizon - -# Link horizon configuration file for apache to the directory where our apache load -# configurations files -ln -sf /etc/horizon/apache-horizon.conf /etc/httpd/conf.d/apache-horizon.conf - -install -D -m 644 /proc/self/fd/0 <<'EOF' /var/openstack/horizon-setup -Horizon setup: success -EOF - -exit 0 |