-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from idealista/develop
Release 5.2.0
- Loading branch information
Showing
28 changed files
with
392 additions
and
140 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
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,7 +1,3 @@ | ||
--- | ||
|
||
# OpenJDK implementation | ||
java_open_jdk_package: openjdk-{{ java_open_jdk_version_major }}-jdk-headless | ||
java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-openjdk-amd64 | ||
java_open_jdk_apt_extra_packages: [] | ||
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} | ||
java_open_jdk_default_java_home: /usr/lib/jvm/default-java |
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,15 @@ | ||
# Molecule managed | ||
|
||
{% if item.registry is defined %} | ||
FROM {{ item.registry.url }}/{{ item.image }} | ||
{% else %} | ||
FROM {{ item.image }} | ||
{% endif %} | ||
|
||
RUN mkdir -p /usr/share/man/man1 | ||
|
||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ | ||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ | ||
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ | ||
elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \ | ||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi |
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,6 @@ | ||
--- | ||
|
||
- name: Converge | ||
hosts: openjdk | ||
roles: | ||
- java_role |
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 @@ | ||
--- | ||
java_open_jdk_apt_extra_packages: | ||
- python-apt | ||
- apt-transport-https | ||
java_open_jdk_version_major: 8 | ||
# Supported major releases: 8 and from 11 to 14; hotspot and openj9 implementations | ||
|
||
# For Debian family | ||
java_required_repositories_openjdk: | ||
- deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ {{ ansible_distribution_release }} main | ||
java_required_libs_openjdk: [] | ||
java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot-amd64 | ||
|
||
# For RHEL family | ||
# java_required_repositories_openjdk: | ||
# - { name: "AdoptOpenJDK", baseurl: "http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/$releasever/$basearch" } | ||
# java_open_jdk_home_dir: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot | ||
|
||
java_required_key_repositories_openjdk: | ||
- https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | ||
java_open_jdk_package: adoptopenjdk-{{ java_open_jdk_version_major }}-hotspot | ||
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} |
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,25 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
|
||
lint: | | ||
yamllint . | ||
ansible-lint . | ||
platforms: | ||
- name: openjdk-adopt-test | ||
groups: | ||
- openjdk | ||
image: ${DOCKER_IMAGE_BASE:-debian:buster-slim} | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
links: | ||
group_vars: ./group_vars | ||
scenario: | ||
name: adoptopenjdk | ||
verifier: | ||
name: ansible |
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 @@ | ||
--- | ||
|
||
file: | ||
{{ java_open_jdk_home }}/lib: | ||
exists: true | ||
filetype: directory | ||
package: | ||
{% if java_open_jdk_version is defined and java_open_jdk_version is not sameas None and java_open_jdk_version != "" %} | ||
{{ java_open_jdk_package }}: | ||
installed: true | ||
versions: | ||
- {{ java_open_jdk_version }} | ||
{% else %} | ||
{{ java_open_jdk_package }}: | ||
installed: true | ||
{% endif %} |
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,58 @@ | ||
--- | ||
# This is an example playbook to execute goss tests. | ||
# Tests need distributed to the appropriate ansible host/groups | ||
# prior to execution by `goss validate`. | ||
# | ||
# The goss ansible module is installed with molecule. The ANSIBLE_LIBRARY | ||
# path is updated appropriately on `molecule verify`. | ||
|
||
# Details about ansible module: | ||
# - https://github.com/indusbox/goss-ansible | ||
|
||
- name: Verify | ||
hosts: all | ||
vars: | ||
goss_version: v0.3.11 | ||
goss_sha256sum: 7a751c102abac61fd8dff45f87f36c3732cb5158e1414ab78e6877864fc2f7a4 | ||
goss_arch: amd64 | ||
goss_dst: /usr/local/bin/goss | ||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" | ||
goss_test_directory: /tmp | ||
goss_format: documentation | ||
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" | ||
molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" | ||
|
||
tasks: | ||
- name: Download and install goss | ||
get_url: | ||
url: "{{ goss_url }}" | ||
dest: "{{ goss_dst }}" | ||
mode: 0755 | ||
|
||
- name: Copy tests to remote | ||
template: | ||
src: "{{ item }}" | ||
dest: "{{ goss_test_directory }}/{{ item | basename }}" | ||
with_fileglob: | ||
- "{{ playbook_dir }}/tests/test_*.yml" | ||
|
||
- name: Register test files | ||
shell: "ls {{ goss_test_directory }}/test_*.yml" | ||
register: test_files | ||
|
||
- name: Execute Goss tests | ||
command: "goss -g {{ item }} validate --format {{ goss_format }}" | ||
register: test_results | ||
with_items: "{{ test_files.stdout_lines }}" | ||
ignore_errors: true | ||
|
||
- name: Display details about the goss results | ||
debug: | ||
msg: "{{ item.stdout_lines }}" | ||
with_items: "{{ test_results.results }}" | ||
|
||
- name: Fail when tests fail | ||
fail: | ||
msg: "Goss failed to validate" | ||
when: item.rc != 0 | ||
with_items: "{{ test_results.results }}" |
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,15 @@ | ||
# Molecule managed | ||
|
||
{% if item.registry is defined %} | ||
FROM {{ item.registry.url }}/{{ item.image }} | ||
{% else %} | ||
FROM {{ item.image }} | ||
{% endif %} | ||
|
||
RUN mkdir -p /usr/share/man/man1 | ||
|
||
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ | ||
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python36 sudo python3-dnf bash && dnf clean all; \ | ||
elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ | ||
elif [ $(command -v zypper) ]; then zypper refresh && zypper update -y && zypper install -y python sudo bash python-xml && zypper clean -a; \ | ||
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; fi |
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,6 @@ | ||
--- | ||
|
||
- name: Converge | ||
hosts: openjdk | ||
roles: | ||
- java_role |
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,23 @@ | ||
--- | ||
|
||
java_open_jdk_version_major: 11 | ||
# Supported versions: 8 (1.8.0 in RHEL), 11 | ||
|
||
# For RHEL family | ||
java_required_repositories_openjdk: | ||
- { name: "AmazonCorretto", baseurl: "https://yum.corretto.aws/$basearch" } | ||
java_required_key_repositories_openjdk: | ||
- https://yum.corretto.aws/corretto.key | ||
java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-devel | ||
|
||
# For Debian family | ||
# java_required_repositories_openjdk: | ||
# - deb https://apt.corretto.aws stable main | ||
# java_required_key_repositories_openjdk: | ||
# - https://apt.corretto.aws/corretto.key | ||
# java_required_libs_openjdk: | ||
# - apt-transport-https | ||
# java_open_jdk_package: java-{{ java_open_jdk_version_major }}-amazon-corretto-jdk | ||
|
||
java_open_jdk_home_dir: java-{{ java_open_jdk_version_major }}-amazon-corretto | ||
java_open_jdk_home: /usr/lib/jvm/{{ java_open_jdk_home_dir }} |
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,25 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
|
||
lint: | | ||
yamllint . | ||
ansible-lint . | ||
platforms: | ||
- name: openjdk-corretto-test | ||
groups: | ||
- openjdk | ||
image: ${DOCKER_IMAGE_BASE:-centos:8} | ||
|
||
provisioner: | ||
name: ansible | ||
inventory: | ||
links: | ||
group_vars: ./group_vars | ||
scenario: | ||
name: corretto | ||
verifier: | ||
name: ansible |
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 @@ | ||
--- | ||
|
||
file: | ||
{{ java_open_jdk_home }}/lib: | ||
exists: true | ||
filetype: directory | ||
package: | ||
{% if java_open_jdk_version is defined and java_open_jdk_version is not sameas None and java_open_jdk_version != "" %} | ||
{{ java_open_jdk_package }}: | ||
installed: true | ||
versions: | ||
- {{ java_open_jdk_version }} | ||
{% else %} | ||
{{ java_open_jdk_package }}: | ||
installed: true | ||
{% endif %} |
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,58 @@ | ||
--- | ||
# This is an example playbook to execute goss tests. | ||
# Tests need distributed to the appropriate ansible host/groups | ||
# prior to execution by `goss validate`. | ||
# | ||
# The goss ansible module is installed with molecule. The ANSIBLE_LIBRARY | ||
# path is updated appropriately on `molecule verify`. | ||
|
||
# Details about ansible module: | ||
# - https://github.com/indusbox/goss-ansible | ||
|
||
- name: Verify | ||
hosts: all | ||
vars: | ||
goss_version: v0.3.11 | ||
goss_sha256sum: 7a751c102abac61fd8dff45f87f36c3732cb5158e1414ab78e6877864fc2f7a4 | ||
goss_arch: amd64 | ||
goss_dst: /usr/local/bin/goss | ||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" | ||
goss_test_directory: /tmp | ||
goss_format: documentation | ||
molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" | ||
molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" | ||
|
||
tasks: | ||
- name: Download and install goss | ||
get_url: | ||
url: "{{ goss_url }}" | ||
dest: "{{ goss_dst }}" | ||
mode: 0755 | ||
|
||
- name: Copy tests to remote | ||
template: | ||
src: "{{ item }}" | ||
dest: "{{ goss_test_directory }}/{{ item | basename }}" | ||
with_fileglob: | ||
- "{{ playbook_dir }}/tests/test_*.yml" | ||
|
||
- name: Register test files | ||
shell: "ls {{ goss_test_directory }}/test_*.yml" | ||
register: test_files | ||
|
||
- name: Execute Goss tests | ||
command: "goss -g {{ item }} validate --format {{ goss_format }}" | ||
register: test_results | ||
with_items: "{{ test_files.stdout_lines }}" | ||
ignore_errors: true | ||
|
||
- name: Display details about the goss results | ||
debug: | ||
msg: "{{ item.stdout_lines }}" | ||
with_items: "{{ test_results.results }}" | ||
|
||
- name: Fail when tests fail | ||
fail: | ||
msg: "Goss failed to validate" | ||
when: item.rc != 0 | ||
with_items: "{{ test_results.results }}" |
Oops, something went wrong.