Skip to content

Commit

Permalink
Merge pull request #119 from idealista/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sorobon committed Sep 20, 2023
2 parents 2f7ce70 + 50b85b7 commit d2d32dd
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 35 deletions.
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ install:
- pipenv sync
env:
jobs:
- DOCKER_IMAGE_BASE=idealista/jdk:8u252-stretch-openjdk-headless TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:8u252-stretch-openjdk-headless TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:8u252-stretch-openjdk-headless TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.12-buster-openjdk-headless TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.12-buster-openjdk-headless TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.12-buster-openjdk-headless TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.6-stretch-openjdk-headless TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.6-stretch-openjdk-headless TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.6-stretch-openjdk-headless TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:8u265-focal-openjdk-headless TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:8u265-focal-openjdk-headless TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:8u265-focal-openjdk-headless TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:14.0.1-focal-openjdk-headless TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:14.0.1-focal-openjdk-headless TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:14.0.1-focal-openjdk-headless TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-bullseye-temurin-jdk TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-bullseye-temurin-jdk TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-bullseye-temurin-jdk TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-buster-temurin-jdk TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-buster-temurin-jdk TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-buster-temurin-jdk TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-bullseye-temurin-jdk TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-bullseye-temurin-jdk TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:11.0.20-bullseye-temurin-jdk TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-focal-temurin-jdk TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-focal-temurin-jdk TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:8u382-focal-temurin-jdk TOMCAT_VERSION=7.0.108
- DOCKER_IMAGE_BASE=idealista/jdk:17.0.8-focal-temurin-jdk TOMCAT_VERSION=9.0.43
- DOCKER_IMAGE_BASE=idealista/jdk:17.0.8-focal-temurin-jdk TOMCAT_VERSION=8.5.63
- DOCKER_IMAGE_BASE=idealista/jdk:17.0.8-focal-temurin-jdk TOMCAT_VERSION=7.0.108
script:
- pipenv run molecule test

Expand Down
30 changes: 22 additions & 8 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
---

# Based on ansible-lint config
extends: default

ignore: |
*.travis.yml
test_*.yml

rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
# NOTE(retr0h): Templates no longer fail this lint rule.
# Uncomment if running old Molecule templates.
# truthy: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch

## [Unreleased](https://github.com/idealista/tomcat_role/tree/develop)

## [1.10.4](https://github.com/idealista/tomcat_role/tree/1.10.4)
[Full Changelog](https://github.com/idealista/tomcat_role/compare/1.10.3...1.10.4)
### Fixed
- *[#117](https://github.com/idealista/tomcat_role/issues/117) Agent jar installation not working correctly* @sorobon

## [1.10.3](https://github.com/idealista/tomcat_role/tree/1.10.3)
[Full Changelog](https://github.com/idealista/tomcat_role/compare/1.10.2...1.10.3)
### Added
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ lxml = "==4.6.2"
ansible-lint = "==4.2.0"

[requires]
python_version = "3"
python_version = "3"
2 changes: 1 addition & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 20 additions & 6 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
FROM --platform=linux/amd64 {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
FROM --platform=linux/amd64 {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y -q python3 sudo bash ca-certificates iproute2 systemd systemd-sysv && \
apt-get clean
{% if 'stretch' in item.image %}
RUN echo "deb http://archive.debian.org/debian/ stretch contrib main non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch contrib main non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
rm /etc/apt/sources.list.d/ftp* && \
apt-get update
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python3 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

STOPSIGNAL SIGRTMIN+3
RUN systemctl set-default multi-user.target
Expand Down
10 changes: 10 additions & 0 deletions molecule/default/group_vars/tomcat/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ tomcat_agents_config:
catalina_opts:
- '-javaagent:{{ tomcat_install_path }}/datadog/dd-java-agent-0.73.0.jar -Ddd.profiling.enabled=true -Ddd.logs.injection=true -Ddd.service=sample -Ddd.env=molecule'
configuration_files: []
- name: "otel"
version: "1.30.0"
download_url: "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.30.0/opentelemetry-javaagent.jar"
catalina_opts:
- '-javaagent:{{ tomcat_install_path }}/otel/opentelemetry-javaagent.jar -Dotel.javaagent.configuration-file={{ tomcat_install_path }}/otel/otel.properties'
configuration_files:
- "otel.properties"
params: {
service_name: "application_sample_name"
}

tomcat_logs_path: /var/log/tomcat

Expand Down
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ platforms:
- name: tomcat
groups:
- tomcat
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:8u252-stretch-openjdk-headless}
image: ${DOCKER_IMAGE_BASE:-idealista/jdk:8u382-bullseye-temurin-jdk}
privileged: false
command: '/lib/systemd/systemd'
capabilities:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{{ ansible_managed }}

otel.service.name={{ item.params.service_name }}
2 changes: 1 addition & 1 deletion tasks/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
dest: "{{ tomcat_install_path }}/{{ item.name }}/{{ item.file }}"
owner: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
when: agent_downloaded.changed
when: tomcat_agent_configuration is defined
notify: restart tomcat
with_items:
- '{{ tomcat_agent_configuration }}'
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ molecule==3.0.4
docker==4.2.2
jmespath==0.9.4
lxml==4.6.2
ansible-lint==4.2.0
ansible-lint==4.2.0
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ tomcat_supported_agents_extensions:
- '.tar.bz2'
- '.tar.xz'

tomcat_show_server_info_on_error_page: false
tomcat_show_server_info_on_error_page: false

0 comments on commit d2d32dd

Please sign in to comment.