Skip to content

Commit 8085eb9

Browse files
committed
Add devil-ansible
0 parents  commit 8085eb9

37 files changed

Lines changed: 7236 additions & 0 deletions

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "ansible-dev-container-codespaces",
3+
"image": "ghcr.io/ansible/community-ansible-dev-tools:latest",
4+
"containerUser": "root",
5+
"runArgs": [
6+
"--security-opt",
7+
"seccomp=unconfined",
8+
"--security-opt",
9+
"label=disable",
10+
"--cap-add=SYS_ADMIN",
11+
"--cap-add=SYS_RESOURCE",
12+
"--device",
13+
"/dev/fuse",
14+
"--security-opt",
15+
"apparmor=unconfined",
16+
"--hostname=ansible-dev-container"
17+
],
18+
"updateRemoteUserUID": true,
19+
"customizations": {
20+
"vscode": {
21+
"extensions": ["redhat.ansible", "redhat.vscode-redhat-account"]
22+
}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "ansible-dev-container-docker",
3+
"image": "ghcr.io/ansible/community-ansible-dev-tools:latest",
4+
"containerUser": "root",
5+
"runArgs": [
6+
"--security-opt",
7+
"seccomp=unconfined",
8+
"--security-opt",
9+
"label=disable",
10+
"--cap-add=SYS_ADMIN",
11+
"--cap-add=SYS_RESOURCE",
12+
"--device",
13+
"/dev/fuse",
14+
"--security-opt",
15+
"apparmor=unconfined",
16+
"--hostname=ansible-dev-container"
17+
],
18+
"updateRemoteUserUID": true,
19+
"customizations": {
20+
"vscode": {
21+
"extensions": ["redhat.ansible", "redhat.vscode-redhat-account"]
22+
}
23+
}
24+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "ansible-dev-container-podman",
3+
"image": "ghcr.io/ansible/community-ansible-dev-tools:latest",
4+
"containerUser": "root",
5+
"runArgs": [
6+
"--cap-add=CAP_MKNOD",
7+
"--cap-add=NET_ADMIN",
8+
"--cap-add=SYS_ADMIN",
9+
"--cap-add=SYS_RESOURCE",
10+
"--device",
11+
"/dev/fuse",
12+
"--security-opt",
13+
"seccomp=unconfined",
14+
"--security-opt",
15+
"label=disable",
16+
"--security-opt",
17+
"apparmor=unconfined",
18+
"--security-opt",
19+
"unmask=/sys/fs/cgroup",
20+
"--userns=host",
21+
"--hostname=ansible-dev-container"
22+
],
23+
"customizations": {
24+
"vscode": {
25+
"extensions": ["redhat.ansible", "redhat.vscode-redhat-account"]
26+
}
27+
}
28+
}

.github/workflows/release.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
outputs:
14+
upload_url: ${{ steps.create_release.outputs.upload_url }}
15+
tag_name: ${{ steps.get_version.outputs.tag_name }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Get version from tag
22+
id: get_version
23+
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
24+
25+
- name: Create Release
26+
id: create_release
27+
uses: softprops/action-gh-release@v2
28+
with:
29+
tag_name: ${{ steps.get_version.outputs.tag_name }}
30+
name: ${{ steps.get_version.outputs.tag_name }}
31+
body: "Release ${{ steps.get_version.outputs.tag_name }} - Building collection and changelog..."
32+
draft: true
33+
prerelease: ${{ contains(steps.get_version.outputs.tag_name, '-') }}
34+
35+
build-ansible-collection:
36+
needs: create-release
37+
runs-on: ubuntu-latest
38+
permissions:
39+
contents: write
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: "3.x"
49+
50+
- name: Install Ansible
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install ansible
54+
55+
- name: Build Ansible collection
56+
run: ansible-galaxy collection build
57+
58+
- name: Get collection filename
59+
id: collection_file
60+
run: |
61+
COLLECTION_FILE=$(ls devil_imps-devil-*.tar.gz)
62+
echo "filename=$COLLECTION_FILE" >> $GITHUB_OUTPUT
63+
64+
- name: Read changelog content
65+
id: changelog
66+
run: |
67+
if [ -f "CHANGELOG.rst" ]; then
68+
echo "changelog_content<<EOF" >> $GITHUB_OUTPUT
69+
cat CHANGELOG.rst >> $GITHUB_OUTPUT
70+
echo "EOF" >> $GITHUB_OUTPUT
71+
else
72+
echo "changelog_content=No changelog available" >> $GITHUB_OUTPUT
73+
fi
74+
75+
- name: Upload collection and changelog to release
76+
uses: softprops/action-gh-release@v2
77+
with:
78+
tag_name: ${{ needs.create-release.outputs.tag_name }}
79+
draft: false
80+
body: |
81+
## Release ${{ needs.create-release.outputs.tag_name }}
82+
83+
### Changelog
84+
85+
```
86+
${{ steps.changelog.outputs.changelog_content }}
87+
```
88+
89+
### Files
90+
- **Collection**: `${{ steps.collection_file.outputs.filename }}`
91+
- **Changelog**: `CHANGELOG.rst`
92+
files: |
93+
${{ steps.collection_file.outputs.filename }}
94+
CHANGELOG.rst
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Release to ansible-galaxy
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
release_automation_hub:
10+
uses: ansible/ansible-content-actions/.github/workflows/release_galaxy.yaml@main
11+
with:
12+
environment: release
13+
secrets:
14+
ansible_galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }}

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Test CI
3+
4+
concurrency:
5+
group: ${{ github.head_ref || github.run_id }}
6+
cancel-in-progress: true
7+
8+
on:
9+
- push
10+
- pull_request
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
# changelog:
17+
# uses: ansible/ansible-content-actions/.github/workflows/changelog.yaml@main
18+
# if: github.event_name == 'pull_request'
19+
build-import:
20+
uses: ansible/ansible-content-actions/.github/workflows/build_import.yaml@main
21+
ansible-lint:
22+
uses: ansible/ansible-content-actions/.github/workflows/ansible_lint.yaml@main
23+
sanity:
24+
uses: ansible/ansible-content-actions/.github/workflows/sanity.yaml@main
25+
# unit-galaxy:
26+
# uses: ansible/ansible-content-actions/.github/workflows/unit.yaml@main
27+
# unit-source:
28+
# uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
29+
# with:
30+
# collection_pre_install: >-
31+
# git+https://github.com/ansible-collections/ansible.utils.git
32+
all_green:
33+
if: ${{ always() }}
34+
needs:
35+
# - changelog
36+
- build-import
37+
- sanity
38+
# - unit-galaxy
39+
# - unit-source
40+
- ansible-lint
41+
runs-on: ubuntu-latest
42+
steps:
43+
- run: >-
44+
python -c "assert 'failure' not in
45+
set([
46+
'${{ needs.sanity.result }}',
47+
'${{ needs.ansible-lint.result }}'
48+
])"

0 commit comments

Comments
 (0)