diff --git a/defaults/main.yaml b/defaults/main.yaml index 2cab401..13349b4 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -30,7 +30,7 @@ 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_file_jobs_src: "" 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 }}" diff --git a/files/etc/jenkins_jobs/config/README.rst b/files/etc/jenkins_jobs/config/README.rst deleted file mode 100644 index 602ac8e..0000000 --- a/files/etc/jenkins_jobs/config/README.rst +++ /dev/null @@ -1,3 +0,0 @@ -# This file is generated by Ansible -# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN -# diff --git a/handlers/main.yaml b/handlers/main.yaml index e938a14..457cf85 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -13,7 +13,6 @@ # 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 }}" diff --git a/tasks/config.yaml b/tasks/config.yaml index 436bf3c..691f101 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -37,11 +37,12 @@ owner: "{{ jenkins_job_builder_file_jobs_owner }}" state: directory -- name: Rsyc jenkins jobs configuration. +- name: Rsync jenkins jobs configuration. sudo: no synchronize: delete: yes dest: "{{ jenkins_job_builder_file_jobs_dest }}" perms: yes src: "{{ jenkins_job_builder_file_jobs_src }}" + when: jenkins_job_builder_file_jobs_src != "" notify: Reload jenkins-jobs