Merge "Add config directory for yaml files"

This commit is contained in:
Jenkins 2015-12-22 20:48:44 +00:00 committed by Gerrit Code Review
commit 9d3eedcb66
4 changed files with 45 additions and 0 deletions

View File

@ -26,6 +26,12 @@ jenkins_job_builder_config_jenkins_password: ""
jenkins_job_builder_config_jenkins_url: http://localhost:8008
jenkins_job_builder_config_jenkins_query_plugins_info: False
jenkins_job_builder_file_jobs_dest: /etc/jenkins_jobs/config
jenkins_job_builder_file_jobs_group: "{{ ansible_ssh_user }}"
jenkins_job_builder_file_jobs_mode: "0755"
jenkins_job_builder_file_jobs_owner: "{{ ansible_ssh_user }}"
jenkins_job_builder_file_jobs_src: etc/jenkins_jobs/config/
jenkins_job_builder_template_jenkins_jobs_ini_dest: /etc/jenkins_jobs/jenkins_jobs.ini
jenkins_job_builder_template_jenkins_jobs_ini_group: "{{ jenkins_job_builder_user_group }}"
jenkins_job_builder_template_jenkins_jobs_ini_mode: "0440"

View File

@ -0,0 +1,3 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#

19
handlers/main.yaml Normal file
View File

@ -0,0 +1,19 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Reload jenkins-jobs
ignore_errors: yes
shell: "jenkins-jobs --conf {{ jenkins_job_builder_template_jenkins_jobs_ini_dest }} update {{ jenkins_job_builder_file_jobs_dest }} --delete-old"
sudo: yes
sudo_user: "{{ jenkins_job_builder_user_name }}"

View File

@ -28,3 +28,20 @@
mode: "{{ jenkins_job_builder_template_jenkins_jobs_ini_mode }}"
owner: "{{ jenkins_job_builder_template_jenkins_jobs_ini_owner }}"
src: "{{ jenkins_job_builder_template_jenkins_jobs_ini_src }}"
- name: Create jobs directory.
file:
dest: "{{ jenkins_job_builder_file_jobs_dest }}"
group: "{{ jenkins_job_builder_file_jobs_group }}"
mode: "{{ jenkins_job_builder_file_jobs_mode }}"
owner: "{{ jenkins_job_builder_file_jobs_owner }}"
state: directory
- name: Rsyc jenkins jobs configuration.
sudo: no
synchronize:
delete: yes
dest: "{{ jenkins_job_builder_file_jobs_dest }}"
perms: yes
src: "{{ jenkins_job_builder_file_jobs_src }}"
notify: Reload jenkins-jobs