diff --git a/README.rst b/README.rst index 88e9eff..ced2871 100644 --- a/README.rst +++ b/README.rst @@ -87,11 +87,6 @@ Simple master with reverse proxy regex: "contrail-build-.*" - name: "Aptly" regex: "aptly-.*" - plugins: - - name: slack - - name: extended-choice-parameter - - name: rebuild - - name: test-stability Jenkins master with experimental plugin source support @@ -102,6 +97,20 @@ Jenkins master with experimental plugin source support enabled: true update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json' +Jenkins master with plugins proxy support + +.. code-block:: yaml + + jenkins: + master: + enabled: true + proxy: + host: proxy-host + port: 3128 + no_proxy: + - localhost + - 127.0.0.1 + SMTP server settings .. code-block:: yaml diff --git a/jenkins/files/proxy.xml b/jenkins/files/proxy.xml new file mode 100644 index 0000000..262e9bb --- /dev/null +++ b/jenkins/files/proxy.xml @@ -0,0 +1,9 @@ +{%- from "jenkins/map.jinja" import master with context %} + + + {{ master.proxy.host }} + {{ master.proxy.port }} + {%- if master.proxy.no_host is defined %} + {{ "\n".join(master.proxy.no_host) }} + {%- endif %} + diff --git a/jenkins/master/service.sls b/jenkins/master/service.sls index c3e717b..82bd566 100644 --- a/jenkins/master/service.sls +++ b/jenkins/master/service.sls @@ -17,8 +17,11 @@ jenkins_{{ master.config }}: - template: jinja - require: - pkg: jenkins_packages + - watch_in: + - service: jenkins_master_service {%- if master.get('no_config', False) == False %} + {{ master.home }}/config.xml: file.managed: - source: salt://jenkins/files/config.xml @@ -26,6 +29,7 @@ jenkins_{{ master.config }}: - user: jenkins - watch_in: - service: jenkins_master_service + {%- endif %} {%- if master.update_site_url is defined %} @@ -37,6 +41,8 @@ jenkins_{{ master.config }}: - user: jenkins - require: - pkg: jenkins_packages + - watch_in: + - service: jenkins_master_service {%- endif %} @@ -49,6 +55,22 @@ jenkins_{{ master.config }}: - user: jenkins - require: - pkg: jenkins_packages + - watch_in: + - service: jenkins_master_service + +{%- endif %} + +{%- if master.proxy is defined %} + +{{ master.home }}/proxy.xml: + file.managed: + - source: salt://jenkins/files/proxy.xml + - template: jinja + - user: jenkins + - require: + - pkg: jenkins_packages + - watch_in: + - service: jenkins_master_service {%- endif %} @@ -61,6 +83,8 @@ jenkins_{{ master.config }}: - user: jenkins - require: - pkg: jenkins_packages + - watch_in: + - service: jenkins_master_service {%- endif %} @@ -81,9 +105,6 @@ jenkins_{{ master.config }}: jenkins_master_service: service.running: - name: {{ master.service }} - - watch: - - file: jenkins_{{ master.config }} - - file: {{ master.home }}/hudson.model.UpdateCenter.xml jenkins_service_running: cmd.wait: