This repository has been archived by the owner on May 11, 2024. It is now read-only.
-
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.
Merge pull request #2 from bec-galaxy/develop
Refactoring and Bugfix
- Loading branch information
Showing
25 changed files
with
297 additions
and
58 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 |
---|---|---|
@@ -1,2 +1,18 @@ | ||
--- | ||
releases: {} | ||
releases: | ||
1.1.0: | ||
changes: | ||
minor_changes: | ||
- Added unit test for .j2 extensions. | ||
- Use Vagrant in a 2nd unit tests for better code coverage. | ||
- Better log output for copied files. | ||
breaking_changes: | ||
- Permissions on copied files are now set recursively. | ||
For templates community.general.filetree was used, here it worked as expected. | ||
For files ansible.builtin.copy was used, here the problem occurred. Now filetree is used everywhere. | ||
- Filename of the Docker repository has changed to docker.list, before that the | ||
download name of the file was used. | ||
bugfixes: | ||
- Files in the shared folder are now templated with the correct subpath. | ||
- Removing the .j2 extension only at the end of the filename. | ||
release_date: "2023-10-03" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
namespace: bec | ||
name: docker | ||
|
||
version: 1.0.0 | ||
version: 1.1.0 | ||
readme: README.md | ||
authors: | ||
- Patrick Becker <[email protected]> | ||
|
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,2 +1,2 @@ | ||
--- | ||
requires_ansible: ">=2.9.10" | ||
requires_ansible: ">=2.14.0" |
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 +1 @@ | ||
NGINX_PORT=80 | ||
NGINX_PORT=80 |
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,4 @@ | ||
--- | ||
collections: | ||
- community.docker | ||
- community.general |
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,27 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
# Use one source folder for all hosts. | ||
docker_compose_environment: "files/docker/instance" | ||
|
||
# Use executable rights for the nginx html folder. | ||
docker_compose_permissions: "0755" | ||
tasks: | ||
- name: "Include role" | ||
ansible.builtin.include_role: | ||
name: "bec.docker.docker_ce" | ||
|
||
- name: "Include role" | ||
ansible.builtin.include_role: | ||
name: "bec.docker.docker_compose" | ||
|
||
- name: Output information about the Docker login step | ||
when: docker_login is defined | ||
ansible.builtin.debug: | ||
var: docker_login | ||
|
||
- name: Output information about the Docker compose step | ||
when: docker_compose is defined | ||
ansible.builtin.debug: | ||
var: docker_compose |
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 @@ | ||
NGINX_PORT=80 |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="light dark"> | ||
<title>Hello World</title> | ||
</head> | ||
|
||
<body> | ||
<p>Molecule test was successful.</p> | ||
</body> | ||
|
||
</html> |
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,50 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: vagrant | ||
platforms: | ||
# - name: ubuntu-23.04 | ||
# box: generic/ubuntu2304 | ||
# memory: 4096 | ||
# cpus: 2 | ||
# provider_options: | ||
# linked_clone: true | ||
# config_options: | ||
# ssh.keep_alive: true | ||
- name: ubuntu-22.04 | ||
box: generic/ubuntu2204 | ||
memory: 4096 | ||
cpus: 2 | ||
provider_options: | ||
linked_clone: true | ||
config_options: | ||
ssh.keep_alive: true | ||
- name: ubuntu-20.04 | ||
box: generic/ubuntu2004 | ||
memory: 4096 | ||
cpus: 4 | ||
provider_options: | ||
linked_clone: true | ||
config_options: | ||
ssh.keep_alive: true | ||
# - name: debian-12 | ||
# box: generic/debian12 | ||
# memory: 4096 | ||
# cpus: 4 | ||
# provider_options: | ||
# linked_clone: true | ||
# config_options: | ||
# ssh.keep_alive: true | ||
- name: debian-11 | ||
box: generic/debian11 | ||
memory: 4096 | ||
cpus: 4 | ||
provider_options: | ||
linked_clone: true | ||
config_options: | ||
ssh.keep_alive: true | ||
provisioner: | ||
name: ansible | ||
scenario: | ||
name: vagrant |
15 changes: 15 additions & 0 deletions
15
molecule/vagrant/templates/shared/data/.j2-test/.j2-file.html.j2
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="light dark"> | ||
<title>Hello World</title> | ||
</head> | ||
|
||
<body> | ||
<p>Ensure that the .j2 extension is removed only at the end of the path.</p> | ||
</body> | ||
|
||
</html> |
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 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="color-scheme" content="light dark"> | ||
<title>Hello World</title> | ||
</head> | ||
|
||
<body> | ||
<p>{{ ansible_managed }}</p> | ||
</body> | ||
|
||
</html> |
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 @@ | ||
--- | ||
version: '3.9' | ||
services: | ||
nginx: | ||
container_name: nginx | ||
image: nginx:1.24.0-alpine | ||
restart: unless-stopped | ||
volumes: | ||
- /opt/docker/data:/usr/share/nginx/html:ro | ||
ports: | ||
- 80:${NGINX_PORT}/tcp |
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,29 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
# This step checks the following things: | ||
# | ||
# - Was the docker-compose templates copied? | ||
# - Was the .env file copied? (Defines NGINX_PORT=80) | ||
# - Was the .env file found by docker-compose and the variables inserted? | ||
# - Was the container started correctly? | ||
# | ||
- name: Download nginx website index.html | ||
ansible.builtin.get_url: | ||
url: http://localhost/index.html | ||
dest: /tmp/index.html | ||
mode: "0644" | ||
checksum: "sha256:588c119d7665f1240a6b2814ca8abab3e8ccd65b618091df55c413530eceb90c" | ||
|
||
# Ensure that the .j2 extension is removed only at the end of the path. | ||
# | ||
# .j2-test/.j2-file.html.j2 -> .j2-test/.j2-file.html | ||
# | ||
- name: Download test website .j2-file.html | ||
ansible.builtin.get_url: | ||
url: http://localhost/.j2-test/.j2-file.html | ||
dest: /tmp/.j2-file.html | ||
mode: "0644" | ||
checksum: "sha256:6e4798029dc7fc82ff9b6904eaa735012dc51a9a93e015a25e74478436ae9157" |
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,7 @@ | ||
--- | ||
galaxy_info: | ||
author: Patrick Becker <[email protected]> | ||
description: Install docker from the official repository. | ||
description: Install Docker from the official repository. | ||
license: MIT | ||
|
||
min_ansible_version: "2.13" | ||
|
@@ -10,7 +10,6 @@ galaxy_info: | |
- name: Debian | ||
versions: | ||
- bullseye | ||
- buster | ||
- name: Ubuntu | ||
versions: | ||
- jammy | ||
|
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 @@ | ||
deb [arch=amd64 signed-by=/usr/share/keyrings/docker.asc] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release | lower }} stable |
Oops, something went wrong.