-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Ubuntu 18.04 (bionic) (#60)
* Don't force installation of apt packages The Ansible documentation warns against using this option, and the corresponding apt argument has been removed as of Ubuntu 18.04 (bionic). * Add test for deployment on Ubuntu 18.04 (bionic)
- Loading branch information
1 parent
b0a3d53
commit f619ece
Showing
7 changed files
with
127 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Molecule managed | ||
|
||
{% if item.registry is defined %} | ||
FROM {{ item.registry.url }}/{{ item.image }} | ||
{% else %} | ||
FROM {{ item.image }} | ||
{% endif %} | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y gpg apt-transport-https aptitude bash ca-certificates sudo \ | ||
python python-apt && \ | ||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 04EE7237B7D453EC && \ | ||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 648ACFD622F3D138 && \ | ||
apt-get clean | ||
|
||
RUN useradd -G sudo molecule |
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,46 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<hudson> | ||
<disabledAdministrativeMonitors/> | ||
<version>2.176.1</version> | ||
<installStateName>RESTART</installStateName> | ||
<numExecutors>1</numExecutors> | ||
<mode>EXCLUSIVE</mode> | ||
<useSecurity>true</useSecurity> | ||
<authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/> | ||
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm"> | ||
<disableSignup>false</disableSignup> | ||
<enableCaptcha>false</enableCaptcha> | ||
</securityRealm> | ||
<disableRememberMe>false</disableRememberMe> | ||
<projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/> | ||
<workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULLNAME}</workspaceDir> | ||
<buildsDir>${ITEM_ROOTDIR}/builds</buildsDir> | ||
<markupFormatter class="hudson.markup.EscapedMarkupFormatter"/> | ||
<jdks/> | ||
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/> | ||
<myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/> | ||
<clouds/> | ||
<quietPeriod>0</quietPeriod> | ||
<scmCheckoutRetryCount>0</scmCheckoutRetryCount> | ||
<views> | ||
<hudson.model.AllView> | ||
<owner class="hudson" reference="../../.."/> | ||
<name>all</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
</hudson.model.AllView> | ||
</views> | ||
<primaryView>all</primaryView> | ||
<slaveAgentPort>0</slaveAgentPort> | ||
<disabledAgentProtocols> | ||
<string>JNLP-connect</string> | ||
<string>JNLP2-connect</string> | ||
</disabledAgentProtocols> | ||
<label>master</label> | ||
<crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer"> | ||
<excludeClientIPFromCrumb>false</excludeClientIPFromCrumb> | ||
</crumbIssuer> | ||
<nodeProperties/> | ||
<globalNodeProperties/> | ||
</hudson> |
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,31 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | ||
name: yamllint | ||
platforms: | ||
- name: instance | ||
image: ubuntu:18.04 | ||
privileged: true | ||
exposed_ports: | ||
- 8080/tcp | ||
published_ports: | ||
- 0.0.0.0:8080:8080/tcp | ||
env: | ||
JENKINS_HOME: /jenkins | ||
provisioner: | ||
name: ansible | ||
log: true | ||
lint: | ||
name: ansible-lint | ||
options: | ||
# E602: Don't compare to empty string | ||
# All workarounds for this are uglier than just comparing to empty strings. See: | ||
# https://github.com/ansible/ansible-lint/issues/457 | ||
x: ['602'] | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
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,11 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
jenkins_config_owner: "jenkins" | ||
jenkins_config_group: "jenkins" | ||
jenkins_home: "/jenkins" | ||
jenkins_install_via: "apt" | ||
jenkins_version: "2.176.1" | ||
roles: | ||
- ansible-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__/ |
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,22 @@ | ||
import os | ||
|
||
import testinfra.utils.ansible_runner | ||
|
||
from jenkins import Jenkins | ||
|
||
|
||
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( | ||
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') | ||
|
||
|
||
def test_jenkins_installed(host): | ||
package = host.package('jenkins') | ||
|
||
assert package.is_installed | ||
|
||
|
||
def test_jenkins_version(): | ||
master = Jenkins('http://127.0.0.1:8080') | ||
version = master.get_version() | ||
|
||
assert version == '2.176.1' |
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