-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Savin <jtprogru@gmail.com>
- Loading branch information
Showing
10 changed files
with
197 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
exclude_paths: | ||
- ./molecule/ | ||
- ./.github/ | ||
# - ./last/excluded/directory/ | ||
parseable: true | ||
quiet: true | ||
# rulesdir: | ||
# - ./rule/directory/ | ||
skip_list: | ||
- '401' | ||
- '204' | ||
- '403' | ||
- '702' | ||
- '305' | ||
# tags: | ||
# - run_this_tag | ||
use_default_rules: true | ||
verbosity: 1 |
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,6 @@ | ||
# These are supported funding model platforms | ||
--- | ||
github: jtprogru | ||
patreon: jtprog | ||
custom: [ "https://sobe.ru/na/jtprogru" ] | ||
|
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,75 @@ | ||
--- | ||
name: CI | ||
'on': | ||
pull_request: | ||
push: | ||
branches: | ||
- develop | ||
|
||
defaults: | ||
run: | ||
working-directory: 'jtprogru.sample_role' | ||
|
||
jobs: | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'jtprogru.sample_role' | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Upgrade pip3. | ||
run: pip3 install --upgrade pip | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install yamllint ansible-lint ansible | ||
|
||
- name: Lint code with yamllint. | ||
run: yamllint . | ||
|
||
- name: Lint code with ansible-lint. | ||
run: ansible-lint | ||
|
||
molecule: | ||
name: Molecule | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
distro: | ||
- ubuntu2004 | ||
- ubuntu1804 | ||
- debian10 | ||
- debian9 | ||
- centos7 | ||
|
||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'jtprogru.sample_role' | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Upgrade pip3. | ||
run: pip3 install --upgrade pip | ||
|
||
- name: Install test dependencies. | ||
run: pip3 install ansible molecule[docker] docker | ||
|
||
- name: Run Molecule tests. | ||
run: molecule --debug test | ||
env: | ||
PY_COLORS: '1' | ||
ANSIBLE_FORCE_COLOR: '1' | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
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,32 @@ | ||
--- | ||
name: Release | ||
'on': | ||
push: | ||
tags: | ||
- '*' | ||
|
||
defaults: | ||
run: | ||
working-directory: 'jtprogru.sample_role' | ||
|
||
jobs: | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'jtprogru.sample_role' | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Ansible. | ||
run: pip3 install ansible | ||
|
||
- name: Trigger a new import on Galaxy. | ||
run: ansible-galaxy role import --api-key ${{ secrets.ANSIBLE_GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) |
This file was deleted.
Oops, something went wrong.
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,38 +1,38 @@ | ||
Role Name | ||
========= | ||
# jtprogru.sample_role | ||
|
||
A brief description of the role goes here. | ||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jtprogru/sample-role/CI?label=CI) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jtprogru/sample-role/Release?label=Release) ![GitHub](https://img.shields.io/github/license/jtprogru/sample-role) [![Ansible Role](https://img.shields.io/ansible/role/54364)](https://galaxy.ansible.com/jtprogru/sample-role/) | ||
|
||
Requirements | ||
------------ | ||
This is sample ansible role used me as boilerplate. | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
|
||
Role Variables | ||
-------------- | ||
## Role Variables | ||
|
||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
|
||
Dependencies | ||
------------ | ||
See [`defaults/main.yml`](defaults/main.yml). | ||
|
||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
|
||
Example Playbook | ||
---------------- | ||
## Example Playbook | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
Example playbook: | ||
```yaml | ||
--- | ||
- name: Sample play | ||
hosts: all | ||
become: true | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
vars: | ||
foo: bar | ||
|
||
License | ||
------- | ||
roles: | ||
- jtprogru.sample_role | ||
``` | ||
BSD | ||
## Author | ||
Author Information | ||
------------------ | ||
Michael Savin aka `@jtprogru` | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). | ||
Twitter: [![Twitter Follow](https://img.shields.io/twitter/follow/jtprogru?color=gree&style=plastic)](https://twitter.com/jtprogru/) | ||
|
||
## License | ||
|
||
See [LICENSE](LICENSE.md) |
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,7 +1,26 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
debugger: always | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
apt: update_cache=yes cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Wait for systemd to complete initialization. # noqa 303 | ||
command: systemctl is-system-running | ||
register: systemctl_status | ||
until: > | ||
'running' in systemctl_status.stdout or | ||
'degraded' in systemctl_status.stdout | ||
retries: 30 | ||
delay: 5 | ||
when: ansible_service_mgr == 'systemd' | ||
changed_when: false | ||
failed_when: systemctl_status.rc > 1 | ||
|
||
tasks: | ||
- name: "Include sample-role" | ||
- name: "Include sample_role" | ||
include_role: | ||
name: "sample-role" | ||
name: "sample_role" |
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,4 +2,4 @@ | |
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- sample-role | ||
- sample_role |