Skip to content

Commit

Permalink
Fix Jenkins CLI usage with Jenkins 2.54
Browse files Browse the repository at this point in the history
  • Loading branch information
solita-timo-mihaljov committed Apr 12, 2017
1 parent ded8342 commit 57304b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions tasks/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@
- name: Run the Job DSL scripts
shell: >
{{ solita_jenkins_cli }} build job-dsl -s -v
no_log: yes
when: ((scripts | length > 0) or (templates | length > 0)) and ((copy_scripts | changed) or (copy_templates | changed) or (remove_old_scripts | changed))
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- name: Create the job-dsl job
shell: >
{{ solita_jenkins_cli }} create-job job-dsl </var/lib/jenkins/job-dsl-config.xml
no_log: yes
args:
creates: /var/lib/jenkins/jobs/job-dsl/config.xml
register: create_job_dsl_job
Expand All @@ -35,6 +36,7 @@
- name: Reload the job-dsl job
command: >
{{ solita_jenkins_cli }} reload-job job-dsl
no_log: yes
when: update_job_dsl_job | changed

- include: credentials.yml
Expand Down
1 change: 1 addition & 0 deletions tasks/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
command: >
{{ solita_jenkins_cli }} install-plugin {{ item }}
creates=/var/lib/jenkins/plugins/{{ item }}.jpi
no_log: yes
with_items: "{{ solita_jenkins_plugins_required + solita_jenkins_plugins }}"
register: plugins

Expand Down
3 changes: 3 additions & 0 deletions tasks/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@
group: jenkins
mode: 0600
force: no
tags: always

- name: Read solita_jenkins password file
become: yes
command: cat /var/lib/jenkins/solita_jenkins_password
register: cat_password
changed_when: False
tags: always

- set_fact:
solita_jenkins_password: "{{ cat_password.stdout }}"
tags: always

- name: Create Jenkins security realm configuration script
become: yes
Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ solita_jenkins_plugins_required:
- ssh-credentials
solita_jenkins_job_dsl_workspace: /var/lib/jenkins/jobs/job-dsl/workspace
solita_jenkins_url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ jenkins_url_prefix | default('') }}"
solita_jenkins_cli: "sudo -u jenkins java -jar '{{ jenkins_jar_location }}' -s '{{ solita_jenkins_url }}'"
solita_jenkins_cli: "sudo -u jenkins java -jar '{{ jenkins_jar_location }}' -s '{{ solita_jenkins_url }}' -auth 'solita_jenkins:{{ solita_jenkins_password }}'"
solita_jenkins_password_dir: "{{ inventory_dir | default('.') }}/solita_jenkins_default_password"

0 comments on commit 57304b1

Please sign in to comment.