Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepend local roles path to ANSIBLE_ROLES_PATH #5118

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions changelog/fragments/ansible-set-local-rolespath.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
(ansible/v1) Previously, when scaffolding an Ansible-based operator with
both Roles and Playbooks, the roles imported by the playbook could not be
found when running locally (`make run`). This change prepends the
`ANSIBLE_ROLES_PATH` environment variable with the path to the local
roles directory.
kind: "bugfix"
breaking: false
migration:
header: (optional) Add local Ansible Roles path to Env in `make run`
body: >
If you would like to run your operator locally using `make run`, modify
the `run` target in the `Makefile` to:
`ANSIBLE_ROLES_PATH="$(ANSIBLE_ROLES_PATH):$(shell pwd)/roles"
$(ANSIBLE_OPERATOR) run`
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ help: ## Display this help.
##@ Build

run: ansible-operator ## Run against the configured Kubernetes cluster in ~/.kube/config
$(ANSIBLE_OPERATOR) run
ANSIBLE_ROLES_PATH="$(ANSIBLE_ROLES_PATH):$(shell pwd)/roles" $(ANSIBLE_OPERATOR) run

docker-build: ## Build docker image with the manager.
docker build -t ${IMG} .
Expand Down
2 changes: 1 addition & 1 deletion testdata/ansible/memcached-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ help: ## Display this help.
##@ Build

run: ansible-operator ## Run against the configured Kubernetes cluster in ~/.kube/config
$(ANSIBLE_OPERATOR) run
ANSIBLE_ROLES_PATH="$(ANSIBLE_ROLES_PATH):$(shell pwd)/roles" $(ANSIBLE_OPERATOR) run

docker-build: ## Build docker image with the manager.
docker build -t ${IMG} .
Expand Down