2017-05-23 15:14:14 +02:00
|
|
|
---
|
|
|
|
- name: Add jenkins GPG key
|
|
|
|
apt_key:
|
2017-07-12 12:10:14 +02:00
|
|
|
# url: https://jenkins-ci.org/debian/jenkins-ci.org.key
|
|
|
|
data: "{{ lookup('file', 'jenkins.key') }}"
|
2017-05-23 15:14:14 +02:00
|
|
|
|
2017-07-12 12:17:33 +02:00
|
|
|
- name: Find squid config whitelist
|
|
|
|
shell: find /etc/squid/whitelist-custom.conf /etc/squid3/whitelist-custom.conf /etc/squid/whitelist.conf /etc/squid3/whitelist.conf 2> /dev/null
|
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2017-05-23 15:14:14 +02:00
|
|
|
check_mode: no
|
2017-07-12 12:17:33 +02:00
|
|
|
register: squid_whitelist_files
|
2017-05-23 15:14:14 +02:00
|
|
|
|
2017-07-12 12:17:33 +02:00
|
|
|
- name: set squid_service_name=squid3 for Debian < 9
|
|
|
|
set_fact:
|
|
|
|
squid_service_name: squid3
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "Debian"
|
|
|
|
- ansible_distribution_major_version | version_compare('9', '<')
|
|
|
|
|
|
|
|
- name: Append packages.dotdeb.org to Squid whitelist
|
2017-05-23 15:14:14 +02:00
|
|
|
lineinfile:
|
2017-07-12 12:17:33 +02:00
|
|
|
dest: "{{ squid_whitelist_files.stdout_lines | first }}"
|
2017-05-23 15:14:14 +02:00
|
|
|
line: "{{ item }}"
|
2017-07-12 12:17:33 +02:00
|
|
|
state: present
|
2017-05-23 15:14:14 +02:00
|
|
|
with_items:
|
|
|
|
- "http://pkg.jenkins-ci.org/.*"
|
|
|
|
- "http://mirrors.jenkins.io/.*"
|
|
|
|
- "http://jenkins.mirror.isppower.de/.*"
|
|
|
|
- "http://ftp.icm.edu.pl/.*"
|
2017-07-12 12:17:33 +02:00
|
|
|
notify: "reload {{ squid_service_name | default('squid') }}"
|
|
|
|
when: squid_whitelist_files.stdout != ""
|
2017-05-23 15:14:14 +02:00
|
|
|
|
|
|
|
- meta: flush_handlers
|
|
|
|
|
|
|
|
- name: Add jenkins APT repository
|
|
|
|
apt_repository:
|
|
|
|
repo: deb http://pkg.jenkins-ci.org/debian-stable binary/
|
|
|
|
filename: jenkins.list
|
|
|
|
update_cache: yes
|
|
|
|
|
|
|
|
- name: Install Jenkins
|
|
|
|
apt:
|
|
|
|
name: jenkins
|
|
|
|
|
|
|
|
- name: Change Jenkins port
|
|
|
|
replace:
|
|
|
|
name: /etc/default/jenkins
|
|
|
|
regexp: "^HTTP_PORT=.*$"
|
|
|
|
replace: "HTTP_PORT=8081"
|
|
|
|
notify: Restart Jenkins
|