forked from Mirrors/cookiecutter-ansible-role
Compare commits
106 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5413342847 | |||
| fe7df1f907 | |||
| dea1634b98 | |||
| b44e69ad7e | |||
|
|
e6d5c5a9a3 | ||
|
|
a0c761368d | ||
|
|
6c534bdf83 | ||
|
|
c94c86d963 | ||
|
|
3917b2a78b | ||
|
|
c6446c7e58 | ||
|
|
45e9ea744b | ||
|
|
1e99d8b02c | ||
|
|
f23f55643d | ||
|
|
4b7c659da1 | ||
|
|
f6f4658aef | ||
|
|
42900e46c4 | ||
|
|
436e824881 | ||
|
|
6522c7ef21 | ||
|
|
8a599c249f | ||
|
|
fdbc7c3908 | ||
|
|
1121b4534e | ||
|
|
16095bb031 | ||
|
|
8ef54f7f0d | ||
|
|
b33689d3b5 | ||
|
|
ea7487e2a9 | ||
|
|
2406ba62c1 | ||
|
|
9e1cb98351 | ||
|
|
dc504ad7d6 | ||
|
|
74b1c3483f | ||
|
|
b5685a90cd | ||
|
|
23d2def966 | ||
|
|
076db03bbe | ||
|
|
c9e2a83163 | ||
|
|
ff5533b940 | ||
|
|
9211b42147 | ||
|
|
4c2995e3d8 | ||
|
|
07f9750241 | ||
|
|
14ae8d9e14 | ||
|
|
ed6eb9ff29 | ||
|
|
92e30ec9ac | ||
|
|
f33225106e | ||
|
|
665d89beb0 | ||
|
|
4459ae1aa6 | ||
|
|
28fe4678d7 | ||
|
|
57633e39ad | ||
|
|
668d890ce6 | ||
|
|
71711119ea | ||
|
|
cdb741f701 | ||
|
|
fb3253da25 | ||
|
|
0211cfcd29 | ||
|
|
01d41dc596 | ||
|
|
5fd7fc7e1d | ||
|
|
3514236fa0 | ||
|
|
d9964134da | ||
|
|
9a971619a7 | ||
|
|
409e7f8bd2 | ||
|
|
6a760eb1dc | ||
|
|
684428ec80 | ||
|
|
3a93e6734d | ||
|
|
5ad5453892 | ||
|
|
8e1924e9e3 | ||
|
|
519a783810 | ||
|
|
5fc3bcaa2e | ||
|
|
dacd85ef41 | ||
|
|
7e8ec829c9 | ||
|
|
cc0eb0ce7c | ||
|
|
08003a20e3 | ||
|
|
2838871c2b | ||
|
|
498bb69af5 | ||
|
|
9e12212122 | ||
|
|
bf38884dcd | ||
|
|
2372221f93 | ||
|
|
a082c79f12 | ||
|
|
921231864f | ||
|
|
c7be6405e8 | ||
|
|
53acbaa7d7 | ||
|
|
055c1ed1a8 | ||
|
|
092a44d4d2 | ||
|
|
e216704e9f | ||
|
|
1b9b8e81a2 | ||
|
|
8b089d7fdc | ||
|
|
bd4c9ee55d | ||
|
|
bfb05f9f7e | ||
|
|
2a4c935222 | ||
|
|
fc1c881864 | ||
|
|
29fef2078c | ||
|
|
3cb19fc4d9 | ||
|
|
a3fb7e6a37 | ||
|
|
602f6e5953 | ||
|
|
34f4edf4c9 | ||
|
|
0b139944f6 | ||
|
|
41f5790f9a | ||
|
|
8735563651 | ||
|
|
f2e385868d | ||
|
|
52fc713404 | ||
|
|
747c7f30de | ||
|
|
e5782c903a | ||
|
|
3ea1b47038 | ||
|
|
cceaac7b86 | ||
|
|
21de58a20b | ||
|
|
376996d273 | ||
|
|
dfedd31efb | ||
|
|
0a9343b545 | ||
|
|
035f88cd21 | ||
|
|
8e687b3d68 | ||
|
|
a2b0a538b2 |
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +1,2 @@
|
|||||||
|
---
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
|
|||||||
1
.github/auto_assign.yml
vendored
1
.github/auto_assign.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
# Set to true to add reviewers to pull requests
|
# Set to true to add reviewers to pull requests
|
||||||
addReviewers: true
|
addReviewers: true
|
||||||
|
|
||||||
|
|||||||
1
.github/stale.yml
vendored
1
.github/stale.yml
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
issues:
|
issues:
|
||||||
# Number of days of inactivity before an issue becomes stale
|
# Number of days of inactivity before an issue becomes stale
|
||||||
daysUntilStale: 90
|
daysUntilStale: 90
|
||||||
|
|||||||
19
.travis.yml
19
.travis.yml
@@ -1,16 +1,23 @@
|
|||||||
---
|
---
|
||||||
dist: xenial
|
dist: focal
|
||||||
language: python
|
language: python
|
||||||
python: "3.7"
|
python: "3.10"
|
||||||
os: linux
|
os: linux
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
install:
|
install:
|
||||||
- pip3 install cookiecutter
|
- pip install -I pipenv
|
||||||
env:
|
env:
|
||||||
jobs:
|
jobs:
|
||||||
- MOLECULE_DISTRO=debian:stretch-slim
|
- MOLECULE_DISTRO=debian:bullseye-slim
|
||||||
- MOLECULE_DISTRO=debian:buster-slim
|
- MOLECULE_DISTRO=debian:buster-slim
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./test.sh
|
- ./test.sh
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
if: branch = master
|
||||||
|
on_success: change
|
||||||
|
on_failure: always
|
||||||
|
recipients:
|
||||||
|
- desarrollo.benders@idealista.com
|
||||||
|
|
||||||
|
|||||||
68
CHANGELOG.md
68
CHANGELOG.md
@@ -1,68 +1,16 @@
|
|||||||
# Change Log
|
# Changelog
|
||||||
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
|
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.
|
||||||
### Fixed
|
|
||||||
### Added
|
|
||||||
### Changed
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
## [2.3.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.3.0)
|
## 1.0.0 (2023-01-11)
|
||||||
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.2.0...2.3.0)
|
|
||||||
### Fixed
|
|
||||||
- *[#40](https://github.com/idealista/cookiecutter-ansible-role/issues/40) Updated yamllint configuration* @frantsao
|
|
||||||
### Changed
|
|
||||||
- *[#38](https://github.com/idealista/cookiecutter-ansible-role/pull/38) Bump goss version from 0.3.11 to 0.3.14* @vicsufer
|
|
||||||
- *[#30](https://github.com/idealista/cookiecutter-ansible-role/issues/30) Using a new version for issue template* @xtianae7
|
|
||||||
### Removed
|
|
||||||
- *[#39](https://github.com/idealista/cookiecutter-ansible-role/pull/39) Community health files* @vicsufer
|
|
||||||
- *[#30](https://github.com/idealista/cookiecutter-ansible-role/issues/30) PULL_REQUEST_TEMPLATE removed, replaced with default community health file* @xtianae7
|
|
||||||
|
|
||||||
## [2.2.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.2.0) (2020-11-10)
|
|
||||||
### [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.1.0...2.2.0)
|
|
||||||
|
|
||||||
### Fixed
|
### Features
|
||||||
- *[#27](https://github.com/idealista/cookiecutter-ansible-role/issues/27) Adding Probot configuration to Ansible Role template* @dortegau
|
|
||||||
|
|
||||||
### Changed
|
* Refactor the template for docker-compose. ([b44e69a](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/b44e69ad7eaf1b3a0e284ac403c94c60c016a4ae))
|
||||||
- *[#27](https://github.com/idealista/cookiecutter-ansible-role/issues/27) Increase to 90 days the minimum days to declare a PR/Issue as `staled`* @dortegau
|
|
||||||
- *[#32](https://github.com/idealista/cookiecutter-ansible-role/pull/32) Avoid closing automatically good first issues* @vicsufer
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
- *[#29](https://github.com/idealista/cookiecutter-ansible-role/issues/29) Removing redudant script in .travis.yml* @xtianae7
|
|
||||||
|
|
||||||
## [2.1.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.1.0) (2020-10-19)
|
### Bug Fixes
|
||||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/2.0.0...2.1.0)
|
|
||||||
|
|
||||||
### Added
|
* accolades ([dea1634](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/dea1634b98c99230166d00ab5451adad9d004ddf))
|
||||||
- *[#20](https://github.com/idealista/cookiecutter-ansible-role/issues/20) Add basic configuration in order to enable Probot to delete automatically abandoned PRs/issues* @dortegau
|
* meta container version. ([fe7df1f](https://git.laurivan.com/Dev/cookiecutter-ansible-role-docker/commit/fe7df1f9073322a074489dcc5bfeb2397085dda7))
|
||||||
### Fixed
|
|
||||||
- *[#23](https://github.com/idealista/cookiecutter-ansible-role/issues/23) Change references to branch master to main* @pgomezcaldito
|
|
||||||
|
|
||||||
## [2.0.0](https://github.com/idealista/cookiecutter-ansible-role/tree/2.0.0) (2020-10-13)
|
|
||||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.1...2.0.0)
|
|
||||||
### Removed
|
|
||||||
- *[#16](https://github.com/idealista/cookiecutter-ansible-role/issues/16) Remove debian jessie support* @pablogcaldito
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- *[#15](https://github.com/idealista/cookiecutter-ansible-role/issues/15) Add pipenv wrapper* @pablogcaldito
|
|
||||||
- *Add boilerplate README.md* @vicsufer
|
|
||||||
|
|
||||||
## [1.0.1](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.1) (2020-09-17)
|
|
||||||
## [Full Changelog](https://github.com/idealista/cookiecutter-ansible-role/compare/1.0.0...1.0.1)
|
|
||||||
### Removed
|
|
||||||
- *[#9](https://github.com/idealista/cookiecutter-ansible-role/issues/9) Remove Vagrant pattern from role gitignore file* @vicsufer
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- *[#4](https://github.com/idealista/cookiecutter-ansible-role/issues/4) Upgrade to Goss v0.3.11* @pablogcaldito
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- *[#11](https://github.com/idealista/cookiecutter-ansible-role/issues/11) Fix parameterization of PrivateTmp* @pablogcaldito
|
|
||||||
- *[#7](https://github.com/idealista/cookiecutter-ansible-role/issues/7) Fix bug in in the check version task in install.yml* @pablogcaldito
|
|
||||||
- *[#3](https://github.com/idealista/cookiecutter-ansible-role/issues/3) Fix typo in both contributing files* @pablogcaldito
|
|
||||||
|
|
||||||
## [1.0.0](https://github.com/idealista/cookiecutter-ansible-role/tree/1.0.0) (2020-04-28)
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- *First release* @pablogcaldito
|
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -1,9 +1,7 @@
|
|||||||
# Cookiecutter Ansible Role
|
# Cookiecutter Ansible Role
|
||||||

|

|
||||||
|
|
||||||
[](https://travis-ci.org/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).
|
This cookiecutter generates an [ansible role](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html).
|
||||||
|
|
||||||
@@ -31,7 +29,8 @@ You just need to have [pipenv](https://github.com/pypa/pipenv) installed.
|
|||||||
|
|
||||||
## Usage
|
## 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 Pipfile* 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 -rf Pipfile*
|
||||||
|
requirements.txt && pipenv --rm && rm -rf requirements.txt```.
|
||||||
|
|
||||||
Then, introduce some parameters needed for generating it.
|
Then, introduce some parameters needed for generating it.
|
||||||
|
|
||||||
@@ -46,15 +45,17 @@ github_user [idealista]:
|
|||||||
company [Idealista S.A.U.]:
|
company [Idealista S.A.U.]:
|
||||||
author []: pablogcaldito
|
author []: pablogcaldito
|
||||||
min_ansible_version []: 2.2
|
min_ansible_version []: 2.2
|
||||||
ansible_version []: 2.8.8
|
ansible_version []: 5.2.0
|
||||||
molecule_version []: 3.0.1
|
molecule_version []: 3.4.0
|
||||||
python_docker_version []: 4.1.0
|
python_docker_version []: 5.0.0
|
||||||
ansible_lint_version []: 4.2.0
|
molecule_docker_version []: 0.2.4
|
||||||
|
ansible_lint_version []: 5.3.2
|
||||||
|
yamllint_version []: 1.28.0
|
||||||
license [Apache 2.0]:
|
license [Apache 2.0]:
|
||||||
galaxy_tag_1 [example_tag1]: github_cli
|
galaxy_tag_1 [example_tag1]: github_cli
|
||||||
galaxy_tag_2 [example_tag2]: github
|
galaxy_tag_2 [example_tag2]: github
|
||||||
galaxy_tag_3 [example_tag3]: cli
|
galaxy_tag_3 [example_tag3]: cli
|
||||||
Select debian_stretch_support:
|
Select debian_bullseye_support:
|
||||||
1 - True
|
1 - True
|
||||||
2 - False
|
2 - False
|
||||||
Choose from 1, 2 [1]:
|
Choose from 1, 2 [1]:
|
||||||
@@ -79,6 +80,7 @@ Select has_templates:
|
|||||||
1 - True
|
1 - True
|
||||||
2 - False
|
2 - False
|
||||||
Choose from 1, 2 [1]:
|
Choose from 1, 2 [1]:
|
||||||
|
documentation_URL: https://cli.github.com/manual/
|
||||||
```
|
```
|
||||||
|
|
||||||
It will create the following file structure:
|
It will create the following file structure:
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
---
|
||||||
exclude_paths:
|
exclude_paths:
|
||||||
- ./molecule
|
- ./molecule
|
||||||
|
- ./.travis.yml
|
||||||
|
- ./.github
|
||||||
parseable: true
|
parseable: true
|
||||||
skip_list:
|
skip_list:
|
||||||
- '204'
|
- '204'
|
||||||
2
ansible-role-{{cookiecutter.app_name}}/.github/FUNDING.yml
vendored
Normal file
2
ansible-role-{{cookiecutter.app_name}}/.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
github: {{ cookiecutter.github_user }}
|
||||||
|
patreon: {{ cookiecutter.patreon_user }}
|
||||||
@@ -1 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
issues:
|
issues:
|
||||||
# Number of days of inactivity before an issue becomes stale
|
# Number of days of inactivity before an issue becomes stale
|
||||||
daysUntilStale: 90
|
daysUntilStale: 90
|
||||||
@@ -4,6 +4,8 @@ extends: default
|
|||||||
|
|
||||||
ignore: |
|
ignore: |
|
||||||
molecule/**/tests/
|
molecule/**/tests/
|
||||||
|
.github
|
||||||
|
.travis.yml
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
braces:
|
braces:
|
||||||
@@ -3,16 +3,16 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
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).
|
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
|
||||||
|
|
||||||
## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/develop)
|
## [Unreleased](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/develop)
|
||||||
### Changed
|
### Changed
|
||||||
### Added
|
### Added
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
## [X.Y.Z](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/X.Y.Z)
|
## [X.Y.Z](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/X.Y.Z)
|
||||||
### [Full Changelog](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/compare/1.0.0...X.Y.Z)
|
### [Full Changelog](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/compare/1.0.0...X.Y.Z)
|
||||||
### Changed
|
### Changed
|
||||||
*[#<issue_number>](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/issues/<issue_number>) \<Change description\>* @\<author\>
|
*[#<issue_number>](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/issues/<issue_number>) \<Change description\>* @\<author\>
|
||||||
|
|
||||||
## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tree/1.0.0)
|
## [1.0.0](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tree/1.0.0)
|
||||||
- Initial release
|
- Initial release
|
||||||
@@ -1,20 +1,12 @@
|
|||||||
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
# {{ cookiecutter.app_name | replace('_',' ') | title }} Ansible role
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[](https://travis-ci.com/idealista/{{ cookiecutter.app_name }}_role)
|
|
||||||
[](https://galaxy.ansible.com/idealista/{{ cookiecutter.app_name }}_role)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
This ansible role installs [{{ cookiecutter.app_name | replace('_',' ') | title }}](APP_URL_HERE) in a Debian environment. It has been tested for the following Debian versions:
|
|
||||||
{% 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).
|
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).
|
||||||
|
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
- [Prerequisities](#prerequisities)
|
- [Prerequisities](#prerequisities)
|
||||||
- [Installing](#installing)
|
- [Installing](#installing)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Testing](#testing)
|
- [Testing](#testing)
|
||||||
- [Built With](#built-with)
|
- [Built With](#built-with)
|
||||||
@@ -24,6 +16,7 @@ This role has been generated using the [cookiecutter](https://github.com/cookiec
|
|||||||
- [Contributing](#contributing)
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
These instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install {{ cookiecutter.app_name | replace('_',' ') | title }} in a Debian system.
|
These instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install {{ cookiecutter.app_name | replace('_',' ') | title }} in a Debian system.
|
||||||
|
|
||||||
### Prerequisities
|
### Prerequisities
|
||||||
@@ -38,65 +31,63 @@ For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Docker]
|
|||||||
|
|
||||||
Create or add to your roles dependency file (e.g requirements.yml):
|
Create or add to your roles dependency file (e.g requirements.yml):
|
||||||
|
|
||||||
```
|
```yml
|
||||||
- src: idealista.{{ cookiecutter.app_name }}_role
|
- src: ansible-role-{{ cookiecutter.app_name }}
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
name: {{ cookiecutter.app_name }}_role
|
name: {{cookiecutter.namespace}}.{{ cookiecutter.app_name }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the role with ansible-galaxy command:
|
Install the role with ansible-galaxy command:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
ansible-galaxy install -p roles -r requirements.yml -f
|
ansible-galaxy install -p roles -r requirements.yml -f
|
||||||
```
|
```
|
||||||
|
|
||||||
Use in a playbook:
|
Use in a playbook:
|
||||||
|
|
||||||
```
|
```yml
|
||||||
---
|
---
|
||||||
- hosts: someserver
|
- hosts: someserver
|
||||||
roles:
|
roles:
|
||||||
- role: {{ cookiecutter.app_name }}_role
|
- role: {{cookiecutter.namespace}}.{{ cookiecutter.app_name }}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Look to the [defaults](defaults/main.yml) properties file to see the possible configuration properties, it is very likely that you will not need to override any variables.
|
Look to the [defaults](defaults/main.yml) properties file to see the possible configuration properties, it is very likely that you will not need to override any variables.
|
||||||
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
### Install dependencies
|
### Install dependencies
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ pipenv sync
|
pipenv sync
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information read the [pipenv docs](ipenv-fork.readthedocs.io/en/latest/).
|
For more information read the [pipenv docs](https://pipenv-fork.readthedocs.io/en/latest/).
|
||||||
|
|
||||||
### Testing
|
### Run test
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ pipenv run molecule test
|
pipenv run molecule test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Built With
|
## Built With
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/tags).
|
For the versions available, see the [tags on this repository](https://github.com/{{ cookiecutter.github_user }}/ansible-role-{{ cookiecutter.app_name }}/tags).
|
||||||
|
|
||||||
Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.
|
Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.
|
||||||
|
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
* **Idealista** - *Work with* - [idealista](https://github.com/idealista)
|
- **Idealista**
|
||||||
|
- **Laur IVAN**
|
||||||
See also the list of [contributors](https://github.com/{{ cookiecutter.github_user }}/{{ cookiecutter.app_name }}_role/contributors) who participated in this project.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
16
ansible-role-{{cookiecutter.app_name}}/defaults/main.yml
Normal file
16
ansible-role-{{cookiecutter.app_name}}/defaults/main.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
## General
|
||||||
|
# Version
|
||||||
|
{{ cookiecutter.app_name }}_version: 1.0.0
|
||||||
|
|
||||||
|
# {{ 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 }}_skeleton_paths:
|
||||||
|
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path {% raw %}}}{% endraw %}"
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
{{ cookiecutter.app_name }}_documentation_link: "{{ cookiecutter.documentation_URL }}"
|
||||||
|
|
||||||
|
|
||||||
2
ansible-role-{{cookiecutter.app_name}}/handlers/main.yml
Normal file
2
ansible-role-{{cookiecutter.app_name}}/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
# Handlers for {{ cookiecutter.app_name }}
|
||||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
26
ansible-role-{{cookiecutter.app_name}}/meta/main.yml
Normal file
26
ansible-role-{{cookiecutter.app_name}}/meta/main.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
galaxy_info:
|
||||||
|
author: {{ cookiecutter.author }}
|
||||||
|
namespace: {{ cookiecutter.namespace }}
|
||||||
|
{% 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 }}
|
||||||
|
license: {{ cookiecutter.license }}
|
||||||
|
galaxy_tags:
|
||||||
|
- {{ cookiecutter.galaxy_tag_1 }}
|
||||||
|
- {{ cookiecutter.galaxy_tag_2 }}
|
||||||
|
- {{ cookiecutter.galaxy_tag_3 }}
|
||||||
|
platforms:
|
||||||
|
{% if cookiecutter.platforms.debian_list %}
|
||||||
|
- name: Debian
|
||||||
|
versions: {% for ver in cookiecutter.platforms.debian_list %}
|
||||||
|
- {{ ver }}{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% if cookiecutter.platforms.ubuntu_list %}
|
||||||
|
- name: Ubuntu
|
||||||
|
versions: {% for ver in cookiecutter.platforms.ubuntu_list %}
|
||||||
|
- {{ ver }}{% endfor %}
|
||||||
|
{% endif %}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- name: Clean up
|
||||||
|
hosts: all
|
||||||
|
gather_facts: true
|
||||||
|
tasks:
|
||||||
|
- name: Check if the docker-compose file exists.
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/docker-compose.yml"
|
||||||
|
register: docker_compose_file
|
||||||
|
|
||||||
|
- name: Remove docker-compose.
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/"
|
||||||
|
build: false
|
||||||
|
state: absent
|
||||||
|
when: docker_compose_file.stat.exists
|
||||||
|
become: false
|
||||||
|
|
||||||
|
- name: Remove the docker-compose file
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {% raw %}}}{% endraw %}/docker-compose.yml"
|
||||||
|
state: absent
|
||||||
|
when: docker_compose_file.stat.exists
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: {{ cookiecutter.app_name }}_group
|
hosts: {{ cookiecutter.app_name }}_group
|
||||||
roles:
|
roles:
|
||||||
- role: {{ cookiecutter.app_name }}_role
|
- role: "{{cookiecutter.namespace}}.{{ cookiecutter.app_name }}"
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
- name: Destroy
|
||||||
|
hosts: localhost
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
|
no_log: "{% raw %}{{ molecule_no_log }}{% endraw %}"
|
||||||
|
tasks:
|
||||||
|
# Developer must implement.
|
||||||
|
- name: Remove the docker image
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: {{ cookiecutter.app_name }}
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
# Mandatory configuration for Molecule to function.
|
||||||
|
|
||||||
|
- name: Populate instance config
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
instance_conf: {}
|
||||||
|
|
||||||
|
- name: Dump instance config
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: |
|
||||||
|
# Molecule managed
|
||||||
|
{% raw %}{{ instance_conf | to_json | from_json | to_yaml }}{% endraw %}
|
||||||
|
dest: "{% raw %}{{ molecule_instance_config }}{% endraw %}"
|
||||||
|
mode: 0600
|
||||||
|
when: server.changed | default(false) | bool
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
---
|
---
|
||||||
dependency:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
|
options:
|
||||||
|
ignore-certs: true
|
||||||
|
ignore-errors: true
|
||||||
|
role-file: molecule/requirements.yml
|
||||||
|
requirements-file: molecule/requirements.yml
|
||||||
driver:
|
driver:
|
||||||
name: docker
|
name: docker
|
||||||
lint: |
|
lint: |
|
||||||
@@ -10,8 +15,9 @@ platforms:
|
|||||||
- name: {{ cookiecutter.app_name }}
|
- name: {{ cookiecutter.app_name }}
|
||||||
groups:
|
groups:
|
||||||
- {{ cookiecutter.app_name }}_group
|
- {{ cookiecutter.app_name }}_group
|
||||||
image: ${MOLECULE_DISTRO:-debian:buster-slim}
|
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos8}-ansible:latest"
|
||||||
privileged: false
|
privileged: true
|
||||||
|
pre_build_image: true
|
||||||
capabilities:
|
capabilities:
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
tmpfs:
|
tmpfs:
|
||||||
@@ -20,9 +26,13 @@ platforms:
|
|||||||
- /run/lock
|
- /run/lock
|
||||||
volumes:
|
volumes:
|
||||||
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
|
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
|
||||||
|
- '/var/run/docker.sock:/tmp/docker_mounted.sock'
|
||||||
command: '/lib/systemd/systemd'
|
command: '/lib/systemd/systemd'
|
||||||
stop_signal: 'RTMIN+3'
|
stop_signal: 'RTMIN+3'
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
playbooks:
|
||||||
|
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
||||||
verifier:
|
verifier:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
- name: Setup the test machine
|
||||||
|
hosts: {{ cookiecutter.app_name }}
|
||||||
|
tasks:
|
||||||
|
- name: Check if /var/run/docker.sock already exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "/var/run/docker.sock"
|
||||||
|
register: docker_sock_stat
|
||||||
|
|
||||||
|
- name: Create docker.sock
|
||||||
|
ansible.builtin.raw: touch /var/run/docker.sock
|
||||||
|
become: true
|
||||||
|
changed_when: false
|
||||||
|
when: not docker_sock_stat.stat.exists
|
||||||
|
|
||||||
|
- name: Move docker.sock from tmp
|
||||||
|
ansible.builtin.raw: >
|
||||||
|
mount --move /tmp/docker_mounted.sock /var/run/docker.sock
|
||||||
|
become: true
|
||||||
|
changed_when: false
|
||||||
|
when: not docker_sock_stat.stat.exists
|
||||||
|
|
||||||
|
- name: Update apt cache.
|
||||||
|
ansible.builtin.apt: update_cache=yes cache_valid_time=600
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
|
||||||
|
- name: Install python requests
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name:
|
||||||
|
- requests
|
||||||
|
- docker
|
||||||
|
- docker-compose
|
||||||
|
|
||||||
|
- name: Install docker
|
||||||
|
vars:
|
||||||
|
docker_service_manage: false
|
||||||
|
ansible.builtin.include_role:
|
||||||
|
name: geerlingguy.docker
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
roles:
|
||||||
|
- geerlingguy.docker
|
||||||
|
collections: []
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
## TODO: Remember to adapt goss tests to your convenience
|
||||||
|
|
||||||
|
|
||||||
|
## Check if ports are really exposed
|
||||||
|
# port:
|
||||||
|
# # Check port at IPv6
|
||||||
|
# # https://github.com/aelsabbahy/goss/issues/177
|
||||||
|
# tcp6:<port>:
|
||||||
|
# listening: true
|
||||||
|
# ip:
|
||||||
|
# - '::'
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
- {{ cookiecutter.app_name }}
|
- {{ cookiecutter.app_name }}
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
goss_version: v0.3.14
|
goss_version: v0.3.16
|
||||||
goss_arch: amd64
|
goss_arch: amd64
|
||||||
goss_dst: /usr/local/bin/goss
|
goss_dst: /usr/local/bin/goss
|
||||||
goss_sha256sum: 26c481073d346028451d56af600a71ec2d6c7bc960c3e207f610e32c5e1f5144
|
goss_sha256sum: 827e354b48f93bce933f5efcd1f00dc82569c42a179cf2d384b040d8a80bfbfb
|
||||||
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{% raw %}{{{% endraw %} goss_version {% raw %}}}{% endraw %}/goss-linux-{% raw %}{{{% endraw %} goss_arch {% raw %}}}{% endraw %}"
|
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{% raw %}{{{% endraw %} goss_version {% raw %}}}{% endraw %}/goss-linux-{% raw %}{{{% endraw %} goss_arch {% raw %}}}{% endraw %}"
|
||||||
goss_test_directory: /tmp
|
goss_test_directory: /tmp
|
||||||
goss_format: documentation
|
goss_format: documentation
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
get_url:
|
get_url:
|
||||||
url: "{% raw %}{{{% endraw %} goss_url {% raw %}}}{% endraw %}"
|
url: "{% raw %}{{{% endraw %} goss_url {% raw %}}}{% endraw %}"
|
||||||
dest: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %}"
|
dest: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %}"
|
||||||
sha256sum: "{% raw %}{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
checksum: "sha256{% raw %}:{{{% endraw %} goss_sha256sum {% raw %}}}{% endraw %}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
register: download_goss
|
register: download_goss
|
||||||
until: download_goss is succeeded
|
until: download_goss is succeeded
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
command: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %} -g {% raw %}{{{% endraw %} item {% raw %}}}{% endraw %} validate --format {% raw %}{{{% endraw %} goss_format {% raw %}}}{% endraw %}"
|
command: "{% raw %}{{{% endraw %} goss_dst {% raw %}}}{% endraw %} -g {% raw %}{{{% endraw %} item {% raw %}}}{% endraw %} validate --format {% raw %}{{{% endraw %} goss_format {% raw %}}}{% endraw %}"
|
||||||
register: test_results
|
register: test_results
|
||||||
with_items: "{% raw %}{{{% endraw %} test_files.stdout_lines {% raw %}}}{% endraw %}"
|
with_items: "{% raw %}{{{% endraw %} test_files.stdout_lines {% raw %}}}{% endraw %}"
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Display details about the Goss results
|
- name: Display details about the Goss results
|
||||||
debug:
|
debug:
|
||||||
23
ansible-role-{{cookiecutter.app_name}}/tasks/config.yml
Normal file
23
ansible-role-{{cookiecutter.app_name}}/tasks/config.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
- name: "{{ cookiecutter.app_name | upper }} | Set up directories"
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: directory
|
||||||
|
path: "{%raw%}{{{%endraw%} item }}"
|
||||||
|
owner: "{%raw%}{{{%endraw%} ansible_effective_user_id {%raw%}}}{%endraw%}"
|
||||||
|
group: "{%raw%}{{{%endraw%} ansible_effective_group_id {%raw%}}}{%endraw%}"
|
||||||
|
mode: "0750"
|
||||||
|
with_items:
|
||||||
|
- "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_skeleton_paths {%raw%}}}{%endraw%}"
|
||||||
|
tags:
|
||||||
|
- {{ cookiecutter.app_name }}_configure
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: "{{ cookiecutter.app_name | upper }} | Write configuration files"
|
||||||
|
ansible.builtin.template:
|
||||||
|
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"
|
||||||
|
tags:
|
||||||
|
- {{ cookiecutter.app_name }}_configure
|
||||||
7
ansible-role-{{cookiecutter.app_name}}/tasks/install.yml
Normal file
7
ansible-role-{{cookiecutter.app_name}}/tasks/install.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: "{{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} is running"
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {%raw%}}}{%endraw%}"
|
||||||
|
build: false
|
||||||
|
tags:
|
||||||
|
- {{ cookiecutter.app_name }}_install
|
||||||
12
ansible-role-{{cookiecutter.app_name}}/tasks/main.yml
Normal file
12
ansible-role-{{cookiecutter.app_name}}/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: "{{ cookiecutter.app_name | upper }} | Configure"
|
||||||
|
import_tasks: config.yml
|
||||||
|
tags:
|
||||||
|
- {{ cookiecutter.app_name }}_configure
|
||||||
|
|
||||||
|
- name:" {{ cookiecutter.app_name | upper }} | Install"
|
||||||
|
import_tasks: install.yml
|
||||||
|
tags:
|
||||||
|
- {{ cookiecutter.app_name }}_install
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# {{ cookiecutter.app_name }} docker compose
|
||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
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 }}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
*.yml linguist-detectable=true
|
||||||
|
*.yaml linguist-detectable=true
|
||||||
|
*.html linguist-detectable=false
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
dist: xenial
|
||||||
|
language: python
|
||||||
|
python: "3.9"
|
||||||
|
os: linux
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
install:
|
||||||
|
- pip install -I pipenv
|
||||||
|
- pipenv sync
|
||||||
|
env:
|
||||||
|
jobs:
|
||||||
|
{% if "buster" in cookiecutter.platforms.debian_list %}- MOLECULE_DISTRO=debian:buster-slim{% endif %}
|
||||||
|
{% if "bullseye" in cookiecutter.platforms.debian_list %}- MOLECULE_DISTRO=debian:bullseye-slim{% endif %}
|
||||||
|
script:
|
||||||
|
- pipenv run molecule test --all
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||||
|
email:
|
||||||
|
if: branch = main
|
||||||
|
on_success: change
|
||||||
|
on_failure: always
|
||||||
|
recipients:
|
||||||
|
- laur.ivan@gmail.com
|
||||||
@@ -2,24 +2,29 @@
|
|||||||
"comment_0":"The role name will be the value you assign to app_name with _role appended",
|
"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",
|
"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": "",
|
"app_name": "",
|
||||||
"exec_name":"",
|
"github_user": "equinoxel",
|
||||||
"github_user": "idealista",
|
"patreon_user": "laurivan",
|
||||||
"company": "Idealista S.A.U.",
|
"company": "",
|
||||||
"author": "",
|
"author": "Laur Ivan (laur.ivan@gmail.com)",
|
||||||
"min_ansible_version": "",
|
"namespace": "laurivan",
|
||||||
"ansible_version": "",
|
"min_ansible_version": "2.4",
|
||||||
"molecule_version": "",
|
"min_ansible_container_version": "2.4",
|
||||||
"python_docker_version": "",
|
"ansible_version": "5.2.0",
|
||||||
"ansible_lint_version":"",
|
"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",
|
||||||
"license":"Apache 2.0",
|
"license":"Apache 2.0",
|
||||||
"galaxy_tag_1":"example_tag1",
|
"galaxy_tag_1":"tag1",
|
||||||
"galaxy_tag_2":"example_tag2",
|
"galaxy_tag_2":"tag2",
|
||||||
"galaxy_tag_3":"example_tag3",
|
"galaxy_tag_3":"tag3",
|
||||||
"debian_stretch_support":["True", "False"],
|
"platforms": {
|
||||||
"debian_buster_support":["True", "False"],
|
"debian_list": ["bullseye", "buster"],
|
||||||
"has_service":["True", "False"],
|
"ubuntu_list": ["bionic", "focal", "jammy"]
|
||||||
|
},
|
||||||
"has_files":["True", "False"],
|
"has_files":["True", "False"],
|
||||||
"comment_2":"If there is service the following options will not have any effect",
|
|
||||||
"has_handlers":["True", "False"],
|
"has_handlers":["True", "False"],
|
||||||
"has_templates":["True", "False"]
|
"has_templates":["True", "False"],
|
||||||
|
"documentation_URL":""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,17 +18,15 @@ def checkInput():
|
|||||||
|
|
||||||
def configureRole():
|
def configureRole():
|
||||||
# Remove or not the service
|
# Remove or not the service
|
||||||
if not {{ cookiecutter.has_service }}:
|
|
||||||
# Delete the service and things that reference the service
|
shutil.rmtree("molecule/default/group_vars")
|
||||||
os.remove("tasks/service.yml")
|
# Remove or not the handlers folder
|
||||||
os.remove("templates/{{ cookiecutter.app_name }}.service.j2")
|
if not {{ cookiecutter.has_handlers }}:
|
||||||
shutil.rmtree("molecule/default/group_vars")
|
shutil.rmtree("handlers")
|
||||||
# Remove or not the handlers folder
|
# Remove or not the templates folder
|
||||||
if not {{ cookiecutter.has_handlers }}:
|
if not {{ cookiecutter.has_templates }}:
|
||||||
shutil.rmtree("handlers")
|
shutil.rmtree("templates")
|
||||||
# Remove or not the templates folder
|
|
||||||
if not {{ cookiecutter.has_templates }}:
|
|
||||||
shutil.rmtree("templates")
|
|
||||||
# Remove or not the files folder
|
# Remove or not the files folder
|
||||||
if not {{ cookiecutter.has_files }}:
|
if not {{ cookiecutter.has_files }}:
|
||||||
shutil.rmtree("files")
|
shutil.rmtree("files")
|
||||||
|
|||||||
19
test.sh
19
test.sh
@@ -3,7 +3,22 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Generate role
|
# Generate role
|
||||||
printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input app_name="github_cli" exec_name="gh" author="John Doe" min_ansible_version="2.2" ansible_version="2.8.6" molecule_version="3.0.1" python_docker_version="4.1.0" ansible_lint_version="4.2.0" has_service="False" has_files="False" has_handlers="False" has_templates="False" && rm Pipfile* requirements.txt
|
printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv install -r requirements.txt && pipenv run cookiecutter . --no-input \
|
||||||
|
app_name="github_cli" \
|
||||||
|
exec_name="gh" \
|
||||||
|
author="John Doe" \
|
||||||
|
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" \
|
||||||
|
has_files="False" \
|
||||||
|
has_handlers="False" \
|
||||||
|
has_templates="False" \
|
||||||
|
documentation_URL="https://cli.github.com/manual/" && rm Pipfile* requirements.txt && rm -rf requirements.txt
|
||||||
|
|
||||||
(
|
(
|
||||||
# Adjust the role to test
|
# Adjust the role to test
|
||||||
cd github_cli_role
|
cd github_cli_role
|
||||||
@@ -14,7 +29,7 @@ printf "cookiecutter==1.7.2\nJinja2==2.11.2" > requirements.txt && pipenv instal
|
|||||||
# Launch molecule tests
|
# Launch molecule tests
|
||||||
pipenv install -r test-requirements.txt --three
|
pipenv install -r test-requirements.txt --three
|
||||||
pipenv run molecule test
|
pipenv run molecule test
|
||||||
|
|
||||||
)
|
)
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -rf github_cli_role
|
rm -rf github_cli_role
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
## General
|
|
||||||
# Version
|
|
||||||
{{ cookiecutter.app_name }}_version: 1.0.0
|
|
||||||
{{ cookiecutter.app_name }}_release_system: linux_amd64
|
|
||||||
|
|
||||||
# Package URL
|
|
||||||
{{ cookiecutter.app_name }}_release_name: "exampleapplication_{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_version {% raw %}}}{% endraw %}_{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_system {% raw %}}}{% endraw %}"
|
|
||||||
{{ cookiecutter.app_name }}_package: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_name {% raw %}}}{% endraw %}.tar.gz"
|
|
||||||
{{ cookiecutter.app_name }}_url: "https://github.com/someuser/somerepo/releases/download/v{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_version {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package {% raw %}}}{% endraw %}"
|
|
||||||
|
|
||||||
# Package paths
|
|
||||||
{{ cookiecutter.app_name }}_download_path: /usr/src
|
|
||||||
{{ cookiecutter.app_name }}_package_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package {% raw %}}}{% endraw %}"
|
|
||||||
{{ cookiecutter.app_name }}_src_bin: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_release_name {% raw %}}}{% endraw %}/bin/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
|
||||||
|
|
||||||
# Set true to force the download and installation of the binary
|
|
||||||
{{ cookiecutter.app_name }}_force_reinstall: false
|
|
||||||
|
|
||||||
# Installation path
|
|
||||||
{{ cookiecutter.app_name }}_root_path: /opt/{{ cookiecutter.app_name }}
|
|
||||||
{{ cookiecutter.app_name }}_bin_path: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_root_path {% raw %}}}{% endraw %}/bin"
|
|
||||||
{{ cookiecutter.app_name }}_skeleton_paths:
|
|
||||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}"
|
|
||||||
{{ cookiecutter.app_name }}_exec_name: {{ cookiecutter.exec_name }}
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
## Service options
|
|
||||||
# Documentation
|
|
||||||
{{ cookiecutter.app_name }}_documentation_link: https://www.example.documentation.com
|
|
||||||
|
|
||||||
# Owner
|
|
||||||
{{ cookiecutter.app_name }}_user: exampleuser
|
|
||||||
{{ cookiecutter.app_name }}_group: examplegroup
|
|
||||||
|
|
||||||
# Maximum number of files limit
|
|
||||||
{{ cookiecutter.app_name }}_max_files: 32768
|
|
||||||
|
|
||||||
# Start on boot
|
|
||||||
{{ cookiecutter.app_name }}_service_enabled: True
|
|
||||||
# Current state: started, stopped
|
|
||||||
{{ cookiecutter.app_name }}_service_state: started
|
|
||||||
|
|
||||||
# Logs
|
|
||||||
# If wanted to output the logs to a file define the following variable
|
|
||||||
# More information at https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=
|
|
||||||
# {{ cookiecutter.app_name }}_log_file: path_of_the_file
|
|
||||||
{{ cookiecutter.app_name }}_log_output: "{% raw %}{%{% endraw %} if {{ cookiecutter.app_name }}_log_file is defined {% raw %}%}{% endraw %} file:{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_file {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} else {% raw %}%}{% endraw %} journal {% raw %}{%{% endraw %} endif {% raw %}%}{% endraw %}"
|
|
||||||
|
|
||||||
# Flags
|
|
||||||
{{ cookiecutter.app_name }}_port: # the port exposed by the service goes here
|
|
||||||
{{ cookiecutter.app_name }}_flag1_value: example_value_1
|
|
||||||
{{ cookiecutter.app_name }}_flag2_value: example_value_2
|
|
||||||
{{ cookiecutter.app_name }}_options:
|
|
||||||
- "port {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_port {% raw %}}}{% endraw %}"
|
|
||||||
- "flag1 {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_flag1_value {% raw %}}}{% endraw %}"
|
|
||||||
- "flag2 {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_flag2_value {% raw %}}}{% endraw %}"
|
|
||||||
|
|
||||||
{{ cookiecutter.app_name }}_private_tmp: true
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
- name: restart {{ cookiecutter.app_name }}
|
|
||||||
systemd:
|
|
||||||
name: {{ cookiecutter.app_name }}
|
|
||||||
state: restarted
|
|
||||||
when: {{ cookiecutter.app_name }}_service_state != 'stopped'
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
galaxy_info:
|
|
||||||
author: {{ cookiecutter.author }}
|
|
||||||
company: {{ cookiecutter.company }}
|
|
||||||
description: {{ cookiecutter.app_name | replace('_',' ') | title }} Role
|
|
||||||
min_ansible_version: {{ cookiecutter.min_ansible_version }}
|
|
||||||
license: {{ cookiecutter.license }}
|
|
||||||
galaxy-tags:
|
|
||||||
- {{ cookiecutter.galaxy_tag_1 }}
|
|
||||||
- {{ cookiecutter.galaxy_tag_2 }}
|
|
||||||
- {{ cookiecutter.galaxy_tag_3 }}
|
|
||||||
platforms:
|
|
||||||
- name: Debian
|
|
||||||
versions:
|
|
||||||
{% if cookiecutter.debian_stretch_support == 'True' %}- stretch{% endif %}
|
|
||||||
{% if cookiecutter.debian_buster_support == 'True' %}- buster{% endif %}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Molecule managed
|
|
||||||
|
|
||||||
{% raw %}{% if item.registry is defined %}
|
|
||||||
FROM {{ item.registry.url }}/{{ item.image }}
|
|
||||||
{% else %}
|
|
||||||
FROM {{ item.image }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# install minimal packages for debian slim images
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
|
|
||||||
apt-get clean{% endraw %}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
file:
|
|
||||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}:
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
owner: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}
|
|
||||||
group: {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
|
||||||
{% endif %}
|
|
||||||
exists: true
|
|
||||||
filetype: directory
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
# port:
|
|
||||||
# # Check port at IPv6
|
|
||||||
# # https://github.com/aelsabbahy/goss/issues/177
|
|
||||||
# tcp6:{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_port {% raw %}}}{% endraw %}:
|
|
||||||
# listening: true
|
|
||||||
# ip:
|
|
||||||
# - '::'
|
|
||||||
|
|
||||||
service:
|
|
||||||
{{ cookiecutter.app_name }}:
|
|
||||||
enabled: true
|
|
||||||
running: true
|
|
||||||
process:
|
|
||||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}:
|
|
||||||
running: true
|
|
||||||
user:
|
|
||||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}:
|
|
||||||
exists: true
|
|
||||||
groups:
|
|
||||||
- {% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
|
||||||
shell: /usr/sbin/nologin
|
|
||||||
group:
|
|
||||||
{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}:
|
|
||||||
exists: true
|
|
||||||
{% endif %}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
---
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} group
|
|
||||||
group:
|
|
||||||
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
|
||||||
system: yes
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure {{ cookiecutter.app_name }} user
|
|
||||||
user:
|
|
||||||
name: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
|
||||||
system: yes
|
|
||||||
shell: /usr/sbin/nologin
|
|
||||||
createhome: no
|
|
||||||
{% endif %}
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton paths
|
|
||||||
file:
|
|
||||||
dest: "{% raw %}{{{% endraw %} item {% raw %}}}{% endraw %}"
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
|
||||||
{% endif %}
|
|
||||||
state: directory
|
|
||||||
with_items:
|
|
||||||
- "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_skeleton_paths {% raw %}}}{% endraw %}"
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Ensure skeleton log paths
|
|
||||||
file:
|
|
||||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_path {% raw %}}}{% endraw %}"
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
|
||||||
{% endif %}
|
|
||||||
state: file
|
|
||||||
when: {{ cookiecutter.app_name }}_log_file is defined
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Check {{ cookiecutter.app_name }} version
|
|
||||||
command: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} --version"
|
|
||||||
register: {{ cookiecutter.app_name }}_check
|
|
||||||
changed_when: false
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Download package
|
|
||||||
get_url:
|
|
||||||
url: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_url {% raw %}}}{% endraw %}"
|
|
||||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package_path {% raw %}}}{% endraw %}"
|
|
||||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Extract downloaded package
|
|
||||||
unarchive:
|
|
||||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_package_path {% raw %}}}{% endraw %}"
|
|
||||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_download_path {% raw %}}}{% endraw %}"
|
|
||||||
remote_src: True
|
|
||||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Copy binary
|
|
||||||
copy:
|
|
||||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_src_bin {% raw %}}}{% endraw %}"
|
|
||||||
dest: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
owner: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}"
|
|
||||||
group: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}"
|
|
||||||
{% endif %}
|
|
||||||
remote_src: True
|
|
||||||
mode: 0755
|
|
||||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Link binary
|
|
||||||
file:
|
|
||||||
src: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
|
||||||
dest: "/usr/bin/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %}"
|
|
||||||
state: link
|
|
||||||
when: {{ cookiecutter.app_name }}_force_reinstall or {{ cookiecutter.app_name }}_check is failed or {{ cookiecutter.app_name }}_version not in {{ cookiecutter.app_name }}_check.stderr
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Install
|
|
||||||
include: install.yml
|
|
||||||
tags:
|
|
||||||
- {{ cookiecutter.app_name }}_install
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Configure
|
|
||||||
include: config.yml
|
|
||||||
tags:
|
|
||||||
- {{ cookiecutter.app_name }}_configure
|
|
||||||
{% if cookiecutter.has_service == 'True' %}
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Service
|
|
||||||
include: service.yml
|
|
||||||
tags:
|
|
||||||
- {{ cookiecutter.app_name }}_service
|
|
||||||
{% endif %}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Copy Daemon script
|
|
||||||
template:
|
|
||||||
src: {{ cookiecutter.app_name }}.service.j2
|
|
||||||
dest: /etc/systemd/system/{{ cookiecutter.app_name }}.service
|
|
||||||
mode: 0644
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
notify: restart {{ cookiecutter.app_name }}
|
|
||||||
|
|
||||||
- name: {{ cookiecutter.app_name | upper }} | Configuring service
|
|
||||||
systemd:
|
|
||||||
name: {{ cookiecutter.app_name }}
|
|
||||||
state: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_state {% raw %}}}{% endraw %}"
|
|
||||||
enabled: "{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_service_enabled {% raw %}}}{% endraw %}"
|
|
||||||
daemon_reload: yes
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{% raw %}{{ ansible_managed | comment }}{% endraw %}
|
|
||||||
[Unit]
|
|
||||||
Description={{ cookiecutter.app_name | replace('_',' ') }}
|
|
||||||
Documentation={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_documentation_link {% raw %}}}{% endraw %}
|
|
||||||
Requires=network-online.target
|
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
PrivateTmp={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_private_tmp {% raw %}}}{% endraw %}
|
|
||||||
User={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_user {% raw %}}}{% endraw %}
|
|
||||||
Group={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_group {% raw %}}}{% endraw %}
|
|
||||||
RuntimeDirectory={{ cookiecutter.app_name }}
|
|
||||||
LimitNOFILE={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_max_files {% raw %}}}{% endraw %}
|
|
||||||
|
|
||||||
ExecStart={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_bin_path {% raw %}}}{% endraw %}/{% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_exec_name {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} for option in {{ cookiecutter.app_name }}_options {% raw %}%}{% endraw %}{% raw %}{%{% endraw %} if option {% raw %}%}{% endraw %}-{% raw %}{{{% endraw %} option {% raw %}}}{% endraw %} {% raw %}{%{% endraw %} endif {% raw %}%}{% endraw %}{% raw %}{%{% endraw %} endfor {% raw %}%}{% endraw %}
|
|
||||||
|
|
||||||
StandardOutput={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_output {% raw %}}}{% endraw %}
|
|
||||||
StandardError={% raw %}{{{% endraw %} {{ cookiecutter.app_name }}_log_output {% raw %}}}{% endraw %}
|
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
|
||||||
KillSignal=SIGTERM
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
ansible=={{ cookiecutter.ansible_version }}
|
|
||||||
molecule=={{ cookiecutter.molecule_version }}
|
|
||||||
docker=={{ cookiecutter.python_docker_version }}
|
|
||||||
ansible-lint=={{ cookiecutter.ansible_lint_version }}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
dist: xenial
|
|
||||||
language: python
|
|
||||||
python: "3.7"
|
|
||||||
os: linux
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
install:
|
|
||||||
- pip install pipenv
|
|
||||||
- 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 %}
|
|
||||||
script:
|
|
||||||
- pipenv run molecule test
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
||||||
Reference in New Issue
Block a user