Skip to content

Commit

Permalink
Introduced jenkins_facts_script_timeout and jenkins_facts_uri_timeout…
Browse files Browse the repository at this point in the history
… to avoid timeouts on slow instances
  • Loading branch information
Tobias Richter committed Apr 11, 2019
1 parent 69e3838 commit 65ee919
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ Url prefix of the jenkins instance, e.g. when running in tomcat.

The base url of the jenkins instance.

jenkins_facts_script_timeout: 30

The timeout for gathering facts via jenkins_script.

jenkins_facts_uri_timeout: 30

The timeout for uri commands.

## Dependencies

This role has no hard dependencies but interacts heavily with the
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ jenkins_facts_jenkins_url_prefix: ""

# The base url of the jenkins instance
jenkins_facts_jenkins_base_url: "http://{{ jenkins_facts_jenkins_hostname }}:{{ jenkins_facts_jenkins_port }}{{ jenkins_facts_jenkins_url_prefix }}"

# The timeout for gathering facts via jenkins_script
jenkins_facts_script_timeout: 30

# The timeout for uri commands
jenkins_facts_uri_timeout: 30
5 changes: 4 additions & 1 deletion tasks/gather_jenkins_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
user: "{{ jenkins_facts_admin_username }}"
password: "{{ jenkins_facts_admin_password }}"
url: "{{ jenkins_facts_jenkins_base_url }}"
timeout: "{{ jenkins_facts_script_timeout }}"
register: _jenkins_facts_gather_script_result

- name: "gather_jenkins_facts : convert gathered facts to json."
Expand All @@ -27,7 +28,9 @@
force_basic_auth: true
user: "{{ jenkins_facts_admin_username }}"
password: "{{ jenkins_facts_admin_password }}"
timeout: "{{ jenkins_facts_uri_timeout }}"
return_content: yes

register: _jenkins_facts_csrf_crumb_result

- name: "gather_jenkins_facts : set jenkins csrf crumb."
Expand All @@ -54,4 +57,4 @@
- "{{ jenkins_facts_plugins_failed }}"
- jenkins_facts_csrf_crumb
- "{{ jenkins_facts_csrf_crumb }}"
verbosity: 1
verbosity: 1

0 comments on commit 65ee919

Please sign in to comment.