Skip to content

Commit 8956dcf

Browse files
committed
Cleanup
1 parent ac4e10b commit 8956dcf

File tree

10 files changed

+83
-95
lines changed

10 files changed

+83
-95
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly

.github/workflows/collection.yaml .github/workflows/release.yaml

+24-26
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: Collection
1+
name: Release
22

33
on:
44
push:
55
branches:
66
- main
77

88
jobs:
9-
collection:
10-
name: Collection
9+
release:
10+
name: Release
1111
runs-on: ubuntu-24.04
1212
if: github.event.head_commit.message == 'Release'
1313
steps:
1414

15-
- name: Notify Slack of starting
15+
- name: Notify Slack - Starting
1616
uses: act10ns/slack@v2
1717
with:
1818
status: starting
@@ -23,59 +23,57 @@ jobs:
2323
- name: Checkout
2424
uses: actions/checkout@v4
2525

26-
- name: Create ansible galaxy token
26+
- name: Set ansible galaxy token
2727
run: |
2828
cat << EOF > ./galaxy_token
2929
token: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
3030
EOF
3131
32-
- name: Env
33-
run: |
34-
cp .env .env.local
35-
3632
- name: Set up system
3733
uses: ./.manala/github/system/setup
3834

39-
- name: Retrieve version from galaxy.yml
40-
id: version
35+
- name: Get metadata from galaxy.yml
36+
id: metadata
4137
uses: CumulusDS/[email protected]
4238
with:
4339
file: ./galaxy.yml
44-
version: version
4540

46-
- name: Build Collection
41+
- name: Build
42+
id: build
4743
run: |
48-
make collection.build
44+
make build VERBOSE=1
4945
50-
- name: Create artifact from collection build
46+
- name: Upload build artifact
5147
uses: actions/upload-artifact@v4
5248
with:
53-
path: ./manala-path-${{ steps.version.outputs.version }}.tar.gz
54-
name: manala-path-${{ steps.version.outputs.version }}
49+
path: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz
50+
name: manala-path-${{ steps.metadata.outputs.version }}
5551
retention-days: 1
5652

57-
- name: Publish Collection
53+
- name: Publish
54+
id: publish
5855
run: |
59-
make collection.publish
56+
make publish VERBOSE=1
6057
61-
- name: Get Changelog Entry
58+
- name: Get Changelog entry
6259
id: changelog
6360
uses: mindsers/changelog-reader-action@v2
6461
with:
6562
path: ./CHANGELOG.md
66-
version: ${{ steps.version.outputs.version }}
63+
version: ${{ steps.metadata.outputs.version }}
6764

68-
- name: Create Github Release
65+
- name: Create GitHub Release
66+
id: release
6967
uses: ncipollo/release-action@v1
7068
with:
71-
name: manala-path ${{ steps.version.outputs.version }}
72-
tag: ${{ steps.version.outputs.version }}
69+
name: manala-path ${{ steps.metadata.outputs.version }}
70+
tag: ${{ steps.metadata.outputs.version }}
7371
body: ${{ steps.changelog.outputs.changes }}
74-
artifacts: ./manala-path-${{ steps.version.outputs.version }}.tar.gz
72+
artifacts: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz
7573
token: ${{ secrets.GITHUB_TOKEN }}
7674
skipIfReleaseExists: true
7775

78-
- name: Notify Slack of job status
76+
- name: Notify Slack - Status
7977
uses: act10ns/slack@v2
8078
with:
8179
status: ${{ job.status }}

.manala.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ system:
2121
dir: /usr/share/ansible/collections/ansible_collections/manala/path
2222
env_file:
2323
- .env
24-
- .env.local
24+
- path: .env.local
25+
required: false
2526
git:
2627
config: |
2728
# Silence false positive dubious ownership errors

.manala/docker/compose.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ services:
1111
build:
1212
context: ..
1313
dockerfile: docker/Dockerfile
14-
image: manala-ansible-path:20240912125058
14+
image: manala-ansible-path:20240913091855
1515
volumes:
1616
- ../..:${MANALA_DIR}
1717
environment:
1818
MANALA_DIR: ${MANALA_DIR}
1919
MANALA_CACHE_DIR: ${MANALA_CACHE_DIR}
2020
env_file:
2121
- ../../.env
22-
- ../../.env.local
22+
- path: ../../.env.local
23+
required: false
2324
working_dir: ${MANALA_DIR}
2425
# Use default docker bridge network
2526
network_mode: bridge

Makefile

+17-14
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,24 @@ test.coverage:
7272
--color yes
7373
.PHONY: test.coverage
7474

75-
##############
76-
# Collection #
77-
##############
75+
###################
76+
# Build / Publish #
77+
###################
7878

79-
MANALA_COLLECTION = manala-path-*.tar.gz
79+
COLLECTION = manala-path-*.tar.gz
8080

81-
## Collection - Build ansible collection artifact
82-
collection.build: SHELL := $(MANALA_DOCKER_SHELL)
83-
collection.build:
84-
rm -rf $(MANALA_COLLECTION)
85-
ansible-galaxy collection build --force --verbose
86-
.PHONY: collection.build
81+
## Build - Build collection
82+
build: SHELL := $(MANALA_DOCKER_SHELL)
83+
build:
84+
rm -rfv $(COLLECTION)
85+
ansible-galaxy collection build \
86+
$(if $(VERBOSE), --verbose) \
87+
--force
88+
.PHONY: build
8789

8890
## Collection - Publish collection
89-
collection.publish: SHELL := $(MANALA_DOCKER_SHELL)
90-
collection.publish:
91-
ansible-galaxy collection publish $(MANALA_COLLECTION)
92-
.PHONY: collection.publish
91+
publish: SHELL := $(MANALA_DOCKER_SHELL)
92+
publish:
93+
ansible-galaxy collection publish $(COLLECTION) \
94+
$(if $(VERBOSE), --verbose)
95+
.PHONY: publish

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ See [Ansible Using collections](https://docs.ansible.com/ansible/devel/user_guid
5656

5757
## Use this collection
5858

59-
See the [examples playbook](./examples/examples.yaml).
59+
See the [examples](examples).
6060

6161
## Release notes
6262

examples/examples.yaml

-42
This file was deleted.

examples/simple.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
3+
# This playbook example contains simple use cases that illustrate the basics functionality of manala.path.path module.
4+
5+
- name: Examples - Simple
6+
gather_facts: false
7+
hosts: localhost
8+
tasks:
9+
10+
- name: Ensure a directory exists at path
11+
manala.path.path:
12+
path: /tmp/directory
13+
14+
- name: Ensure the specified path (file or directory) is absent
15+
manala.path.path:
16+
path: /tmp/file
17+
state: absent
18+
19+
- name: Ensure the specified file at path contains content
20+
manala.path.path:
21+
path: /tmp/file_content
22+
content: |
23+
Hello World!
24+
25+
- name: Ensure the specified file at path contains rendered template content
26+
manala.path.path:
27+
path: /tmp/file_template
28+
template: template.j2

examples/template.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello : {{ 'World' }}
1+
Hello {{ 'World' }}!

galaxy.yml

-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ readme: README.md
1818
authors:
1919
- Manala <[email protected]>
2020

21-
2221
### OPTIONAL but strongly recommended
2322
# A short summary description of the collection
2423
description: path handling
@@ -70,10 +69,3 @@ build_ignore:
7069
- Makefile
7170
- manala-path-*
7271
- tests
73-
74-
# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a
75-
# list of MANIFEST.in style
76-
# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key
77-
# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive
78-
# with 'build_ignore'
79-
# manifest: null

0 commit comments

Comments
 (0)