Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ansible linter test #60

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: run-sanity-tests
description: "Runs sanity tests"
name: run-sanity-and-linter-tests
description: "Runs sanity and linter tests"

runs:
using: composite
Expand All @@ -25,3 +25,7 @@ runs:
- name: "Run sanity test"
shell: bash
run: pushd ~/.ansible/collections/ansible_collections/dynatrace/oneagent && ansible-test sanity && popd

- name: "Run linter test"
shell: bash
run: pushd ~/.ansible/collections/ansible_collections/dynatrace/oneagent && ansible-lint && popd
2 changes: 1 addition & 1 deletion .github/actions/setup-build-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ runs:
python-version: '3.10'
- name: "Install dependencies"
shell: bash
run: pip install ansible
run: pip install ansible ansible-lint
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Build the collection
uses: ./.github/actions/build-collection
- name: Run sanity tests
uses: ./.github/actions/run-sanity-tests
uses: ./.github/actions/run-sanity-and-linter-tests
- name: Run component tests
uses: ./.github/actions/run-component-tests
2 changes: 1 addition & 1 deletion .github/workflows/build-test-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
on:
push:
tags:
- "v*.*.*"

Check failure on line 19 in .github/workflows/build-test-and-publish.yaml

View workflow job for this annotation

GitHub Actions / build-and-test

yaml[trailing-spaces]

Trailing spaces

jobs:
build-test-and-publish:
Expand All @@ -34,7 +34,7 @@
- name: Build the collection
uses: ./.github/actions/build-collection
- name: Run sanity tests
uses: ./.github/actions/run-sanity-tests
uses: ./.github/actions/run-sanity-and-linter-tests
- name: Run component tests
uses: ./.github/actions/run-component-tests
- name: Publish to Ansible Galaxy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-and-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name: "Build, test and upload"
on:
push:
branches: [ "master" ]

Check failure on line 18 in .github/workflows/build-test-and-upload.yaml

View workflow job for this annotation

GitHub Actions / build-and-test

yaml[brackets]

Too many spaces inside brackets
workflow_dispatch:

jobs:
Expand All @@ -30,7 +30,7 @@
- name: Build the collection
uses: ./.github/actions/build-collection
- name: Run sanity tests
uses: ./.github/actions/run-sanity-tests
uses: ./.github/actions/run-sanity-and-linter-tests
- name: Run component tests
uses: ./.github/actions/run-component-tests
- name: Upload the collection
Expand Down
4 changes: 1 addition & 3 deletions roles/oneagent/examples/advanced_config/advanced_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Download OneAgent installer in specific version to a custom directory with additional OneAgent install parameters.
Both linux_other and linux_arm have different user specified by platform args parameter.
hosts: linux_other,linux_arm
collections:
- dynatrace.oneagent
# credentials.yml file contains oneagent_environment_url and
# oneagent_paas_token variables that needs to be stored securely
vars_files:
Expand All @@ -22,4 +20,4 @@
tasks:
- name: Import Dynatrace OneAgent role
ansible.builtin.import_role:
name: oneagent
name: dynatrace.oneagent.oneagent
4 changes: 1 addition & 3 deletions roles/oneagent/examples/local_installer/local_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
Basic OneAgent installation using a local installer. Hosts placed in unix hosts groups have its local installer paths defined in inventory file.
Main node communicates with Windows hosts over SSH.
hosts: windows,unix
collections:
- dynatrace.oneagent
tasks:
- name: Import Dynatrace OneAgent role
ansible.builtin.import_role:
name: oneagent
name: dynatrace.oneagent.oneagent
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
- name: Apply host level configuration with oneagentctl
hosts: linux_other
collections:
- dynatrace.oneagent
vars:
oneagent_install_args:
- --set-host-name=new_host_name
Expand All @@ -12,4 +10,4 @@
tasks:
- name: Import Dynatrace OneAgent role
ansible.builtin.import_role:
name: oneagent
name: dynatrace.oneagent.oneagent
Loading