Skip to content

Commit

Permalink
Move role plugins to collection scope
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak committed Oct 31, 2023
1 parent fd44cfd commit bdbc368
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nephelaiio-mongodb-*.tar.gz
*.ymle
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GITHUB_ORG = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 1)
GITHUB_REPO = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 2)
REQUIREMENTS = requirements.yml
ROLE_DIR = roles
PLUGIN_DIR = plugins
ROLE_FILE = roles.yml
COLLECTION_NAMESPACE = $$(yq '.namespace' < galaxy.yml)
COLLECTION_NAME = $$(yq '.name' < galaxy.yml)
Expand All @@ -27,14 +28,19 @@ lint: install

requirements: install
@rm -rf ${ROLE_DIR}/*
@rm -rf ${PLUGIN_DIR}/*
@poetry run ansible-galaxy role install \
--force --no-deps \
--roles-path ${ROLE_DIR} \
--role-file ${ROLE_FILE}
@poetry run ansible-galaxy collection install \
--force-with-deps .
@find roles -wholename "*meta/main.yml" | xargs sed -ie 's/nephelaiio\.plugins/nephelaiio.mongodb.plugins/g'
@find roles -wholename "*meta/main.yml" | xargs sed -ie 's/nephelaiio\.mongodb_repo/nephelaiio.mongodb.repo/g'
@find ${ROLE_DIR} -wholename "*meta/main.yml" | xargs sed -ie 's/nephelaiio\.plugins/nephelaiio.mongodb.plugins/g'
@find ${ROLE_DIR} -wholename "*meta/main.yml" | xargs sed -ie 's/nephelaiio\.mongodb_repo/nephelaiio.mongodb.repo/g'
@find ${ROLE_DIR} -type d -name filter_plugins | xargs -r cp -a -t ${PLUGIN_DIR}/
@find ${ROLE_DIR} -type d -name test_plugins | xargs -r cp -a -t ${PLUGIN_DIR}/
@rm -rf ${ROLE_DIR}/plugins
@grep -Rl sorted_get ${ROLE_DIR} | xargs -rL 1 sed -ie 's/sorted_get/nephelaiio.mongodb.sorted_get/g'

build: requirements
@poetry run ansible-galaxy collection build
Expand Down
2 changes: 2 additions & 0 deletions plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit bdbc368

Please sign in to comment.