summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-22 20:48:44 +0000
committerGerrit Code Review <review@openstack.org>2015-12-22 20:48:44 +0000
commit9d3eedcb66fb2a23d8aa753a82f02bee83711626 (patch)
treee94ca6c7c1a9d6b772da6f50a0b4bf084c523b58
parent1751fd047f5eeb5af283976c37d770907147c65b (diff)
parent2247880f24a986e0a7518c6925ebda932ee181ac (diff)
Merge "Add config directory for yaml files"
-rw-r--r--defaults/main.yaml6
-rw-r--r--files/etc/jenkins_jobs/config/README.rst3
-rw-r--r--handlers/main.yaml19
-rw-r--r--tasks/config.yaml17
4 files changed, 45 insertions, 0 deletions
diff --git a/defaults/main.yaml b/defaults/main.yaml
index b2bd074..2cab401 100644
--- a/defaults/main.yaml
+++ b/defaults/main.yaml
@@ -26,6 +26,12 @@ jenkins_job_builder_config_jenkins_password: ""
26jenkins_job_builder_config_jenkins_url: http://localhost:8008 26jenkins_job_builder_config_jenkins_url: http://localhost:8008
27jenkins_job_builder_config_jenkins_query_plugins_info: False 27jenkins_job_builder_config_jenkins_query_plugins_info: False
28 28
29jenkins_job_builder_file_jobs_dest: /etc/jenkins_jobs/config
30jenkins_job_builder_file_jobs_group: "{{ ansible_ssh_user }}"
31jenkins_job_builder_file_jobs_mode: "0755"
32jenkins_job_builder_file_jobs_owner: "{{ ansible_ssh_user }}"
33jenkins_job_builder_file_jobs_src: etc/jenkins_jobs/config/
34
29jenkins_job_builder_template_jenkins_jobs_ini_dest: /etc/jenkins_jobs/jenkins_jobs.ini 35jenkins_job_builder_template_jenkins_jobs_ini_dest: /etc/jenkins_jobs/jenkins_jobs.ini
30jenkins_job_builder_template_jenkins_jobs_ini_group: "{{ jenkins_job_builder_user_group }}" 36jenkins_job_builder_template_jenkins_jobs_ini_group: "{{ jenkins_job_builder_user_group }}"
31jenkins_job_builder_template_jenkins_jobs_ini_mode: "0440" 37jenkins_job_builder_template_jenkins_jobs_ini_mode: "0440"
diff --git a/files/etc/jenkins_jobs/config/README.rst b/files/etc/jenkins_jobs/config/README.rst
new file mode 100644
index 0000000..602ac8e
--- /dev/null
+++ b/files/etc/jenkins_jobs/config/README.rst
@@ -0,0 +1,3 @@
1# This file is generated by Ansible
2# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
3#
diff --git a/handlers/main.yaml b/handlers/main.yaml
new file mode 100644
index 0000000..e938a14
--- /dev/null
+++ b/handlers/main.yaml
@@ -0,0 +1,19 @@
1# Copyright 2015 Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14---
15- name: Reload jenkins-jobs
16 ignore_errors: yes
17 shell: "jenkins-jobs --conf {{ jenkins_job_builder_template_jenkins_jobs_ini_dest }} update {{ jenkins_job_builder_file_jobs_dest }} --delete-old"
18 sudo: yes
19 sudo_user: "{{ jenkins_job_builder_user_name }}"
diff --git a/tasks/config.yaml b/tasks/config.yaml
index ae519d4..436bf3c 100644
--- a/tasks/config.yaml
+++ b/tasks/config.yaml
@@ -28,3 +28,20 @@
28 mode: "{{ jenkins_job_builder_template_jenkins_jobs_ini_mode }}" 28 mode: "{{ jenkins_job_builder_template_jenkins_jobs_ini_mode }}"
29 owner: "{{ jenkins_job_builder_template_jenkins_jobs_ini_owner }}" 29 owner: "{{ jenkins_job_builder_template_jenkins_jobs_ini_owner }}"
30 src: "{{ jenkins_job_builder_template_jenkins_jobs_ini_src }}" 30 src: "{{ jenkins_job_builder_template_jenkins_jobs_ini_src }}"
31
32- name: Create jobs directory.
33 file:
34 dest: "{{ jenkins_job_builder_file_jobs_dest }}"
35 group: "{{ jenkins_job_builder_file_jobs_group }}"
36 mode: "{{ jenkins_job_builder_file_jobs_mode }}"
37 owner: "{{ jenkins_job_builder_file_jobs_owner }}"
38 state: directory
39
40- name: Rsyc jenkins jobs configuration.
41 sudo: no
42 synchronize:
43 delete: yes
44 dest: "{{ jenkins_job_builder_file_jobs_dest }}"
45 perms: yes
46 src: "{{ jenkins_job_builder_file_jobs_src }}"
47 notify: Reload jenkins-jobs