forked from Mirrors/cookiecutter-ansible-role
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea7487e2a9 | ||
|
|
74b1c3483f |
@@ -1,15 +1,15 @@
|
||||
---
|
||||
dist: focal
|
||||
dist: xenial
|
||||
language: python
|
||||
python: "3.10"
|
||||
python: "3.9"
|
||||
os: linux
|
||||
services:
|
||||
- docker
|
||||
install:
|
||||
- pip install pipenv
|
||||
- pip3 install cookiecutter
|
||||
env:
|
||||
jobs:
|
||||
- MOLECULE_DISTRO=debian:bullseye-slim
|
||||
- MOLECULE_DISTRO=debian:stretch-slim
|
||||
- MOLECULE_DISTRO=debian:buster-slim
|
||||
script:
|
||||
- ./test.sh
|
||||
@@ -20,4 +20,3 @@ notifications:
|
||||
on_failure: always
|
||||
recipients:
|
||||
- desarrollo.benders@idealista.com
|
||||
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -3,20 +3,6 @@ All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [2.10.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.10.0)
|
||||
### Changed
|
||||
- *Improve README init scrips to avoid errors when create two roles on same path because already pipenv exists.* @adrian-arapiles
|
||||
- *Change travis.yml order of email notification as documentation explains.* @adrian-arapiles
|
||||
- *Add first line `---` to ansible-lint file because it's a yml.* @adrian-arapiles
|
||||
### Fixed
|
||||
- *[92](https://github.com/idealista/cookiecutter-ansible-role/issues/92) Fix meta.yml lint warning from `galaxy-tags` to `galaxy_tags`.* @adrian-arapiles
|
||||
|
||||
## [2.9.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.9.0)
|
||||
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.8.1...2.9.0)
|
||||
### Changed
|
||||
- *[#86](https://github.com/idealista/cookiecutter-ansible-role/issues/86) Upgrade molecule config to test under debian bullseye* @santi-eidu
|
||||
- *[#86](https://github.com/idealista/cookiecutter-ansible-role/issues/86) Upgrade ansible to v5.2.0 and ansible lint to v5.3.2 to avoid lint error* @santi-eidu
|
||||
## [2.8.1](https://github.com/idealista/cookiecutter-ansible-role/tree/2.8.1)
|
||||
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.8.0...2.8.1)
|
||||
### Fixed
|
||||
|
||||
19
README.md
19
README.md
@@ -1,7 +1,9 @@
|
||||
# Cookiecutter Ansible Role
|
||||

|
||||
|
||||
[](https://travis-ci.com/idealista/cookiecutter-ansible-role)
|
||||
[](https://travis-ci.com/idealista/cookiecutter-ansible-role)
|
||||
|
||||
|
||||
|
||||
This cookiecutter generates an [ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html).
|
||||
|
||||
@@ -29,8 +31,7 @@ You just need to have [pipenv](https://github.com/pypa/pipenv) installed.
|
||||
|
||||
## Usage
|
||||
|
||||
To generate your ansible role type ```printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter https://github.com/idealista/cookiecutter-ansible-role && rm -rf Pipfile*
|
||||
requirements.txt && pipenv --rm && rm -rf requirements.txt```.
|
||||
To generate your ansible role type ```printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter https://github.com/idealista/cookiecutter-ansible-role && rm Pipfile* requirements.txt```.
|
||||
|
||||
Then, introduce some parameters needed for generating it.
|
||||
|
||||
@@ -45,17 +46,15 @@ github_user [idealista]:
|
||||
company [Idealista S.A.U.]:
|
||||
author []: pablogcaldito
|
||||
min_ansible_version []: 2.2
|
||||
ansible_version []: 5.2.0
|
||||
molecule_version []: 3.4.0
|
||||
python_docker_version []: 5.0.0
|
||||
molecule_docker_version []: 0.2.4
|
||||
ansible_lint_version []: 5.3.2
|
||||
yamllint_version []: 1.28.0
|
||||
ansible_version []: 2.8.8
|
||||
molecule_version []: 3.0.1
|
||||
python_docker_version []: 4.1.0
|
||||
ansible_lint_version []: 4.2.0
|
||||
license [Apache 2.0]:
|
||||
galaxy_tag_1 [example_tag1]: github_cli
|
||||
galaxy_tag_2 [example_tag2]: github
|
||||
galaxy_tag_3 [example_tag3]: cli
|
||||
Select debian_bullseye_support:
|
||||
Select debian_stretch_support:
|
||||
1 - True
|
||||
2 - False
|
||||
Choose from 1, 2 [1]:
|
||||
|
||||
@@ -7,17 +7,16 @@
|
||||
"company": "Idealista S.A.U.",
|
||||
"author": "",
|
||||
"min_ansible_version": "",
|
||||
"ansible_version": "5.2.0",
|
||||
"ansible_version": "4.4.0",
|
||||
"molecule_version": "3.4.0",
|
||||
"python_docker_version": "5.0.0",
|
||||
"molecule_docker_version": "0.2.4",
|
||||
"ansible_lint_version":"5.3.2",
|
||||
"yamllint_version": "1.28.0",
|
||||
"ansible_lint_version":"5.1.2",
|
||||
"license":"Apache 2.0",
|
||||
"galaxy_tag_1":"tag1",
|
||||
"galaxy_tag_2":"tag2",
|
||||
"galaxy_tag_3":"tag3",
|
||||
"debian_bullseye_support":["True", "False"],
|
||||
"galaxy_tag_1":"example_tag1",
|
||||
"galaxy_tag_2":"example_tag2",
|
||||
"galaxy_tag_3":"example_tag3",
|
||||
"debian_stretch_support":["True", "False"],
|
||||
"debian_buster_support":["True", "False"],
|
||||
"has_service":["True", "False"],
|
||||
"has_files":["True", "False"],
|
||||
|
||||
9
test.sh
9
test.sh
@@ -8,17 +8,16 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal
|
||||
exec_name="gh" \
|
||||
author="John Doe" \
|
||||
min_ansible_version="2.2" \
|
||||
ansible_version="5.2.0" \
|
||||
ansible_version="4.4.0" \
|
||||
molecule_version="3.4.0" \
|
||||
python_docker_version="5.0.0" \
|
||||
molecule_docker_version="0.2.4" \
|
||||
ansible_lint_version="5.3.2" \
|
||||
yamllint_version="1.28.0" \
|
||||
ansible_lint_version="5.1.2" \
|
||||
has_service="False" \
|
||||
has_files="False" \
|
||||
has_handlers="False" \
|
||||
has_templates="False" \
|
||||
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
|
||||
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt
|
||||
|
||||
(
|
||||
# Adjust the role to test
|
||||
@@ -30,7 +29,7 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal
|
||||
# Launch molecule tests
|
||||
pipenv install -r test-requirements.txt --three
|
||||
pipenv run molecule test
|
||||
|
||||
|
||||
)
|
||||
# Cleanup
|
||||
rm -rf github_cli_role
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
exclude_paths:
|
||||
- ./molecule
|
||||
- ./.travis.yml
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
This ansible role installs {% if cookiecutter.documentation_URL != "" %}[{% endif %}{{ cookiecutter.app_name | replace('_',' ') | title }}{% if cookiecutter.documentation_URL != "" %}]({{ cookiecutter.documentation_URL }}){% endif %} in a Debian environment. It has been tested for the following Debian versions:
|
||||
{% if cookiecutter.debian_bullseye_support == 'True' %}* Bulleye{% endif %}
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}* Stretch{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}* Buster{% endif %}
|
||||
|
||||
This role has been generated using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) tool, you can generate a similar role that fits your needs using the this [cookiecutter template](https://github.com/idealista/cookiecutter-ansible-role).
|
||||
|
||||
@@ -6,12 +6,12 @@ galaxy_info:
|
||||
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
|
||||
min_ansible_version: {{ cookiecutter.min_ansible_version }}
|
||||
license: {{ cookiecutter.license }}
|
||||
galaxy_tags:
|
||||
galaxy-tags:
|
||||
- {{ cookiecutter.galaxy_tag_1 }}
|
||||
- {{ cookiecutter.galaxy_tag_2 }}
|
||||
- {{ cookiecutter.galaxy_tag_3 }}
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
{% if cookiecutter.debian_bullseye_support == 'True' %}- bullseye{% endif %}
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %}
|
||||
|
||||
@@ -8,5 +8,5 @@ FROM {{ item.image }}
|
||||
|
||||
# install minimal packages for debian slim images
|
||||
RUN apt-get update && \
|
||||
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
|
||||
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
|
||||
apt-get clean{% endraw %}
|
||||
|
||||
@@ -10,7 +10,7 @@ platforms:
|
||||
- name: {{ cookiecutter.app_name }}
|
||||
groups:
|
||||
- {{ cookiecutter.app_name }}_group
|
||||
image: ${MOLECULE_DISTRO:-debian:bullseye-slim}
|
||||
image: ${MOLECULE_DISTRO:-debian:buster-slim}
|
||||
privileged: false
|
||||
capabilities:
|
||||
- SYS_ADMIN
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
get_url:
|
||||
url: "{% raw %}{{{% endraw %} goss_url {% raw %}}}{% endraw %}"
|
||||
dest: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %}"
|
||||
checksum: "sha256{% raw %}:{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
||||
sha256sum: "{% raw %}{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
||||
mode: 0755
|
||||
register: download_goss
|
||||
until: download_goss is succeeded
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
{%- endif %}
|
||||
mode: 0755
|
||||
state: directory
|
||||
with_items:
|
||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
||||
@@ -39,7 +38,6 @@
|
||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
||||
{%- endif %}
|
||||
mode: 0755
|
||||
state: directory
|
||||
when: {{ cookiecutter.app_name }}_log_file is defined
|
||||
tags:
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Install
|
||||
import_tasks: install.yml
|
||||
include: install.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_install
|
||||
|
||||
- name: {{ cookiecutter.app_name | upper }} | Configure
|
||||
import_tasks: config.yml
|
||||
include: config.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_configure
|
||||
{% if cookiecutter.has_service == 'True' %}
|
||||
- name: {{ cookiecutter.app_name | upper }} | Service
|
||||
import_tasks: service.yml
|
||||
include: service.yml
|
||||
tags:
|
||||
- {{ cookiecutter.app_name }}_service
|
||||
{% endif %}
|
||||
@@ -2,5 +2,4 @@ ansible=={{ cookiecutter.ansible_version }}
|
||||
molecule=={{ cookiecutter.molecule_version }}
|
||||
docker=={{ cookiecutter.python_docker_version }}
|
||||
molecule-docker=={{ cookiecutter.molecule_docker_version }}
|
||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
||||
yamllint=={{ cookiecutter.yamllint_version }}
|
||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
||||
@@ -10,8 +10,8 @@ install:
|
||||
- pipenv sync
|
||||
env:
|
||||
jobs:
|
||||
{% if cookiecutter.debian_stretch_support == 'True' %}- MOLECULE_DISTRO=debian:stretch-slim{% endif %}
|
||||
{% if cookiecutter.debian_buster_support == 'True' %}- MOLECULE_DISTRO=debian:buster-slim{% endif %}
|
||||
{% if cookiecutter.debian_bullseye_support == 'True' %}- MOLECULE_DISTRO=debian:bullseye-slim{% endif %}
|
||||
script:
|
||||
- pipenv run molecule test --all
|
||||
|
||||
|
||||
Reference in New Issue
Block a user