Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
fix: make sure directory for async is correctly set (#139)
Browse files Browse the repository at this point in the history
* fix: make sure directory for async is correctly set

* style: fix lint
  • Loading branch information
gardar committed Sep 29, 2022
1 parent 07c0f30 commit 4bcbd8f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/molecule_podman/playbooks/create.yml
Expand Up @@ -14,10 +14,16 @@
environment:
PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin"
changed_when: false

- name: save path to executable as fact
ansible.builtin.set_fact:
podman_cmd: "{{ podman_path.stdout }}"

- name: Set async_dir for HOME env
ansible.builtin.set_fact:
ansible_async_dir: "{{ lookup('env', 'HOME') }}/.ansible_async/"
when: (lookup('env', 'HOME'))

- name: Log into a container registry
ansible.builtin.command: >
{{ podman_cmd }} login
Expand Down
5 changes: 5 additions & 0 deletions src/molecule_podman/playbooks/destroy.yml
Expand Up @@ -8,6 +8,11 @@
vars:
podman_exec: "{{ lookup('env','MOLECULE_PODMAN_EXECUTABLE')|default('podman',true) }}"
tasks:
- name: Set async_dir for HOME env
ansible.builtin.set_fact:
ansible_async_dir: "{{ lookup('env', 'HOME') }}/.ansible_async/"
when: (lookup('env', 'HOME'))

- name: Destroy molecule instance(s)
ansible.builtin.shell: "{{ podman_exec }} container exists {{ item.name }} && {{ podman_exec }} rm -f {{ item.name }} || true"
register: server
Expand Down

0 comments on commit 4bcbd8f

Please sign in to comment.