Skip to content

Commit

Permalink
Support root containers for podman
Browse files Browse the repository at this point in the history
By adding "rootless: false" support root containers for podman
driver.
  • Loading branch information
sshnaidm committed Jun 17, 2020
1 parent e9e9675 commit 47e826f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions molecule/model/schema_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ def pre_validate_base_schema(env, keep_string):
"cgroup_manager": {"type": "string"},
"storage_opt": {"type": "string"},
"storage_driver": {"type": "string"},
"rootless": {"type": "boolean"},
},
},
}
Expand Down
1 change: 1 addition & 0 deletions molecule/provisioner/ansible/playbooks/podman/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
become: "{{ not (item.rootless|default(true)) }}"
tasks:

- name: Log into a container registry
Expand Down
1 change: 1 addition & 0 deletions molecule/provisioner/ansible/playbooks/podman/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
become: "{{ not (item.rootless|default(true)) }}"
tasks:
- name: Destroy molecule instance(s)
shell: podman container exists {{ item.name }} && podman rm -f {{ item.name }} || true
Expand Down
1 change: 1 addition & 0 deletions molecule/test/resources/playbooks/podman/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
hosts: localhost
connection: local
gather_facts: false
become: "{{ not (item.rootless|default(true)) }}"
tasks:
- name: Log into a container registry
command: >
Expand Down
1 change: 1 addition & 0 deletions molecule/test/resources/playbooks/podman/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
connection: local
gather_facts: false
no_log: "{{ molecule_no_log }}"
become: "{{ not (item.rootless|default(true)) }}"
tasks:
- name: Destroy molecule instance(s)
shell: podman container exists {{ item.name }} && podman rm -f {{ item.name }} || true
Expand Down

0 comments on commit 47e826f

Please sign in to comment.