summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWesley Hearn <wesley.s.hearn@gmail.com>2015-10-20 12:24:15 -0400
committerWesley Hearn <wesley.s.hearn@gmail.com>2015-10-20 12:24:15 -0400
commit96d45a6b6115338c467baebaba837847a05508dd (patch)
treeb4cfe387cb8d64ee66c1534182553d9c58d8134e
parenta6d3017291433413649c915cfb3de90b362175fa (diff)
parent05c5d6e1a0de2e7a5f5cb509b08981ba9b1ec69b (diff)
downloadopenshift-96d45a6b6115338c467baebaba837847a05508dd.tar.gz
openshift-96d45a6b6115338c467baebaba837847a05508dd.tar.bz2
openshift-96d45a6b6115338c467baebaba837847a05508dd.tar.xz
openshift-96d45a6b6115338c467baebaba837847a05508dd.zip
Merge pull request #529 from sdodson/cockpit-master
Add cockpit role
-rw-r--r--inventory/byo/hosts.example6
-rw-r--r--playbooks/common/openshift-master/config.yml9
-rw-r--r--roles/cockpit/defaults/main.yml5
-rw-r--r--roles/cockpit/meta/main.yml15
-rw-r--r--roles/cockpit/tasks/main.yml16
5 files changed, 51 insertions, 0 deletions
diff --git a/inventory/byo/hosts.example b/inventory/byo/hosts.example
index df1bae49f..f554cc660 100644
--- a/inventory/byo/hosts.example
+++ b/inventory/byo/hosts.example
@@ -44,6 +44,12 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Configure Fluentd
#use_fluentd=true
+# Enable cockpit
+#osm_use_cockpit=true
+#
+# Set cockpit plugins
+#osm_cockpit_plugins=['cockpit-kubernetes']
+
# master cluster ha variables using pacemaker or RHEL HA
#openshift_master_cluster_password=openshift_cluster
#openshift_master_cluster_vip=192.168.133.25
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index 64cf7a65b..14ec82e85 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -221,6 +221,15 @@
- role: openshift_cluster_metrics
when: openshift.common.use_cluster_metrics | bool
+- name: Enable cockpit
+ hosts: oo_first_master
+ vars:
+ cockpit_plugins: "{{ osm_cockpit_plugins | default(['cockpit-kubernetes']) }}"
+ roles:
+ - role: cockpit
+ when: ( deployment_type in ['atomic-enterprise','openshift-enterprise'] ) and
+ (osm_use_cockpit | bool or osm_use_cockpit is undefined )
+
# Additional instance config for online deployments
- name: Additional instance config
hosts: oo_masters_deployment_type_online
diff --git a/roles/cockpit/defaults/main.yml b/roles/cockpit/defaults/main.yml
new file mode 100644
index 000000000..ffd55f1dd
--- /dev/null
+++ b/roles/cockpit/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+os_firewall_use_firewalld: false
+os_firewall_allow:
+- service: cockpit-ws
+ port: 9090/tcp
diff --git a/roles/cockpit/meta/main.yml b/roles/cockpit/meta/main.yml
new file mode 100644
index 000000000..1e3948b19
--- /dev/null
+++ b/roles/cockpit/meta/main.yml
@@ -0,0 +1,15 @@
+---
+galaxy_info:
+ author: Scott Dodson
+ description: Deploy and Enable cockpit-ws plus optional plugins
+ company: Red Hat, Inc.
+ license: Apache License, Version 2.0
+ min_ansible_version: 1.7
+ platforms:
+ - name: EL
+ versions:
+ - 7
+ categories:
+ - cloud
+dependencies:
+ - { role: os_firewall }
diff --git a/roles/cockpit/tasks/main.yml b/roles/cockpit/tasks/main.yml
new file mode 100644
index 000000000..875cbad21
--- /dev/null
+++ b/roles/cockpit/tasks/main.yml
@@ -0,0 +1,16 @@
+---
+- name: Install cockpit-ws
+ yum:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - cockpit-ws
+ - cockpit-shell
+ - cockpit-bridge
+ - "{{ cockpit_plugins }}"
+
+- name: Enable cockpit-ws
+ service:
+ name: cockpit.socket
+ enabled: true
+ state: started