Skip to content

Commit

Permalink
added retries
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bowen committed Mar 7, 2020
1 parent 0a49105 commit 2c26c8f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,31 @@
apt_key:
url: "{{ jenkins_repo_key_url }}"
state: present
register: get_result
until: get_result is success
retries: 3
delay: 2

- name: Add Jenkins apt repository.
apt_repository:
repo: "{{ jenkins_repo_url }}"
state: present
update_cache: true
when: jenkins_repo_url | default(false)
register: get_result
until: get_result is success
retries: 3
delay: 2
tags: ['skip_ansible_lint']

- name: Download specific Jenkins version.
get_url:
url: "{{ jenkins_pkg_url }}/jenkins_{{ jenkins_version }}_all.deb"
dest: "/tmp/jenkins_{{ jenkins_version }}_all.deb"
register: get_result
until: get_result is success
retries: 3
delay: 2
when: jenkins_version is defined

- name: Check if we downloaded a specific version of Jenkins.
Expand Down
13 changes: 13 additions & 0 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@
url: "{{ jenkins_repo_url }}"
dest: /etc/yum.repos.d/jenkins.repo
when: jenkins_repo_url | default(false)
register: get_result
until: get_result is success
retries: 3
delay: 2
tags: ['skip_ansible_lint']

- name: Add Jenkins repo GPG key.
rpm_key:
state: present
key: "{{ jenkins_repo_key_url }}"
when: jenkins_repo_url | default(false)
register: get_result
until: get_result is success
retries: 3
delay: 2

- name: Download specific Jenkins version.
get_url:
url: "{{ jenkins_pkg_url }}/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
dest: "/tmp/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
when: jenkins_version is defined
register: get_result
until: get_result is success
retries: 3
delay: 2

- name: Check if we downloaded a specific version of Jenkins.
stat:
Expand Down

0 comments on commit 2c26c8f

Please sign in to comment.