Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mbohun/f76fcaf455c8fc169c40 to your computer and use it in GitHub Desktop.
Save mbohun/f76fcaf455c8fc169c40 to your computer and use it in GitHub Desktop.
From c4a2d5ac5c75eda619c5df52879a251787a90f66 Mon Sep 17 00:00:00 2001
From: mbohun <[email protected]>
Date: Fri, 20 Jun 2014 16:30:08 +1000
Subject: [PATCH] initial version of ansible support for dashboard
---
.gitignore | 1 +
ansible/dashboard-standalone.yml | 7 +++++++
ansible/roles/dashboard/tasks/main.yml | 17 +++++++++++++++++
.../dashboard/templates/dashboard-config.properties | 12 ++++++++++++
ansible/roles/dashboard/vars/main.yml | 2 ++
5 files changed, 39 insertions(+)
create mode 100644 ansible/dashboard-standalone.yml
create mode 100644 ansible/roles/dashboard/tasks/main.yml
create mode 100644 ansible/roles/dashboard/templates/dashboard-config.properties
create mode 100644 ansible/roles/dashboard/vars/main.yml
diff --git a/.gitignore b/.gitignore
index 6be3615..518bec9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*~
*.class
# Package Files #
diff --git a/ansible/dashboard-standalone.yml b/ansible/dashboard-standalone.yml
new file mode 100644
index 0000000..c604136
--- /dev/null
+++ b/ansible/dashboard-standalone.yml
@@ -0,0 +1,7 @@
+- hosts: dashboard-service
+ roles:
+ - common
+ - java
+ - tomcat
+ - apache
+ - dashboard
diff --git a/ansible/roles/dashboard/tasks/main.yml b/ansible/roles/dashboard/tasks/main.yml
new file mode 100644
index 0000000..ddd2ca4
--- /dev/null
+++ b/ansible/roles/dashboard/tasks/main.yml
@@ -0,0 +1,17 @@
+- include: ../../common/tasks/setfacts.yml
+
+- name: download from maven repo
+ command: "wget {{dashboard_war_url}} --output-document={{tomcat_webapps}}dashboard.war"
+
+- name: ensure target directories exist [data subdirectories etc.]
+ file: path={{item}} state=directory owner={{tomcat_user}} group={{tomcat_user}}
+ with_items:
+ - "{{data_dir}}/dashboard/config"
+
+- name: copy all config.properties
+ template: src=dashboard-config.properties dest={{data_dir}}/dashboard/config/dashboard-config.properties
+
+- name: set data ownership
+ file: path={{data_dir}}/dashboard owner={{tomcat_user}} group={{tomcat_user}} recurse=true
+ notify:
+ - restart tomcat
diff --git a/ansible/roles/dashboard/templates/dashboard-config.properties b/ansible/roles/dashboard/templates/dashboard-config.properties
new file mode 100644
index 0000000..dab8a63
--- /dev/null
+++ b/ansible/roles/dashboard/templates/dashboard-config.properties
@@ -0,0 +1,12 @@
+# CAS Config
+casProperties=casServerLoginUrl,serverName,centralServer,casServerName,uriFilterPattern,uriExclusionFilter,authenticateOnlyIfLoggedInFilterPattern,casServerLoginUrlPrefix,gateway,casServerUrlPrefix,contextPath
+serverName={{dashboard_base_url}}
+contextPath={{dashboard_context_path}}
+grails.serverURL={{dashboard_base_url}}{{dashboard_context_path}}
+casServerName=https://auth.ala.org.au
+uriExclusionFilterPattern=/images.*,/css.*,/js.*,/less.*
+casServerLoginUrl=https://auth.ala.org.au/cas/login
+gateway=false
+casServerUrlPrefix=https://auth.ala.org.au/cas
+security.cas.logoutUrl=https://auth.ala.org.au/cas/logout
+uriFilterPattern=
diff --git a/ansible/roles/dashboard/vars/main.yml b/ansible/roles/dashboard/vars/main.yml
new file mode 100644
index 0000000..12335c1
--- /dev/null
+++ b/ansible/roles/dashboard/vars/main.yml
@@ -0,0 +1,2 @@
+# assets
+dashboard_war_url: "{{maven_repo}}/au/org/ala/dashboard/dashboard.war"
--
1.9.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment