From dff8c22030fa43418641c2f1bae47d933db83c02 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 13 Dec 2022 18:05:22 -0700 Subject: [PATCH] init --- .ansible-lint | 6 ++++++ .gitignore | 7 +++++++ .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ .yamllint | 7 +++++++ README.md | 28 ++++++++++++++++++++++++++++ collections/README.md | 14 ++++++++++++++ defaults/main.yml | 2 ++ files/README.md | 1 + handlers/main.yml | 2 ++ roles/README.md | 14 ++++++++++++++ tasks/main.yml | 4 ++++ templates/README.md | 1 + tests/README.md | 3 +++ tests/inventory | 1 + tests/test.yml | 5 +++++ vars/main.yml | 2 ++ 16 files changed, 130 insertions(+) create mode 100644 .ansible-lint create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 .yamllint create mode 100644 README.md create mode 100644 collections/README.md create mode 100644 defaults/main.yml create mode 100644 files/README.md create mode 100644 handlers/main.yml create mode 100644 roles/README.md create mode 100644 tasks/main.yml create mode 100644 templates/README.md create mode 100644 tests/README.md create mode 100644 tests/inventory create mode 100644 tests/test.yml create mode 100644 vars/main.yml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..2394b2a --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,6 @@ +# .ansible-lint +warn_list: + - '204' # Lines should be less than 160 characters + - '701' # meta/main.yml should contain relevant info +skip_list: + - '106' # Role name must match ^[a-z][a-z0-9_]+$ pattern diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cdc6381 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +inventory +roles/* +collections/* +!roles/README.md +!roles/requirements.yml +!collections/README.md +!collections/requirements.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5f5065c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-json + - id: pretty-format-json + - id: detect-private-key + + - repo: local + hooks: + - id: ansible-lint + name: Ansible-lint + description: This hook runs ansible-lint. + entry: ansible-lint --force-color + language: python + # do not pass files to ansible-lint, see: + # https://github.com/ansible/ansible-lint/issues/611 + pass_filenames: false + always_run: true + + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.26.0 + hooks: + - id: yamllint + files: \.(yaml|yml)$ + types: [file, yaml] + entry: yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..04c5633 --- /dev/null +++ b/.yamllint @@ -0,0 +1,7 @@ +--- +extends: default + +rules: + line-length: + max: 140 + level: warning diff --git a/README.md b/README.md new file mode 100644 index 0000000..eb476db --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Ansible AWX Template: Build System Management + +Ansible AWX is the method used for the RESF and its project's infrastructure, as a replacement for using the CLI. This template is for management of the build systems such as koji and peridot. + +## Provides / Information + +This repository is for Build System operations. + +``` +. +├── README.md +├── defaults +│   └── main.yml +├── files +│   └── README.md +├── handlers +│   └── main.yml +├── tasks +│   └── main.yml +├── templates +│   └── README.md +├── tests +│   ├── README.md +│   ├── inventory +│   └── test.yml +└── vars + └── main.yml +``` diff --git a/collections/README.md b/collections/README.md new file mode 100644 index 0000000..a70c7ef --- /dev/null +++ b/collections/README.md @@ -0,0 +1,14 @@ +# Collections + +If you are wanting to use a collection specifically for this, you will need to define it in a `requirements.yml`, otherwise AWX will not install what you need to run your tasks. + +Example: + +``` +--- +# Roles +collections: + - netbox.netbox + - community.aws + - containers.podman +``` diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..858c8da --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# Defaults diff --git a/files/README.md b/files/README.md new file mode 100644 index 0000000..f154f20 --- /dev/null +++ b/files/README.md @@ -0,0 +1 @@ +Files come here diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..03692d8 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# Handlers diff --git a/roles/README.md b/roles/README.md new file mode 100644 index 0000000..169dbf3 --- /dev/null +++ b/roles/README.md @@ -0,0 +1,14 @@ +# Roles + +If you are wanting to use role specifically for this, you will need to define it in a `requirements.yml`, otherwise AWX will not install what you need to run your tasks. + +Example: + +``` +--- +# Roles +roles: + - rockylinux.ipagetcert + src: https://github.com/rocky-linux/ansible-role-ipa-getcert + version: main +``` diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..68a6567 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,4 @@ +--- +# No tasks +- debug: msg="No tasks are provided here. Please import the task as needed in your playbook." +... diff --git a/templates/README.md b/templates/README.md new file mode 100644 index 0000000..25a2632 --- /dev/null +++ b/templates/README.md @@ -0,0 +1 @@ +Templates go here diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..9876b7a --- /dev/null +++ b/tests/README.md @@ -0,0 +1,3 @@ +# Tests + +Basic tests for the playbooks and tasks come here. Generally you need a `test.yml` and `inventory` file with at least `localhost` diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..27fe873 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + tasks: + - import_tasks: example.yml diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..7af2db9 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# Vars that should not be overridden