forked from GSA/ansible-os-win-2019
-
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.
- Loading branch information
0 parents
commit 284ddc5
Showing
20 changed files
with
327 additions
and
0 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,20 @@ | ||
parseable: true | ||
quiet: false | ||
use_default_rules: true | ||
skip_list: | ||
- ANSIBLE0004 | ||
- ANSIBLE0005 | ||
- ANSIBLE0006 | ||
- ANSIBLE0007 | ||
- ANSIBLE0008 | ||
- ANSIBLE0009 | ||
- ANSIBLE0010 | ||
- ANSIBLE0011 | ||
- ANSIBLE0012 | ||
- ANSIBLE0013 | ||
- ANSIBLE0014 | ||
- ANSIBLE0015 | ||
- ANSIBLE0016 | ||
- ANSIBLE0017 | ||
- ANSIBLE0018 | ||
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,40 @@ | ||
version: 2 | ||
jobs: | ||
ansible_lint: | ||
docker: | ||
- image: circleci/python:latest | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install ansible-lint | ||
command: pip install ansible ansible-lint yamllint --progress-bar off | ||
- run: | ||
name: Show ansible version | ||
command: ansible --version | ||
- run: | ||
name: Create symlink for role | ||
command: > | ||
mkdir -p ~/.ansible/roles | ||
ln -s $(pwd) ~/.ansible/roles/${CIRCLE_PROJECT_REPONAME##*-} | ||
- run: | ||
name: Syntax check playbook | ||
command: pwd; ls; ansible-playbook --syntax-check tests/test.yml | ||
- run: | ||
name: Show ansible-lint version | ||
command: ansible-lint --version | ||
- run: | ||
name: Execute ansible-lint | ||
command: > | ||
find . -type f -name '*.yml' | xargs ansible-lint -c .ansible-lint-rules | ||
- run: | ||
name: Show yamllint version | ||
command: yamllint --version | ||
- run: | ||
name: Run yamllint | ||
command: yamllint -s . | ||
|
||
workflows: | ||
version: 2 | ||
lint_and_test: | ||
jobs: | ||
- ansible_lint |
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,13 @@ | ||
name: 'GSA/[ROLE_NAME]' | ||
description: '[ROLE_DESCRIPTION]' | ||
license: cc0-1.0 | ||
openSourceProject: 1 | ||
governmentWideReuseProject: 1 | ||
tags: | ||
- open-source | ||
- opensource | ||
- grace | ||
- devsecops | ||
- ansible | ||
contact: | ||
email: [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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# GITLEAKS_PRECOMMIT_HOOK BEGIN | ||
precommit_latest_url=$(curl --silent --location --head --output /dev/null --write-out '%{url_effective}' -- https://github.com/GSA/odp-code-repository-commit-rules/releases/latest) | ||
precommit_version=${precommit_latest_url##*/} | ||
precommit_url="https://raw.githubusercontent.com/GSA/odp-code-repository-commit-rules/${precommit_version}/gitleaks/precommit.sh" | ||
precommit_path="$(git rev-parse --show-toplevel)/.git/hooks/precommit.sh" | ||
|
||
curl --silent -o "${precommit_path}" "${precommit_url}" | ||
os=$(uname -s | cut -d'_' -f 1) | ||
if [ "$os" = "Linux" ] || [ "$os" = "Darwin" ]; then | ||
chmod +x "${precommit_path}" | ||
fi | ||
|
||
"${precommit_path}" "${precommit_version}" | ||
# GITLEAKS_PRECOMMIT_HOOK END |
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,24 @@ | ||
## Ansible roles ## | ||
__pycache__/ | ||
.molecule/ | ||
.pytest_cache/ | ||
*-console.log | ||
|
||
# Mac attributes | ||
.DS_Store | ||
*/.DS_Store | ||
|
||
# IntelliJ’s project specific settings files/directory (Goland) | ||
.idea | ||
.idea/ | ||
*.iml | ||
|
||
# vi/vim/GVim/MacVim backup files | ||
*.swp | ||
|
||
# VS Code | ||
/.vscode | ||
|
||
# Executables and insallers | ||
*.exe | ||
*.msi |
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 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
|
||
# Use the new container infrastructure | ||
sudo: false | ||
|
||
# Install ansible | ||
addons: | ||
apt: | ||
packages: | ||
- python-pip | ||
|
||
install: | ||
# Install ansible | ||
- pip install ansible | ||
|
||
# Check ansible version | ||
- ansible --version | ||
|
||
# Create ansible.cfg with correct roles_path | ||
- printf '[defaults]\nroles_path=../' >ansible.cfg | ||
|
||
script: | ||
# Basic role syntax check | ||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
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,21 @@ | ||
--- | ||
# Based on ansible-lint config | ||
extends: default | ||
|
||
rules: | ||
braces: {max-spaces-inside: 1, level: error} | ||
brackets: {max-spaces-inside: 1, level: error} | ||
colons: {max-spaces-after: -1, level: error} | ||
commas: {max-spaces-after: -1, level: error} | ||
comments: disable | ||
comments-indentation: disable | ||
document-start: disable | ||
empty-lines: {max: 3, level: error} | ||
hyphens: {level: error} | ||
indentation: disable | ||
key-duplicates: enable | ||
line-length: disable | ||
new-line-at-end-of-file: disable | ||
new-lines: {type: unix} | ||
trailing-spaces: disable | ||
truthy: disable |
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,35 @@ | ||
## How to contribute | ||
|
||
> All contributions to this project will be released under the CC0 | ||
> dedication. By submitting a pull request, or filing a bug, issue, or | ||
> feature-request you are agreeing to comply with this waiver of copyright interest. | ||
> Details can be found in our [LICENSE](LICENSE.md). | ||
We're so glad you're thinking about contributing to a GSA open source project! If you're unsure about anything, just ask -- or submit the issue or pull request anyway. The worst that can happen is you'll be politely asked to change something. We love all friendly contributions. | ||
|
||
## Submit an issue | ||
|
||
Use the issue tracker to suggest feature requests, report bugs, and ask questions. This is also a great way to connect with the developers of the project as well as others who are interested in this solution. | ||
|
||
## Requesting a change | ||
|
||
Generally speaking, you should fork this repository, make changes in your | ||
own fork, and then submit a pull-request. All new code should have associated unit tests that validate implemented features and the presence or lack of defects. Additionally, the code should follow any stylistic and architectural guidelines prescribed by the project. In the absence of such guidelines, mimic the styles and patterns in the existing code-base. | ||
|
||
## Further inquiry | ||
|
||
We encourage you to read this project's CONTRIBUTING policy (you are here), its [LICENSE](LICENSE.md), and its [README](README.md) and adhere to its [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md). | ||
|
||
If you have any questions or want to read more, check out the [GSA Open Source Policy](https://open.gsa.gov/oss-policy/) and [Guidance repository](https://github.com/GSA/open-source-policy), or just [shoot us an email](mailto:[email protected]). | ||
|
||
--- | ||
|
||
## Public domain | ||
|
||
This project is in the public domain within the United States, and | ||
copyright and related rights in the work worldwide are waived through | ||
the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). | ||
|
||
All contributions to this project will be released under the CC0 | ||
dedication. By submitting a pull request, you are agreeing to comply | ||
with this waiver of copyright interest. |
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,31 @@ | ||
As a work of the United States government, this project is in the | ||
public domain within the United States. | ||
|
||
Additionally, we waive copyright and related rights in the work | ||
worldwide through the CC0 1.0 Universal public domain dedication. | ||
|
||
## CC0 1.0 Universal summary | ||
|
||
This is a human-readable summary of the [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode). | ||
|
||
### No copyright | ||
|
||
The person who associated a work with this deed has dedicated the work to | ||
the public domain by waiving all rights to the work worldwide | ||
under copyright law, including all related and neighboring rights, to the | ||
extent allowed by law. | ||
|
||
You can copy, modify, distribute and perform the work, even for commercial | ||
purposes, all without asking permission. | ||
|
||
### Other information | ||
|
||
In no way are the patent or trademark rights of any person affected by CC0, | ||
nor are the rights that other persons may have in the work or in how the | ||
work is used, such as publicity or privacy rights. | ||
|
||
Unless expressly stated otherwise, the person who associated a work with | ||
this deed makes no warranties about the work, and disclaims liability for | ||
all uses of the work, to the fullest extent permitted by applicable law. | ||
When using or citing the work, you should not imply endorsement by the | ||
author or the affirmer. |
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,10 @@ | ||
hooksPath := $(git config --get core.hooksPath) | ||
|
||
.PHONY: precommit | ||
default: precommit | ||
|
||
precommit: | ||
ifneq ($(strip $(hooksPath)),.github/hooks) | ||
@git config --add core.hooksPath .github/hooks | ||
endif | ||
echo "1.2.3.4" |
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,37 @@ | ||
Role Name | ||
========= | ||
|
||
A brief description of the role goes here. | ||
|
||
Requirements | ||
------------ | ||
|
||
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 | ||
-------------- | ||
|
||
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 | ||
------------ | ||
|
||
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 | ||
---------------- | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
|
||
Public domain | ||
------------- | ||
|
||
This project is in the worldwide [public domain](LICENSE.md). As stated in [CONTRIBUTING](CONTRIBUTING.md): | ||
|
||
> This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). | ||
> | ||
> All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest. |
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,2 @@ | ||
--- | ||
# defaults file for template |
Empty file.
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,2 @@ | ||
--- | ||
# handlers file for template |
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,37 @@ | ||
galaxy_info: | ||
role_name: template | ||
author: GSA GRACE Developers | ||
description: <Description> | ||
company: GSA | ||
license: cc0-1.0 | ||
min_ansible_version: 2.9 | ||
|
||
# If this a Container Enabled role, provide the minimum Ansible Container version. | ||
# min_ansible_container_version: | ||
|
||
# | ||
# Provide a list of supported platforms, and for each platform a list of versions. | ||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
# To view available platforms and versions (or releases), visit: | ||
# https://galaxy.ansible.com/api/v1/platforms/ | ||
# | ||
platforms: | ||
- name: EL | ||
versions: | ||
- 7 | ||
# - name: Windows | ||
# versions: | ||
# - 2016 | ||
# - 2019 | ||
|
||
galaxy_tags: [] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
|
||
dependencies: [] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. |
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,2 @@ | ||
--- | ||
# tasks file for template |
Empty file.
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,2 @@ | ||
localhost | ||
|
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,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- template |
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,2 @@ | ||
--- | ||
# vars file for template |