On FreeBSD the sudo command cleans the new environment too much
and Jenkins is not able to run properly.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
guests/group_vars/all/main.yml | 2 +-
guests/host_vars/libvirt-freebsd-10/main.yml | 2 +-
guests/host_vars/libvirt-freebsd-11/main.yml | 2 +-
guests/tasks/jenkins.yml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/guests/group_vars/all/main.yml b/guests/group_vars/all/main.yml
index d24af59..9bf5d05 100644
--- a/guests/group_vars/all/main.yml
+++ b/guests/group_vars/all/main.yml
@@ -12,4 +12,4 @@ jenkins_url:
https://ci.centos.org/computer/{{ inventory_hostname
}}/slave-agent
bash: /bin/bash
java: /usr/bin/java
make: /usr/bin/make
-sudo: /usr/bin/sudo
+su: /bin/su
diff --git a/guests/host_vars/libvirt-freebsd-10/main.yml
b/guests/host_vars/libvirt-freebsd-10/main.yml
index 1547802..2931fe3 100644
--- a/guests/host_vars/libvirt-freebsd-10/main.yml
+++ b/guests/host_vars/libvirt-freebsd-10/main.yml
@@ -4,7 +4,7 @@ ansible_python_interpreter: /usr/local/bin/python2
bash: /usr/local/bin/bash
java: /usr/local/bin/java
make: /usr/local/bin/gmake
-sudo: /usr/local/bin/sudo
+su: /usr/bin/su
projects:
- base
diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml
b/guests/host_vars/libvirt-freebsd-11/main.yml
index 1547802..2931fe3 100644
--- a/guests/host_vars/libvirt-freebsd-11/main.yml
+++ b/guests/host_vars/libvirt-freebsd-11/main.yml
@@ -4,7 +4,7 @@ ansible_python_interpreter: /usr/local/bin/python2
bash: /usr/local/bin/bash
java: /usr/local/bin/java
make: /usr/local/bin/gmake
-sudo: /usr/local/bin/sudo
+su: /usr/bin/su
projects:
- base
diff --git a/guests/tasks/jenkins.yml b/guests/tasks/jenkins.yml
index a1b8f46..87ebafa 100644
--- a/guests/tasks/jenkins.yml
+++ b/guests/tasks/jenkins.yml
@@ -19,7 +19,7 @@
create: yes
backup: yes
regexp: '^nohup.*jenkins.*java.*slave\.jar.*&$'
- line: "nohup {{ sudo }} -u jenkins {{ bash }} -l -c '{{ java }} -jar
/home/jenkins/slave.jar -jnlpUrl \"{{ jenkins_url }}\" -secret \"{{
jenkins_secret }}\"' >/var/log/jenkins.log 2>&1 &"
+ line: "nohup {{ su }} - jenkins -c '{{ java }} -jar /home/jenkins/slave.jar
-jnlpUrl \"{{ jenkins_url }}\" -secret \"{{ jenkins_secret }}\"'
>/var/log/jenkins.log 2>&1 &"
insertbefore: '^exit .*$'
when:
- ansible_service_mgr != 'systemd'
--
2.13.6