-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* host is now Ubuntu >=20.04 * add Ansible Lint support and GHA * add Devcontainer for easy ansible lint check
- Loading branch information
Showing
43 changed files
with
620 additions
and
536 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,15 @@ | ||
--- | ||
exclude_paths: | ||
- ".github" | ||
- "/docker-compose.yml" | ||
- "/docker-compose.*.yml" | ||
|
||
kinds: | ||
- playbook: "tests/urlshort_simple.yml" | ||
|
||
skip_list: | ||
- package-latest # we don't change this role with all the versions | ||
- latest[git] # same | ||
- role-name[path] # we nest roles here to avoid 1000 dependencies | ||
- var-naming[pattern] # we use uppercase variables for stored facts | ||
- var-naming[no-role-prefix] # our role variables don't follow this pattern |
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,30 @@ | ||
{ | ||
"name": "libvirt-ansible-dev", | ||
"dockerComposeFile": [ | ||
"docker-compose.yml" | ||
], | ||
"service": "ansible", | ||
"overrideCommand": true, | ||
"containerUser": "root", | ||
"workspaceFolder": "/etc/ansible/roles/hicknhack-software.libvirt", | ||
// "capAdd": ["SYS_ADMIN", "SYS_RESOURCE"], | ||
// "securityOpt": ["seccomp=unconfined", "label=disable", "apparmor=unconfined"], | ||
"updateRemoteUserUID": true, | ||
"postStartCommand": ".devcontainer/install_requirements.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"redhat.ansible" | ||
], | ||
"settings": { | ||
"files.associations": { | ||
"**/defaults/*.yml": "ansible", | ||
"**/handlers/*.yml": "ansible", | ||
"**/tasks/*.yml": "ansible", | ||
"**/vars/*.yml": "ansible", | ||
"**/templates/*.j2": "ansible-jinja" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,17 @@ | ||
--- | ||
name: hnh-libvirt | ||
|
||
volumes: | ||
ansible-colletions: | ||
|
||
services: | ||
ansible: | ||
image: "ghcr.io/ansible/community-ansible-dev-tools:latest" | ||
volumes: | ||
- ..:/etc/ansible/roles/hicknhack-software.libvirt | ||
- ansible-colletions:/root/.ansible/collections | ||
working_dir: /etc/ansible/roles/hicknhack-software.libvirt | ||
tty: true | ||
stdin_open: true | ||
environment: | ||
- ANSIBLE_HOST_KEY_CHECKING=false |
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 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null | ||
|
||
ansible-galaxy install -r requirements.yml |
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 @@ | ||
name: Ansible Lint | ||
|
||
on: push | ||
|
||
jobs: | ||
ansible-lint: | ||
name: "Run Ansible Lint" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Make Symlink | ||
run: >- | ||
mkdir -p /home/runner/.ansible/roles | ||
&& ln -s $(pwd) /home/runner/.ansible/roles/hicknhack-software.libvirt | ||
- name: Run Ansible Lint | ||
uses: ansible/ansible-lint@main | ||
with: | ||
requirements_file: "requirements.yml" |
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 @@ | ||
{ | ||
"ansible.python.interpreterPath": "/bin/python3", | ||
"files.associations": { | ||
"**/defaults/*.yml": "ansible", | ||
"**/handlers/*.yml": "ansible", | ||
"**/tasks/*.yml": "ansible", | ||
"**/vars/*.yml": "ansible", | ||
"**/templates/*.j2": "ansible-jinja" | ||
} | ||
} |
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
Oops, something went wrong.