forked from Mirrors/cookiecutter-ansible-role
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a412940e75 | |||
| bda1f187c5 | |||
| 8adf037392 |
@@ -2,6 +2,13 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.1.0](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.3...v1.1.0) (2023-04-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Better default configuration. ([bda1f18](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/bda1f187c5b2c02042c8d34ddde5bec5b77a13f9))
|
||||
|
||||
### [1.0.3](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/compare/v1.0.2...v1.0.3) (2023-02-16)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
||||
|
||||
This role installs Mealie via Docker compose.
|
||||
This role installs {{ cookiecutter.app_name | title }} via Docker compose.
|
||||
|
||||
## Requirements
|
||||
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
---
|
||||
|
||||
## General
|
||||
# Version
|
||||
{{ cookiecutter.app_name }}_version: 1.0.0
|
||||
{{ cookiecutter.app_name }}_image: {{ cookiecutter.app_name }}:latest
|
||||
|
||||
# {{ cookiecutter.app_name }} paths
|
||||
{{ cookiecutter.app_name }}_root_path: /opt/{{ cookiecutter.app_name }}
|
||||
{{ cookiecutter.app_name }}_config_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/conf"
|
||||
{{ cookiecutter.app_name }}_http_port: {{ cookiecutter.http_port }}
|
||||
|
||||
# {{ cookiecutter.app_name | title }} paths
|
||||
{{ cookiecutter.app_name }}_root_path: /var/local
|
||||
{{ cookiecutter.app_name }}_data_base: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/{{ cookiecutter.app_name }}"
|
||||
{{ cookiecutter.app_name }}_config_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/conf/{{ cookiecutter.app_name }}"
|
||||
|
||||
# Add other paths here to make sure they're created automatically
|
||||
#
|
||||
{{ cookiecutter.app_name }}_skeleton_paths:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path {% raw %}}}{% endraw %}"
|
||||
|
||||
# Add more templates to be copied into the config
|
||||
{{ cookiecutter.app_name }}_configuration_files:
|
||||
- "{% raw %}docker-compose.yml{% endraw %}"
|
||||
- "env.{{ cookiecutter.app_name }}.conf"
|
||||
|
||||
# Documentation
|
||||
{{ cookiecutter.app_name }}_documentation_link: "{{ cookiecutter.documentation_URL }}"
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
galaxy_info:
|
||||
author: {{ cookiecutter.author }}
|
||||
namespace: {{ cookiecutter.namespace }}
|
||||
company: {% if cookiecutter.company != "" %}{{ cookiecutter.company }}{% endif %}
|
||||
{% if cookiecutter.company != "" %}company: {{ cookiecutter.company }}{% endif %}
|
||||
role_name: {{ cookiecutter.app_name }}
|
||||
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
|
||||
min_ansible_version: {{ cookiecutter.min_ansible_version }}
|
||||
min_ansible_container_version: {{ cookiecutter.min_ansible_container_version }}
|
||||
min_ansible_version: "{{ cookiecutter.min_ansible_version }}"
|
||||
min_ansible_container_version: "{{ cookiecutter.min_ansible_container_version }}"
|
||||
license: {{ cookiecutter.license }}
|
||||
galaxy_tags:
|
||||
- {{ cookiecutter.galaxy_tag_1 }}
|
||||
@@ -19,6 +19,6 @@ galaxy_info:
|
||||
- {{ ver }}{% endfor %}
|
||||
{% endif %}{% if cookiecutter.platforms.ubuntu_list %}
|
||||
- name: Ubuntu
|
||||
versions: {% for ver in cookiecutter.platforms.ubuntu_list %}
|
||||
versions:{% for ver in cookiecutter.platforms.ubuntu_list %}
|
||||
- {{ ver }}{% endfor %}
|
||||
{% endif %}
|
||||
@@ -17,8 +17,8 @@
|
||||
src: "{%raw%}{{{%endraw%} item {%raw%}}}{%endraw%}.j2"
|
||||
dest: "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {%raw%}}}{%endraw%}/{%raw%}{{{%endraw%} item {%raw%}}}{%endraw%}"
|
||||
mode: '0640'
|
||||
loop:
|
||||
- "docker-compose.yml"
|
||||
with_items:
|
||||
- "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_configuration_files {%raw%}}}{%endraw%}"
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
# {{ cookiecutter.app_name }} docker compose
|
||||
version: '3.9'
|
||||
services:
|
||||
{{ cookiecutter.app_name}}:
|
||||
image: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_image {% raw %}}}{% endraw %}"
|
||||
container_name: {{ cookiecutter.app_name }}-service
|
||||
restart: always
|
||||
env_file:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser {% raw %}}}{% endraw %}/env.{{ cookiecutter.app_name }}.conf"
|
||||
ports:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_http_port {% raw %}}}{% endraw %}"
|
||||
# Add more ports if necessary
|
||||
networks:
|
||||
- {{ cookiecutter.app_name }}-net
|
||||
# optional
|
||||
volumes:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_http_port {% raw %}}}{% endraw %}"
|
||||
depends_on:
|
||||
- other
|
||||
- services
|
||||
|
||||
|
||||
networks:
|
||||
{{ cookiecutter.app_name }}-net
|
||||
@@ -0,0 +1,2 @@
|
||||
# Add environment variables for {{ cookiecutter.app_name }} here
|
||||
# Note: This is a .ini file format
|
||||
@@ -2,6 +2,7 @@
|
||||
"comment_0":"The role name will be the value you assign to app_name with _role appended",
|
||||
"comment_1":"Introduce in exec_name the executable file name, you can change it later in the defaults/main.yml if you don't know it",
|
||||
"app_name": "",
|
||||
"http_port": "3000",
|
||||
"github_user": "equinoxel",
|
||||
"patreon_user": "laurivan",
|
||||
"company": "",
|
||||
@@ -13,8 +14,8 @@
|
||||
"molecule_version": "4.0.4",
|
||||
"python_docker_version": "6.0.1",
|
||||
"molecule_docker_version": "2.1.0",
|
||||
"ansible_lint_version":"6.12.2",
|
||||
"yamllint_version": "1.29.0",
|
||||
"ansible_lint_version":"6.14.4",
|
||||
"yamllint_version": "1.30.0",
|
||||
"license":"MIT",
|
||||
"galaxy_tag_1":"tag1",
|
||||
"galaxy_tag_2":"tag2",
|
||||
@@ -26,5 +27,5 @@
|
||||
"has_files":["True", "False"],
|
||||
"has_handlers":["True", "False"],
|
||||
"has_templates":["True", "False"],
|
||||
"documentation_URL":""
|
||||
"documentation_URL":"https://www.laurivan.com"
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ def checkInput():
|
||||
print("Error: app_name should not have _role or -role at the end, try again without it")
|
||||
print(" The name of the role will the value you introduce in app_name plus _role appended")
|
||||
sys.exit(1)
|
||||
if not moleculeVersion.startswith("3"):
|
||||
print("Error: Only supported molecule version 3.x.x, please change it and try again")
|
||||
if not (moleculeVersion.startswith("3") or moleculeVersion.startswith("4")):
|
||||
print("Error: Only supported molecule version 3.x.x or 4.x.x, please change it and try again")
|
||||
sys.exit(1)
|
||||
|
||||
def configureRole():
|
||||
|
||||
Reference in New Issue
Block a user