Page MenuHomeDevCentral

D1724.id4385.diff
No OneTemporary

D1724.id4385.diff

diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -91,6 +91,7 @@
jenkins_cd:
host: cd.nasqueron.org
app_port: 38080
+ jnlp_port: 50000
jenkins_slave:
# Slaves for CD
diff --git a/roles/paas-docker/containers/jenkins.sls b/roles/paas-docker/containers/jenkins.sls
--- a/roles/paas-docker/containers/jenkins.sls
+++ b/roles/paas-docker/containers/jenkins.sls
@@ -7,12 +7,15 @@
# -------------------------------------------------------------
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
+{% set containers = pillar['docker_containers'][grains['id']] %}
+
+{% for instance, container in containers['jenkins'].items() %}
# -------------------------------------------------------------
# Home directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-/srv/jenkins/jenkins_home:
+/srv/{{ instance }}/jenkins_home:
file.directory:
- user: 1000
- group: 1000
@@ -21,27 +24,29 @@
{% if has_selinux %}
selinux_context_jenkins_home:
selinux.fcontext_policy_present:
- - name: /srv/jenkins/jenkins_home
+ - name: /srv/{{ instance }}/jenkins_home
- sel_type: svirt_sandbox_file_t
selinux_context_jenkins_home_applied:
selinux.fcontext_policy_applied:
- - name: /srv/jenkins/jenkins_home
+ - name: /srv/{{ instance }}/jenkins_home
{% endif %}
# -------------------------------------------------------------
# Container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-jenkins:
+{{ instance }}:
docker_container.running:
- detach: True
- interactive: True
- image: jenkinsci/jenkins
- - binds: /srv/jenkins/jenkins_home:/var/jenkins_home
+ - binds: /srv/{{ instance }}/jenkins_home:/var/jenkins_home
- ports:
- 8080
- 50000
- port_bindings:
- - 38080:8080 # HTTP
- - 50000:50000 # Jenkins master's port for JNLP-based Jenkins agents
+ - {{ container['app_port'] }}:8080 # HTTP
+ - {{ container['jnlp_port'] }}:50000 # Jenkins master's port for JNLP-based Jenkins agents
+
+{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 16:36 (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262688
Default Alt Text
D1724.id4385.diff (2 KB)

Event Timeline