Manage minion.d using support metadata
Change-Id: I60427ae6e7c82ed60ccce3c07a0abbf31656c130
diff --git a/jenkins/client/_job.sls b/jenkins/client/_job.sls
index 003a11a..1a8e6df 100644
--- a/jenkins/client/_job.sls
+++ b/jenkins/client/_job.sls
@@ -20,7 +20,6 @@
- config: {{ client.dir.jenkins_jobs_root }}/{{ job_name }}.xml
- watch:
- file: jenkins_job_{{ job_name }}_definition
- - file: /etc/salt/minion.d/_jenkins.conf
{%- else %}
@@ -33,7 +32,5 @@
jenkins_job_{{ job_name }}_absent:
jenkins_job.absent:
- name: {{ job_name }}
- - watch:
- - file: /etc/salt/minion.d/_jenkins.conf
{%- endif %}
diff --git a/jenkins/client/init.sls b/jenkins/client/init.sls
index 553fe6b..2477f4e 100644
--- a/jenkins/client/init.sls
+++ b/jenkins/client/init.sls
@@ -50,11 +50,6 @@
pkg.installed:
- names: {{ client.pkgs }}
-/etc/salt/minion.d/_jenkins.conf:
- file.managed:
- - source: salt://jenkins/files/_jenkins.conf
- - template: jinja
-
jenkins_client_dirs:
file.directory:
- names:
diff --git a/jenkins/files/_jenkins.conf b/jenkins/files/_jenkins.conf
deleted file mode 100644
index 0079d74..0000000
--- a/jenkins/files/_jenkins.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-{%- from "jenkins/map.jinja" import client with context %}
-jenkins:
- url: "{{ client.master.get('proto', 'http') }}://{{ client.master.host }}:{{ client.master.port }}"
- {%- if client.master.api_key is defined %}
- api_key: {{ client.master.api_key }}
- {%- else %}
- user: {{ client.master.get('username', 'admin') }}
- password: {{ client.master.get('password', 'dummy') }}
- {%- endif %}
diff --git a/jenkins/meta/salt.yml b/jenkins/meta/salt.yml
new file mode 100644
index 0000000..bd821ec
--- /dev/null
+++ b/jenkins/meta/salt.yml
@@ -0,0 +1,13 @@
+minion:
+ {%- if pillar.jenkins.client is defined %}
+ jenkins:
+ {%- from "jenkins/map.jinja" import client with context %}
+ jenkins:
+ url: "{{ client.master.get('proto', 'http') }}://{{ client.master.host }}:{{ client.master.port }}"
+ {%- if client.master.api_key is defined %}
+ api_key: {{ client.master.api_key }}
+ {%- else %}
+ user: {{ client.master.get('username', 'admin') }}
+ password: {{ client.master.get('password', 'dummy') }}
+ {%- endif %}
+ {%- endif %}