-
Notifications
You must be signed in to change notification settings - Fork 29
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
Local task fails on realm creation due to missing dirs #78
Comments
You need to include |
Oh, I see, thanks for the quick answer @drybjed ! |
@drybjed for some reason it doesn't work with the following addition: roles:
- role: debops.pki/env
tags: [ 'role::pki' ]
pki_dependent_realms:
- '{{ kubernetes_pki_dependent_realms }}'
- role: debops.secret
tags: [ 'role::pki' ]
secret_directories:
- '{{ pki_env_secret_directories }}'
- role: debops.pki
tags: [ 'role::pki' ]
pki_dependent_realms:
- '{{ kubernetes_pki_dependent_realms }}' But it should according to this template: pki_env_secret_directories.j2. I added 2 debug tasks to ---
- name: DEBUG
debug:
var: pki_dependent_realms
- name: Prepare debops.pki environment
set_fact:
pki_env_secret_directories: '{{ lookup("template", "lookup/pki_env_secret_directories.j2") | from_yaml }}'
- name: DEBUG
debug:
var: pki_env_secret_directories The result is surprising me:
Am I missing something? |
@antoineco Your playbook looks correct. I'm not sure why it doesn't want to work this way. Can you try and debug the variables inside the template? Perhaps add another task that saves the result in a temporary file to see what's happening there. |
@drybjed: Got it. That's because I'm passing my variable as a list like this: - role: debops.pki/env
tags: [ 'role::pki' ]
pki_dependent_realms:
- '{{ kubernetes_pki_dependent_realms }}' However
That's why the template doesn't catch it. A quick workaround is to pass the variable as a string to the - role: debops.pki/env
tags: [ 'role::pki' ]
pki_dependent_realms:
- '{{ kubernetes_pki_dependent_realms }}'
- '{{ etcd_pki_dependent_realms }}' |
@antoineco Right. The template in 1debops.pki/env` would need to flatten the list to work around it. I'll get to it when I have the time, for now try something like this:
That should make the role work correctly. |
@drybjed: Sure, on my side it's easy to work around that. What I was pointing out is that the behavior of the Thanks again for responding so quickly 👌 |
When I declare a new realm in a playbook, the task
Sign certificate requests for current hosts
fails with the following error:It looks like some directory creations are missing, since the playbooks runs perfectly when I create the following empty directory structure locally:
Extract from the playbook:
The text was updated successfully, but these errors were encountered: