ansible-role-jenkins/tests/test.yaml
Paul Belanger f795330bc5 Reduce usage of becomes for testing
Change-Id: Ic5393ee08d93244f6df988d441a2d9be12e251ec
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-03-01 17:46:15 -05:00

61 lines
1.8 KiB
YAML

# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- hosts: test
vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
pre_tasks:
- name: Configure yum for Jenkins repository.
become: yes
copy:
src: jenkins/etc/yum.repos.d/jenkins.repo
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:
src: jenkins/jenkins-ci.org.key
dest: /etc/pki/rpm-gpg/
when: ansible_os_family == 'RedHat'
- name: Import GPG key for Jenkins repo.
become: yes
rpm_key:
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.
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
roles:
- "{{ rolename }}"