-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
375d6a5
commit 2ba7b5d
Showing
9 changed files
with
75 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ galaxy_info: | |
versions: | ||
- bionic | ||
- xenial | ||
- name: CentOS | ||
versions: | ||
- 7 | ||
- 8 | ||
|
||
galaxy_tags: | ||
- jenkins | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import re | ||
import testinfra.utils.ansible_runner | ||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('centos') | ||
|
||
|
||
def test_java8_is_installed(host): | ||
java8 = host.package("java-1.8.0-openjdk") | ||
assert java8.is_installed | ||
assert java8.version.startswith("1.8.0") | ||
|
||
|
||
def test_jenkins_is_installed(host): | ||
cmd = host.run("java -jar /usr/lib/jenkins/jenkins.war --version") | ||
assert cmd.rc == 0 | ||
pattern = re.compile("^[\\d.]+$") | ||
assert pattern.match(cmd.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Add Jenkins yum repository | ||
yum_repository: | ||
name: jenkins | ||
description: Jenkins-stable | ||
baseurl: http://pkg.jenkins.io/redhat-stable | ||
enabled: yes | ||
gpgcheck: yes | ||
gpgkey: https://jenkins-ci.org/redhat/jenkins-ci.org.key | ||
|
||
- name: Install Jenkins | ||
yum: | ||
name: jenkins | ||
update_cache: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
--- | ||
- name: Install required packages | ||
apt: | ||
name: apt-transport-https | ||
- name: Add the Jenkins apt key | ||
apt_key: | ||
url: https://pkg.jenkins.io/debian-stable/jenkins.io.key | ||
- name: Add the Jenkins repository into sources list | ||
apt_repository: | ||
repo: deb https://pkg.jenkins.io/debian-stable binary/ | ||
- name: Install latest Jenkins | ||
apt: | ||
name: jenkins | ||
- name: Execute the appropriate tasks, depending on the distribution. | ||
include: "{{ ansible_distribution | lower }}.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: Install required packages | ||
apt: | ||
name: apt-transport-https | ||
- name: Add the Jenkins apt key | ||
apt_key: | ||
url: https://pkg.jenkins.io/debian-stable/jenkins.io.key | ||
- name: Add the Jenkins repository into sources list | ||
apt_repository: | ||
repo: deb https://pkg.jenkins.io/debian-stable binary/ | ||
- name: Install latest Jenkins | ||
apt: | ||
name: jenkins |