]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
Move some defaults into a cephmetrics-common role
authorZack Cerza <zack@redhat.com>
Fri, 25 Aug 2017 22:36:41 +0000 (16:36 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 25 Aug 2017 22:38:12 +0000 (16:38 -0600)
This is so that ceph-collectd and ceph-grafana can share some defaults

Signed-off-by: Zack Cerza <zack@redhat.com>
ansible/roles/ceph-collectd/defaults/main.yml
ansible/roles/ceph-collectd/meta/main.yml [new file with mode: 0644]
ansible/roles/ceph-collectd/tasks/main.yml
ansible/roles/ceph-collectd/tasks/merge_vars.yml [new symlink]
ansible/roles/ceph-grafana/defaults/main.yml
ansible/roles/ceph-grafana/meta/main.yml [new file with mode: 0644]
ansible/roles/ceph-grafana/tasks/merge_vars.yml [changed from file to symlink]
ansible/roles/cephmetrics-common/defaults/main.yml [new file with mode: 0644]
ansible/roles/cephmetrics-common/tasks/main.yml [new file with mode: 0644]
ansible/roles/cephmetrics-common/tasks/merge_vars.yml [new file with mode: 0644]

index b3652a89a0d2527d26e5591e83c5fdba183ccab6..eb64af1d99e6bb754d101c08c72bc7f2197ea99d 100644 (file)
@@ -1,25 +1,23 @@
 ---
-containerized_deployment: false
-cluster: ceph
-use_epel: false
-devel_mode: true
-collector_dependencies:
-  yum:
-    # For the json python module
-    - python-libs
-    # For the rados python module
-    - python-rados
-    # For the ceph_daemon python module
-    - ceph-common
-    # For semodule
-    - make
-    - libsemanage-python
-    - policycoreutils-python
-    - selinux-policy-devel
-  apt:
-    # For the json module, via libpython2.7-stdlib
-    - python2.7
-    # For the rados python module
-    - python-rados
-    # For the ceph_daemon python module
-    - ceph-common
+defaults:
+  cluster: ceph
+  collector_dependencies:
+    yum:
+      # For the json python module
+      - python-libs
+      # For the rados python module
+      - python-rados
+      # For the ceph_daemon python module
+      - ceph-common
+      # For semodule
+      - make
+      - libsemanage-python
+      - policycoreutils-python
+      - selinux-policy-devel
+    apt:
+      # For the json module, via libpython2.7-stdlib
+      - python2.7
+      # For the rados python module
+      - python-rados
+      # For the ceph_daemon python module
+      - ceph-common
diff --git a/ansible/roles/ceph-collectd/meta/main.yml b/ansible/roles/ceph-collectd/meta/main.yml
new file mode 100644 (file)
index 0000000..56dd016
--- /dev/null
@@ -0,0 +1,3 @@
+---
+dependencies:
+  - role: cephmetrics-common
index 4ccf3df7c50d5f500d79547de977826e2eada787..afd77ed342ce356ab1c377001a1a20f37c8ac775 100644 (file)
@@ -1,4 +1,8 @@
 ---
+- include: merge_vars.yml
+  tags:
+    - always
+
 - include: setup_repos.yml
   when:
     - not containerized_deployment
diff --git a/ansible/roles/ceph-collectd/tasks/merge_vars.yml b/ansible/roles/ceph-collectd/tasks/merge_vars.yml
new file mode 120000 (symlink)
index 0000000..5057c16
--- /dev/null
@@ -0,0 +1 @@
+../../cephmetrics-common/tasks/merge_vars.yml
\ No newline at end of file
index 7cafab1cf9b5e50d22db8ae769a975b518ddbb2c..091e3b4db3b868299dacf6dc3898742885ac0c5b 100644 (file)
@@ -1,71 +1,10 @@
 ---
 defaults:
-  containerized_deployment: false
-  use_epel: false
-  devel_mode: true
+  # graphite defaults are now in the cephmetrics-common role since the
+  # ceph-collectd role needs access to them
   replace_dashboards: true
   grafana:
     datasource: Local
     # Note: changing this value won't update the password in Grafana itself;
     # change it via the web UI and then override this value to reflect.
     admin_password: admin
-  graphite:
-    service: graphite-web
-    web_port: "{{ graphite_port | default('8080') }}"
-    api_port: 8888
-    user: admin
-    password: admin
-    # The unix account running the graphite-web process
-    unix_user:
-      yum: apache
-      apt: _graphite
-    build_index:
-      yum: '/usr/bin/graphite-build-index'
-      apt: '/usr/bin/graphite-build-search-index'
-    apache_name:
-      yum: 'httpd'
-      apt: 'apache2'
-    apache_conf:
-      yum: '/etc/httpd/conf/httpd.conf'
-      apt: '/etc/apache2/apache2.conf'
-    site_conf:
-      yum: '/etc/httpd/conf.d/graphite-web.conf'
-      apt: '/etc/apache2/sites-available/graphite-web.conf'
-  carbon:
-    unix_user:
-      yum: carbon
-      apt: _graphite
-    storage_dir:
-      yum: /var/lib/carbon
-      apt: /var/lib/graphite
-  whisper:
-    retention:
-      - ['10s', '7d']
-      - ['1m', '30d']
-      - ['15m', '5y']
-  # The firewalld zone that carbon and grafana will use
-  firewalld_zone: public
-  # RHEL repos that need to be enabled with subscription-manager
-  rhsm_repos:
-    - rhel-7-server-rhscon-2-installer-rpms
-    - rhel-7-server-optional-rpms
-  devel_packages:
-    yum:
-      # unzip is needed to extract the Vonage plugin
-      - unzip
-      - graphite-web
-      - python-carbon
-      - grafana
-      # PyYAML is required by dashUpdater.py
-      - PyYAML
-    apt:
-      # unzip is needed to extract the Vonage plugin
-      - unzip
-      - graphite-web
-      - apache2
-      - libapache2-mod-wsgi
-      - graphite-carbon
-      - grafana
-      # for dashUpdater.py
-      - python-yaml
-      - python-requests
diff --git a/ansible/roles/ceph-grafana/meta/main.yml b/ansible/roles/ceph-grafana/meta/main.yml
new file mode 100644 (file)
index 0000000..56dd016
--- /dev/null
@@ -0,0 +1,3 @@
+---
+dependencies:
+  - role: cephmetrics-common
deleted file mode 100644 (file)
index 649ebf19e073319ce12cfd73e69f3e8d7f1c66eb..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- name: Combine default settings and user-defined variables
-  set_fact: {"{{ item }}": "{% if vars[item] is not defined %}{{ defaults[item] }}{% endif %}{% if vars[item] is mapping %}{{ defaults[item]|combine(vars[item]|default({})) }}{% endif %}"}
-  with_items: "{{ defaults.keys() }}"
-  no_log: true
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..5057c168a95105c16a7571ef39beff27bf4d3eda
--- /dev/null
@@ -0,0 +1 @@
+../../cephmetrics-common/tasks/merge_vars.yml
\ No newline at end of file
diff --git a/ansible/roles/cephmetrics-common/defaults/main.yml b/ansible/roles/cephmetrics-common/defaults/main.yml
new file mode 100644 (file)
index 0000000..c4f7fa6
--- /dev/null
@@ -0,0 +1,65 @@
+---
+defaults:
+  containerized_deployment: false
+  use_epel: false
+  devel_mode: true
+  graphite:
+    service: graphite-web
+    web_port: "{{ graphite_port | default('8080') }}"
+    api_port: 8888
+    user: admin
+    password: admin
+    # The unix account running the graphite-web process
+    unix_user:
+      yum: apache
+      apt: _graphite
+    build_index:
+      yum: '/usr/bin/graphite-build-index'
+      apt: '/usr/bin/graphite-build-search-index'
+    apache_name:
+      yum: 'httpd'
+      apt: 'apache2'
+    apache_conf:
+      yum: '/etc/httpd/conf/httpd.conf'
+      apt: '/etc/apache2/apache2.conf'
+    site_conf:
+      yum: '/etc/httpd/conf.d/graphite-web.conf'
+      apt: '/etc/apache2/sites-available/graphite-web.conf'
+  carbon:
+    unix_user:
+      yum: carbon
+      apt: _graphite
+    storage_dir:
+      yum: /var/lib/carbon
+      apt: /var/lib/graphite
+  whisper:
+    retention:
+      - ['10s', '7d']
+      - ['1m', '30d']
+      - ['15m', '5y']
+  # The firewalld zone that carbon and grafana will use
+  firewalld_zone: public
+  # RHEL repos that need to be enabled with subscription-manager
+  rhsm_repos:
+    - rhel-7-server-rhscon-2-installer-rpms
+    - rhel-7-server-optional-rpms
+  devel_packages:
+    yum:
+      # unzip is needed to extract the Vonage plugin
+      - unzip
+      - graphite-web
+      - python-carbon
+      - grafana
+      # PyYAML is required by dashUpdater.py
+      - PyYAML
+    apt:
+      # unzip is needed to extract the Vonage plugin
+      - unzip
+      - graphite-web
+      - apache2
+      - libapache2-mod-wsgi
+      - graphite-carbon
+      - grafana
+      # for dashUpdater.py
+      - python-yaml
+      - python-requests
diff --git a/ansible/roles/cephmetrics-common/tasks/main.yml b/ansible/roles/cephmetrics-common/tasks/main.yml
new file mode 100644 (file)
index 0000000..b59b6de
--- /dev/null
@@ -0,0 +1,4 @@
+---
+- include: merge_vars.yml
+  tags:
+    - always
diff --git a/ansible/roles/cephmetrics-common/tasks/merge_vars.yml b/ansible/roles/cephmetrics-common/tasks/merge_vars.yml
new file mode 100644 (file)
index 0000000..649ebf1
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- name: Combine default settings and user-defined variables
+  set_fact: {"{{ item }}": "{% if vars[item] is not defined %}{{ defaults[item] }}{% endif %}{% if vars[item] is mapping %}{{ defaults[item]|combine(vars[item]|default({})) }}{% endif %}"}
+  with_items: "{{ defaults.keys() }}"
+  no_log: true