Skip to content

Commit

Permalink
Add utility requirements makefile target
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak committed Oct 14, 2023
1 parent 80c5de4 commit c26cc91
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GALAXY_API_KEY ?=
GITHUB_REPOSITORY ?= $$(git config --get remote.origin.url | cut -d: -f 2 | cut -d. -f 1)
GITHUB_ORG = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 1)
GITHUB_REPO = $$(echo ${GITHUB_REPOSITORY} | cut -d/ -f 2)
REQUIREMENTS = requirements.yml

all: install version lint test

Expand All @@ -20,6 +21,16 @@ lint: install
poetry run yamllint .
poetry run ansible-lint .

roles:
[ -f ${REQUIREMENTS} ] && yq '.$@[] | .name' -r < ${REQUIREMENTS} \
| xargs -L1 poetry run ansible-galaxy role install --force || exit 0

collections:
[ -f ${REQUIREMENTS} ] && yq '.$@[]' -r < ${REQUIREMENTS} \
| xargs -L1 echo poetry run ansible-galaxy -vvv collection install --force || exit 0

requirements: roles collections

dependency create prepare converge idempotence side-effect verify destroy login reset:
MOLECULE_DOCKER_IMAGE=${MOLECULE_DOCKER_IMAGE} poetry run molecule $@ -s ${MOLECULE_SCENARIO}

Expand Down
3 changes: 2 additions & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ roles:
version: master
scm: git
collections:
- community.mongodb
- community.general
- community.mongodb
2 changes: 0 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
ansible.builtin.template:
dest: "{{ mongos_config_file }}"
src: mongos.j2.yaml
owner: "{{ mongos_user }}"
group: "{{ mongos_group }}"
mode: 0644
vars:
_port: "{{ mongos_service_port }}"
Expand Down
3 changes: 1 addition & 2 deletions templates/mongos.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ sharding:

net:
port: {{ _port }}
bindIpAll: true
ipv6: false
bindIp: 0.0.0.0

processManagement:
fork: false
Expand Down

0 comments on commit c26cc91

Please sign in to comment.