Browse Source

Fix functional testing for Ubuntu

Change-Id: Ic02a84f7f44f0589ac7b53bd1aa73fc1400c27f0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/58/278158/5
Paul Belanger 4 years ago
parent
commit
e7869b9e49
5 changed files with 33 additions and 19 deletions
  1. +2
    -1
      tasks/config.yaml
  2. +10
    -2
      tasks/install.yaml
  3. +1
    -0
      tests/files/jenkins/etc/apt/sources.list.d/jenkins.list
  4. +18
    -6
      tests/test.yaml
  5. +2
    -10
      vars/Debian.yaml

+ 2
- 1
tasks/config.yaml View File

@@ -21,8 +21,9 @@
with_items:
- "{{ jenkins_user_home }}/plugins"

- name: Template clouds yaml file.
- name: Template jenkins service config.
template:
dest: "{{ jenkins_template_config_dest }}"
src: "{{ jenkins_template_config_src }}"
when: ansible_os_family == 'RedHat'
notify: Restart jenkins

+ 10
- 2
tasks/install.yaml View File

@@ -17,5 +17,13 @@
jenkins_build_depends: "{{ __jenkins_build_depends | list }}"
when: jenkins_build_depends is not defined

- include: install/redhat.yaml
when: ansible_os_family == 'RedHat'
- name: Ensure build dependencies are installed.
package:
name: "{{ item }}"
state: installed
with_items: jenkins_build_depends

- name: Ensure jenkins is installed.
package:
name: jenkins
state: installed

+ 1
- 0
tests/files/jenkins/etc/apt/sources.list.d/jenkins.list View File

@@ -0,0 +1 @@
deb http://pkg.jenkins-ci.org/debian binary/

+ 18
- 6
tests/test.yaml View File

@@ -18,12 +18,6 @@
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"

pre_tasks:
# Make sure OS does not have a stale package cache.
- name: Update apt cache.
apt:
update_cache: yes
when: ansible_os_family == 'Debian'

- name: Configure yum for Jenkins repository.
become: yes
copy:
@@ -31,6 +25,13 @@
dest: /etc/yum.repos.d
when: ansible_os_family == 'RedHat'

- name: Configure apt for Jenkins repository.
become: yes
copy:
src: jenkins/etc/apt/sources.list.d/jenkins.list
dest: /etc/apt/sources.list.d
when: ansible_os_family == 'Debian'

- name: Configure gpg key for Jenkins repository.
become: yes
copy:
@@ -44,5 +45,16 @@
key: /etc/pki/rpm-gpg/jenkins-ci.org.key
when: ansible_os_family == 'RedHat'

- name: Import GPG key for Jenkins repo.
become: yes
apt_key:
data: "{{ lookup('file', 'jenkins/jenkins-ci.org.key') }}"
when: ansible_os_family == 'Debian'

- name: Update apt cache.
apt:
update_cache: yes
when: ansible_os_family == 'Debian'

roles:
- "{{ rolename }}"

tasks/install/redhat.yaml → vars/Debian.yaml View File

@@ -12,13 +12,5 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Ensure build dependencies are installed.
yum:
pkg: "{{ item }}"
state: installed
with_items: jenkins_build_depends

- name: Ensure jenkins is installed.
yum:
pkg: jenkins
state: installed
__jenkins_build_depends:
- openjdk-7-jdk

Loading…
Cancel
Save