Skip to content

Commit 258e5d9

Browse files
authored
Merge pull request #35 from karlmdavis/issue-34-rework-proxy-support
Reworked support for HTTP proxies.
2 parents 749372f + 0b90a10 commit 258e5d9

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

defaults/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ jenkins_plugins_extra: []
7474
# Additional options that will be added to JAVA_ARGS
7575
jenkins_java_args_extra: ''
7676

77-
# This should only be modified if operating in a restricted Internet
78-
# environment, such that not all of the Jenkins mirrors will be accessible.
79-
jenkins_downloads_url_root: 'https://pkg.jenkins.io'
77+
##
78+
# These should only be modified if custom/local mirrors of the YUM, APT, and/or
79+
# plugins repositories are being used.
80+
##
81+
82+
# The base URL of the custom YUM/APT repo to be used (the portion that's shared
83+
# by the signing key and packages).
84+
jenkins_packages_url_base: 'https://pkg.jenkins.io'
85+
86+
# Set to `true` to add a `proxy: _none_` setting for the YUM repo.
87+
jenkins_packages_repo_yum_disable_proxy: false
88+

tasks/packages_Debian.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
# Allows use of HTTPS APT repos.
1313
- apt-transport-https
1414

15-
- name: Determine APT URL to Use
15+
- name: Determine APT Key and Repo to Use (Step 1)
1616
set_fact:
17-
jenkins_downloads_url_directory: "{{ 'debian' if jenkins_release_line == 'weekly' else 'debian-stable' }}"
17+
jenkins_apt_repo_flavor: "{{ 'debian' if jenkins_release_line == 'weekly' else 'debian-stable' }}"
1818

19-
- name: Determine APT Key and Repo to Use
19+
- name: Determine APT Key and Repo to Use (Step 2)
2020
set_fact:
21-
jenkins_apt_key: "{{ '%s/%s/jenkins.io.key' % (jenkins_downloads_url_root, jenkins_downloads_url_directory) }}"
22-
jenkins_apt_repo: "{{ 'deb %s/%s binary/' % (jenkins_downloads_url_root, jenkins_downloads_url_directory) }}"
21+
jenkins_apt_key_url: "{{ '%s/%s/jenkins.io.key' % (jenkins_packages_url_base, jenkins_apt_repo_flavor) }}"
22+
jenkins_apt_repo: "{{ 'deb %s/%s binary/' % (jenkins_packages_url_base, jenkins_apt_repo_flavor) }}"
2323

2424
- name: Add Jenkins APT Key
2525
apt_key:
26-
url: "{{ jenkins_apt_key }}"
26+
url: "{{ jenkins_apt_key_url }}"
2727
state: present
2828
become: true
2929

tasks/packages_RedHat.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
- name: Determine YUM URL to Use
2+
- name: Determine YUM Repo to Use (Step 1)
33
set_fact:
4-
jenkins_downloads_url_directory: "{{ 'redhat' if jenkins_release_line == 'weekly' else 'redhat-stable' }}"
4+
jenkins_yum_repo_flavor: "{{ 'redhat' if jenkins_release_line == 'weekly' else 'redhat-stable' }}"
55

6-
- name: Determine YUM Repo to Use
6+
- name: Determine YUM Repo to Use (Step 2)
77
set_fact:
8+
jenkins_yum_gpgkey_url: "{{ '%s/%s/jenkins.io.key' % (jenkins_packages_url_base, jenkins_yum_repo_flavor) }}"
9+
jenkins_yum_repo_baseurl: "{{ '%s/%s' % (jenkins_packages_url_base, jenkins_yum_repo_flavor) }}"
810
jenkins_yum_repo_name: "{{ 'Jenkins' if jenkins_release_line == 'weekly' else 'Jenkins-stable' }}"
9-
jenkins_yum_repo_baseurl: "{{ '%s/%s' % (jenkins_downloads_url_root, jenkins_downloads_url_directory) }}"
10-
jenkins_yum_repo_gpgkey: "{{ '%s/%s/jenkins.io.key' % (jenkins_downloads_url_root, jenkins_downloads_url_directory) }}"
1111

1212
- name: Remove Unused Jenkins YUM Repositories
1313
yum_repository:
@@ -25,7 +25,8 @@
2525
description: 'Jenkins release repo from https://jenkins.io/download/.'
2626
baseurl: "{{ jenkins_yum_repo_baseurl }}"
2727
gpgcheck: true
28-
gpgkey: "{{ jenkins_yum_repo_gpgkey }}"
28+
gpgkey: "{{ jenkins_yum_gpgkey_url }}"
29+
proxy: "{{ '_none_' if jenkins_packages_repo_yum_disable_proxy == true else omit }}"
2930
state: present
3031
become: true
3132

0 commit comments

Comments
 (0)