diff options
Diffstat (limited to '')
-rw-r--r-- | scripts/nginx/main.yml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/scripts/nginx/main.yml b/scripts/nginx/main.yml new file mode 100644 index 0000000..59c8d1f --- /dev/null +++ b/scripts/nginx/main.yml @@ -0,0 +1,63 @@ +# Copyright (C) 2017 Xin Liang +# +# License: GNU General Public License (GPL) +version: 2.2 +category: Server +shortdesc: Nginx Webserver +longdesc: | + Configure a resource group containing a virtual IP address and + an instance of the Nginx web server. + + You can optionally configure a file system resource which will be + mounted before the web server is started. + + You can also optionally configure a database resource which will + be started before the web server but after mounting the optional + file system. +include: + - agent: ocf:heartbeat:nginx + name: nginx + longdesc: | + The Nginx configuration file specified here must be available via the + same path on all cluster nodes; And nginx.service should be disabled on + all cluster nodes; And "server_name" option in nginx configure file + should be related with virtual IP. + ops: | + op start timeout="40" + op stop timeout="60" + op monitor interval="10" timeout="30" + - script: virtual-ip + shortdesc: The IP address configured here will start before the Nginx instance. + parameters: + - name: id + value: "{{id}}-vip" + - script: filesystem + shortdesc: Optional file system mounted before the web server is started. + required: false + - script: database + shortdesc: Optional database started before the web server is started. + required: false +parameters: + - name: install + type: boolean + shortdesc: Install and configure nginx + value: false +actions: + - install: + - nginx + shortdesc: Install the nginx package + when: install + - service: + - apache: disable + shortdesc: Let cluster manage nginx + when: install + - include: filesystem + - include: database + - include: virtual-ip + - include: nginx + - cib: | + group g-{{id}} + {{filesystem:id}} + {{database:id}} + {{virtual-ip:id}} + {{id}} |