Skip to content

Commit

Permalink
improved molecule usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fatz committed Oct 28, 2022
1 parent 3fecabc commit 00de00f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ COPY packer /root/packer
# this is needed for containerd tar
# place it in /usr/share/ansible/collections, the container will be run with a different user
RUN mkdir -p /usr/share/ansible/collections && ansible-galaxy collection install ansible.utils -p /usr/share/ansible/collections
RUN mkdir -p /usr/share/ansible/collections && ansible-galaxy collection install community.general -p /usr/share/ansible/collections

WORKDIR /root
ENTRYPOINT ["/usr/local/bin/konvoy-image"]
1 change: 1 addition & 0 deletions Dockerfile.devkit
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ RUN if [ "${DOCKER_GID}" -ne "${GROUP_ID}" ]; then \
# this is needed for containerd tar
# place it in /usr/share/ansible/collections, the container will be run with a different user
RUN mkdir -p /usr/share/ansible/collections && ansible-galaxy collection install ansible.utils -p /usr/share/ansible/collections
RUN mkdir -p /usr/share/ansible/collections && ansible-galaxy collection install community.general -p /usr/share/ansible/collections


# hadolint ignore=DL3059
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ endif

include make/ci.mk
include make/images.mk
include make/molecule.mk
include hack/pip-packages/Makefile
include test/infra/aws/Makefile
include test/infra/vsphere/Makefile
Expand Down
34 changes: 34 additions & 0 deletions make/molecule.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: molecule_test_%
molecule_test_%:
cd ansible/; molecule test -s $*

.PHONY: molecule_dev_%
molecule_dev_%:
cd ansible/; molecule test -s $* --destroy=never

.PHONY: molecule_converge_%
molecule_converge_%:
cd ansible/; molecule converge -s $*

.PHONY: molecule_verify_%
molecule_verify_%:
cd ansible/; molecule verify -s $*

.PHONY: molecule_destroy_%
molecule_destroy_%:
cd ansible/; molecule destroy -s $*

.PHONY: molecule_dev molecule_converge molecule_test molecule_verify molecule_destroy
molecule_dev: molecule_dev_default
molecule_converge: molecule_converge_default
molecule_test: molecule_test_default
molecule_verify: molecule_verify_default
molecule_destroy: molecule_destroy_default

.PHONY: molecule
molecule: molecule_dev
@echo "Molecule ran through. For test driven development you can now write"
@echo "your test. Afterwards you can run molecule_verify to see the expected"
@echo "fail. Once the ansible code is added it could be applied with "
@echo "molecule_converge. Another molecule_verify should succesfully run now"
@echo "molecule_destroy will destroy your instances and the secutiry groups"

0 comments on commit 00de00f

Please sign in to comment.